AMSE Part 1: Everything I know about software installation in 0.5 seconds or less
Recently my new company released a free Windows application (it also runs under WINE) called AmSchedule Express (AMSE). It does some basic banking calculations that readers of my journal probably don't care about. However, the program does a lot of neat non-banking-specific things that I'm really proud of.
My all-time favourite feature of AMSE is its installation process. I've written before about setup/install programs, and I generally hate them. They're scary. They make you feel like installing and uninstalling programs is a complex operation not to be performed by mere mortals. And the fact is, that's mostly true. Except it shouldn't be.
AMSE takes all the advice I gave in my tips for writing Windows setup.exe installers. Since it's the first program I've ever seen that does all these things right, I think it's worth pointing out some of them in detail.
- All the files it needs are in a single .exe file, tied together using my KRAM library. You can't accidentally copy, install, or delete only part of the program.
- It uses the registry only to recall personal preferences, not critical (and often redundant) operational information. It finds its executable by looking at argv, like any good program should.
- It runs without being installed at all. You simply download the executable and run it, and it works.
- It knows how to install itself. A button on its toolbar says "Install
in Start Menu:
When you click it, it changes to "Installing..." Almost exactly 0.5s later, it changes to "Done!", and after another brief delay, disappears completely. During that process, it copies its (single) .exe file to your Program Files directory(1), sets up some registry keys for its *.am file association, and creates a Start Menu entry for itself.(2)
- The only reason the installer takes 0.5 seconds to install is that I put in a 0.5-second Sleep() (yes, it's capitalized and takes milliseconds, not seconds, in Win32) statment. Actually, the time it takes to install the program on a modern computer is small enough to be unobservable by humans. I needed the delay because if it's too fast, it's hard to believe anything has actually happened (or even read the "Installing..." message), and my test users thought it was broken.(3)
- A similar "Uninstall" option is available from the Help menu. Unlike installing, it asks for confirmation first. This is because installing the application is both nondestructive and desirable (for us); it makes the program a bit more "viral." But uninstalling is hard to undo, since you might have lost the original executable, so we'd better ask first.(4)
Even if you have no use for AMSE, the installer is just plain fun to try. Why not download it and see for yourself? And please email me if you have any comments about any aspect of the program; I'd love to hear about it.
(1) Actually, the Program Files directory is not writable if you're not an admin user. I sincerely hate setup programs that actually execute just fine as a normal user goshdarnit but then refuse to do their job because they're just so helpless, and they really can't make your program work unless you're an admin. AMSE just puts itself in your personal Local Settings folder if it can't write to Program Files.
(2) Incidentally, the Start Menu icon is added directly to Start->Programs, not to a subfolder. Why do people keep putting subfolders in there? For every app I install, there's always only one program I actually want to run. The other icons just make that one program even more annoying to find, and this is even worse because the folder always has the same stupid folder icon, while my application has an actual program icon that makes it easier to skim for. And no, I don't need a desktop icon for your stupid obnoxious app, and neither does anybody else, thanks for asking (and they all ask, too).
(3) This isn't the first time I've had to add an arbitrary delay to one of my installation programs for exactly this reason. Most installers just feel annoyingly slow (and I suspect it's just bad programming, not Sleep statements). But, perhaps because of that trend, an installer that takes zero time makes people uncomfortable. The best answer is a happy (if synthetic) medium.
(4) While initially writing the install/uninstall feature, I had the Uninstall button appear on the main menu bar (replacing the disappearing Install button) when the program detected that it was installed. I also didn't have a confirmation dialog. I did that only temporarily, because it made the testing easier. And man, the testing was fun. It just feels so great to push a button, get instant feedback, and in basically no time feel like you accomplished something. Click. "Is it installed? Hmm, let me check the start menu... yup!" Click. "Is it uninstalled? ... yup!" I must have done this for half an hour straight, with varying obstacles like in-use .exe files alrady in the destination directory, etc. I'm sorry to have denied you the experience - and non-sucky software installation is a rare experience indeed - but for usability reasons it was necessary to very slightly discourage the undesirable/destructive operation (uninstalling), so it had to go into a dropdown menu instead.
Next time: with self-installing comes... self-upgrading!
ssh+2FA to all your machines, anywhere, without opening firewall ports.