views:

123

answers:

2

I want to add a very very simple auto updater to my apps. I want to start with the simplest thing that'll work.

Any suggestions of how to do this? Any suggestions of improvements (or an alternative) to the option below?

Here's one option I'm considering.

  1. App displays a form that offers to check for a new version, with option to check again every X days.
  2. If user clicks "check now" it launches a web page www.mysite.com/CheckNewVersion.asp?AppID=<>?AppVersion=<>
  3. The ASP script has a list of all the program IDs and the currently available versions. IT then shows them either a page saying "No new versions available" or "New version with XYZ features/fixes" (and either "Free update" or "pay here").

This gives 80% of the benefit of auto updating with only 10% of the cost. If no one clicks on the autoupdate (and I suspect that's a possibility as people don't want to be bothered) then it's pointless to make it any simpler. There's no way to make it so simple that they don't have to at least click the "update" button.

BTW, I do realize that there is a similar question on SO but that didn't discuss the implementation details. It seemed more theoretical and aimed at a more sophisticated solution.

+1  A: 

In Mac OS X, the Sparkle framework is very popular in apps for automatic updates. It works somewhat like this:

The first time the user starts an app, it will ask whether to check for updates automatically or not (and the interval between checks sometimes). When the user says they want to check for updates, the app will generally check for updates on startup, but no more than once per day.

On the server there is an XML file or script producing such a file with the available software versions and a short summary or changelog for each version. When there is no update available, the app does nothing. The user is not informed AT ALL.

When an update is available, the app prompts: "An update is available" with the new version number, the changelog and the following buttons: "Update" and "Skip this version".

The buttons are self-explanatory of course.

Gerco Dries
+1  A: 

My suggestion (after building a few of these myself) is to start out with a slightly different system. Have your application run the check internally by looking at a static XML file on the server, ex: /AppVersion_[AppID].xml The xml file just describes the current public release with the current build/version number and maybe a timestamp and full path to the latest binary as well as an MD5 checksum. This will cut down a lot of work and complexity to start off with.

Your application just pulls down this XML file and compares the version information in the file to its current version. If it's newer you could pop up a friendly dialog box asking the user to upgrade.

If the user does want to upgrade, pull down the setup binary from the path in the XML file, check the MD5 checksum and then launch it with shell execute. This saves the user from having to download your file and ensures that the file is downloaded without any problems.

I would suggest upgrading from VB6 to VB.NET for the following reasons:

1) A magical control in the .NET BCL called WebClient that makes obtaining the string contents of a URL as easy as a one line call. Also, the WebClient will download a file to a specified disk location in one call.

2) Built in XML support is fantastic.

Here's some basic VB.NET code to get you started that will download one of your software products and run it:

Dim TargetRemoteSetupFile As String = "http://www.bungalowsoftware.com/downloads.asp?programlist=/download/aphasia_tutor_1_and_2_outloud_install.exe"
Dim LocalDownloadPath As String = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "BungalowSoftwareInstall.exe")

Dim FileDownloaderWebClient As New System.Net.WebClient()

Try
   FileDownloaderWebClient.DownloadFile(TargetRemoteSetupFile, LocalDownloadPath)
Catch ex As Exception
   System.Diagnostics.Debugger.Break()
   '...
Finally
   FileDownloaderWebClient.Dispose()
End Try

System.Diagnostics.Process.Start(LocalDownloadPath)
Robert Venables