Self-updating application – philosophy

desktop applicationinstaller

This is a philosophical question.

Given a hypothetical desktop application, and a desire to provide automatic updates (rather than forcing people to go to a website, check for an update, download an update, install), which of the two is more of a "best practice" approach?

  1. Like iTunes, it checks to see if there is a new version and prompts the user to download the new version. If so, it downloads a full install executable (in this case, a Windows Installer file (.msi)) that installs the full version (not just an upgrade to the previous version – too much to manage if there are multiple versions out there). So, let's say, it's version 10.1.1 – whether you are installing fresh or upgrading, you use the same file. After it downloads, it instructs the user to close the application and run the install file themselves.

  2. Similar to the other one, it checks for a new version and prompts user to download it, but instead of just downloading an executable and prompting the user to run it, it actually runs it for them – shutting down the program they have open, acquiring the necessary security to install files.

Issues with #2: many issues around closing down program, since the program can open other programs (Outlook and Excel), or what if the user was in the middle of something. Also around security, you need local administrator access to install, what if you don't have it? In later versions of Windows, you cannot just override the person's security.

Issues with #1: some people believe this will be too hard, too much effort for the end-user.

I would strongly prefer to go with #1 because it will save 80-120 hours on my project, and is simpler to implement and maintain. However, we have people who feel strongly on all sides.

What is a best practice for this sort of thing?

Best Answer

Personally, I rather like Google Chrome's approach. A base directory with a launcher, and subdirectories for each installed version of the software. The launcher just looks for the highest version number and uses that and deletes older versions as needed. An updater task runs every so often to download and create new directories. When new versions are installed, the running application requests a restart to use the new version.

Related Topic