The wonderful thing about

...is I'm the only one
Everything here is my personal opinion. I do not speak for my employer.
October 2007
November 2007

2007-10-14 »

(This is part of a series about the UI design issues in the free Versabanq AmSchedule Express. This is not an advertisement, because if you're reading this, you have no use for my program. But download it yourself if you want to follow along. Absolutely no registration or signup is required.)

AMSE Part 2: Self-upgrading software

AmSchedule Express can check automatically whether a new version is available. If it is, a new button appears on the toolbar:

The great thing about writing programs that are all contained in a single .exe file and can install themselves rather than requiring a separate setup program is that the logical next step - making it download and upgrade to new versions automatically - is almost trivially easy. The process looks like this:

  1. Download the new .exe file into the user's temp directory.
  2. Show a toolbar button with a label like, "Try the new version."
  3. If/when the user clicks the button, execute the new .exe file (wherever it may be lying around) and exit the old one.
  4. The new .exe file runs as if it isn't currently installed - which it isn't.
  5. If you don't like it, exit it. Windows will clean up your temp directory eventually. Your old version is still installed.
  6. If you do like it, click the same install button you used to install it the first time. It'll overwrite the old version - of course, since we know all versions, new and old, consist of a single .exe file.

It was joyfully easy to write this code, although I've done it before. Long, long ago, around 1993, I wrote a Windows 3.1 program ("FoxCon," the Foxnet Communications Inc. console) that did something similar for an ISP. Then, when we made the first versions of Nitix, I did pretty much the same thing, except since Nitix is a whole operating system it's much more complicated to code up and test (it involves rebooting). The same tricks apply, though: combine all the little files into a single blob (in Nitix's case, actually three blobs, but whatever), try running the new version without installing it permanently, and if the new version works, only then will you even be able to click the Install button and switch away from your old version.

Sometimes I wish this stuff weren't so obvious, so I could patent it. Apparently nobody would license my patent anyway, though, since patent or not, nobody does it but me. Sigh.

Next time: death to menu bars! How AMSE's toolbar is optimized for usability.

Why would you follow me on twitter? Use RSS.
apenwarr-on-gmail.com