Thursday, September 27, 2007

ClickOnce - move install/update location

After having used ClickOnce with the Smart Client Software Foundation Framework, we had to move the installation location, as the server was replaced and re-organised.

We were assuming that our customers who use the client, which is currently only partially rolled out, will have to manually reinstall the client by calling the appropriate new URL, as simply changing the update location in the Manifest file doesn't impress the client and doesn't cause any action.

After some HTTP sniffing, I found out that the ClickOnce client does, as hoped, check back on the installation server and opens the .application file, which is already good but obvious as well. As I wrote, simply changing the update/install location in this manifest file doesn't lead to any updating (which makes sense, keeping in mind that this is the first ClickOnce version and a beefed up release is on its way). So I tried and updated the "Required Version" setting in the server manifest file and re-started the application on a client. Again, it opens the now updated manifest file, triggers an update and thus causes the app to start downloading a new version (which in the meantime needs to be around on the new server).

Conclusion: Also installed clients can be pushed to accept a new install location, without manually touching all client instances.

Requirements:
- New version needs to be published (to new location)
- All clients need to be updated prior to disabling the old install location

Steps (for the more efficient reader in short form):
- Publish a new ClickOnce version to new install/update location
- Edit application_name.manifest file on old/current install location to reflect new install location AND
Increase Minimal Required Version to indicate version published on new location
- Make sure that all installed clients update themselves
- (NOT TESTED) Switch off old install location