views:

172

answers:

4

Specifically, this is for a .NET 2.0 desktop application. Currently we require the user to manually go through the update process via our website.

What are the best ways of doing a silent or automatic upgrade of the client behind the scenes?

Thanks!

+4  A: 

You may take a look at ClickOnce or Updater Application Block.

Darin Dimitrov
+1 for mentioning ClickOnce.
KMan
+7  A: 

I would suggest a read of chapter 4 of Microsoft's .NET Applications Lifecycle Guide. The one I would promote is hooking up an Automatic Update system - you can write a small system to contact a web server that you own, check if there is an upgrade available, download and install the upgrade patch.

Travis Gockel
+1 have done that myself in the past and is pretty uninstrusive.
davek
+1  A: 

I'm not a big fan of ClickOnce. I like the concept, but not the specific implementation.

The way I have done an application update system in the past is to zip all the application's files into a container file and put it on my web server. To make things easier, I automated the creation of the container file. On the web server, I have a version info file that lists the current version and the container's url like this: 1.0.0.0|http://www.example.com/path/to/container.file. To parse the version info file, all the application needs to do is split the file contents using the pipe character '|'. The first array element will be the version number and the second element will be the container file path.

On startup and at an regular interval such as every 2 days (just in case the user leaves the application running for an extended period of time), I have the application check the version info file on the web server and determine if the version listed there comes after the running version. If there is an update, the application prompts the user. If the user wants the update, the application downloads the container from the url specified in the version info file and saves the contents in the application's folder, renaming the currently running exe to xxx.exe.old to allow the new exe to be saved as xxx.exe. Then the application restarts itself and the new exe deletes xxx.exe.old.

When you want to publish a new version of your application, all you need to do is increment the version number of your application, update the version info file with the new version number, and upload an updated container file to your web server.

Zach Johnson
+2  A: 

I would rather not have an application doing silent updates without my knowledge.

In fact, I would prefer to be told that an update is required, a silent update would be perceived to be malicious, hiding something from the user and taking over the machine without my consent. What would happen if the silent update screwed up the machine without having knowledge of why the machine 'appears broken' due to a screwed up registry etc...

Yes it is debatable...

My 2cents, Best regards, Tom.

tommieb75
Well, if you've given an application permission to run, you've already given it permission to do something malicious. And updates always pose a risk of screwing up your machine - you still need to ensure the update is good.Google's Chrome browser is doing silent updates, which is what brought my attention to this. I think it will become an accepted practice.
greg7gkb