Rod
Rod

Reputation: 4451

How to change the way ClickOnce is deployed

I've published a WPF app for ClickOnce deployment, to a network share. Now I've been told it needs to be changed to an Intranet web deployment. (Wish I'd known that before...)

So how do I change how a ClickOnce deployment is deployed?

Upvotes: 0

Views: 46

Answers (1)

G Davison
G Davison

Reputation: 1099

A useful post by Johann Blais @ http://johannblais.blogspot.com/2009/04/change-deployment-url-of-clickonce.html shows you how to move an existing app without forcing users to uninstall and reinstall, as long as your app that is already deployed is configured to check for updates. In summary, you deploy out a version in your new location that only knows how to update itself from the new location, then you deploy out a version in the old location that only knows how to update itself from the new location. When the publish version numbers are configured as below, your app will go to the correct location for updates.

  1. In VS, adjust your project so:
    1. Publish Folder: new file path (to a folder you can write to on your webserver, e.g. \mywebserver\uploads\myapp
    2. Installation folder (blank, takes above)
    3. Updates folder (blank, takes above)
    4. Publish Version: a couple of versions above what your current version is.
  2. Publish your project.
  3. In VS adjust your project so:
    1. Publish Folder: old deployment path, e.g. your existing fileshare
    2. Installation folder: (blank, takes above)
    3. Updates folder: URL from your webserver http://mywebserver/myclickonceapp/
    4. Version: has to be greater than what is installed on the clients smaller than the new deployment in step 1.4)
  4. Publish Project

As long as your clients are configured to auto-update, you can move from file share to file share, file share to web (and probably visa versa) using Johann's steps above.

Upvotes: 1

Related Questions