Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Self Updating Application

I have a general question for the group. I am about to start a large project for my team that, I suspect, we will be doing as a desktop application (I am generally a web guy in my application outlook but I am open to change.)

My big concern is that the current desktop applications in the company are already a pain in the keister to maintain, or more to the point, to distribute when a change needs to be made. So I would want to develop something that prompted the user (our employees) to update the software if it is out of date on their computer.

Those of you who have done this before, I would appreciate any advice on what pitfalls to look out for. Also I would be interested in any online resources that anyone found helpful in addressing similar requirements.

Thanks.

EDIT: I realize I suck!! I did forget to mention some of the most important details. It will be a Window applications, written using the .NET framework, targeting Win XP and higher.

like image 544
Peter Lange Avatar asked Nov 04 '09 00:11

Peter Lange


1 Answers

If you want to implement it yourself, it's quite easy as well. Our application polls a web service for information periodically with roughly the following API:

getVersion(Installation ID): returns release version to be installed and hash of all files
getFileList(Version ID): gets a list of files and file hashes for the release
getFile(File ID): gets one file

Pros: By coding logic into your getVersion method, you can push different versions to different customers and it also allows you to push beta releases to a limited amount of customers first.

Checking hash on all your downloaded files makes sure your application downloads files properly. This can also be used to repair damaged application files. When the hash for the release matches the hash for all downloaded files, it's time to install.

To install, have your main program start an update application and exit. The update should replace all changed application files. The update program can also run any SQL change scripts or registry changes related to the release.

At the end of the update program, start your main application again and have the main application update the update program if needed. They update each other, so you can push bugfixes both to the update program and the main application.

I also recommend testing downgrade before pushing a new release to customers, so you can automatically switch to an old stable release if any critical bugs are found.

like image 184
Ztranger Avatar answered Nov 09 '22 18:11

Ztranger