views:

268

answers:

5

Hi All,

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.

+2  A: 

You haven't specified what language/platform/framework you're using, but I'd recommend using one that has this functionality built in.

Microsoft has ClickOnce deployments, and I know Adobe Air does something similar. Here's a SO question talking about having auto-update functionality in Java.

Daniel Schaffer
+2  A: 

You didn't specify the target operating system but on OS X a good choice that is supposed to me very easy to add is Sparkle.

GameFreak
+6  A: 

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.

Ztranger
+3  A: 

What we do is; when the application starts up or every hour or so we make a GET request to our webserver.

http://www.domain.com/app/versionCheck.php?app=APP%5FNAME&version=2.1.1.1

The script checks the database and compares the versions. If the version is different "UPGRADE" is send back to the utility, other wise "GOOD"

If the utility receives "UPGRADE", it sends the users to a predetermined URL to download the newest version of the utility.

This works well with smaller utilities (<20mb).

Suggestions

  • If there is no internet connection to check the versions, don't bother telling them just time out and wait for one to be come available. If + 25 time outs then tell the user.
  • KISS, you don't need to have the Upgrade URL in the response, just send them to a pre defined url.
Steven smethurst
+3  A: 

Since you are using .NET and Windows ClickOnce should work fine for you, as Daniel said.

Another option is to use Shadow Copying. Basically telling your assemblies to execute from a different location to the one they are installed on. This will allow your application to update its own files even though the assemblies are loaded. I have not used this before myself, but have seen it demonstrated a couple of times.

ClickOnce would be a simpler solution and I would go for that unless you have some need that it doesn't meet. ClickOnce would allow you to publish the application to a web server or network share and allow your users to automatically update their copy when a new version is available. From memory it checks automatically and prompts the user when they attempt to start the application.

Glenn Condron