This question already has an answer here:
-
Automatic update a Windows application
5 answers
I need to keep a program I've written up to date, this will happen frequently over the next year or so, this will need to be done over the Internet. Where would you suggest I start, are there any common techniques? Any suggestions welcome.
Thanks
Fairly well is not good enough :)
NAppUpdate is an open-source library I wrote to address just this. The general idea is to have the greatest flexibility, at the lowest overhead possible.
So, integration is super-easy, and the library does pretty much everything for you, including synchronizing operations. It is also highly flexible, and lets you determine what tasks to execute and on what conditions - you set the rules. Last by not least is the support for any updates source (web, BitTorrent, etc) and any feed format - whatever is not implemented you can just write by yourself.
Cold updates (requiring an application restart) are also supported, and done automatically unless "hot-swap" is specified for the task.
This all boils down to one DLL, less than 70kb in size.
More details at http://www.code972.com/blog/2010/08/nappupdate-application-auto-update-framework-for-dotnet/
Code is at http://github.com/synhershko/NAppUpdate (Licensed under the Apache 2.0 license)
ClickOnce is perfect for this sort of scenario.
There is this great framework called NetSparkle
and also this DotNetUpdater
I haven't used them yet but hope to do so very soon. You can try it out.
ClickOnce is a good solution, but if you wish to have total control then you can roll-your-own. I would suggest polling a webservice to find if there are later versions available, downloading required files to a side-by-side directory, and using a launcher (or updating a shortcut) to automatically launch the latest version.
This is a little complicated, but caters for situations where the application may be running, and can therefore not be overwritten.