Writing Software Install Programs - Island of Sanity

Island of Sanity


Writing Software Install Programs

As a software developer, I routinely have to write install programs. But install programs can be surprisingly complicated. So I decided to study what the experts have done, the install programs that come with expensive commercial products from big companies. After a careful review of their products, I have come up with the following list of tips and pointers for others who would write install programs:

(Note 1: I was specifically thinking of Windows install programs. Unix installs have different issues, and it's been a long time since I even played with a Mac.)

(Note 2: Names have been left out to protect the guilty. Well, mostly to protect me, from lawsuits.)

Take it as a working assumption that now that the user has purchased your software product, this is the only thing they will ever want to do on their computer for the rest of their lives.

Add a couple of dozen icons to the user's desktop. Make your company's web site the home page in the user's browser, so every time they connect to the Internet from now on they automaticaly go to your site. Add hooks to your product in as many other products as you can find. (Do this by adding menu picks if you have to, but better still is to have a tool window for your product that comes up every time the user opens, say, Word and Excel and any other commonly-used product you can think of. Okay, this one is fairly tough to do, and only the best install-program developers manage it.) And of course, declare yourself the owner of every file type you've ever heard of, so any time the user tries to open a file it is your program that starts up.And of course, don't provide any sort of uninstall program. Or if you feel you must to keep up appearances, make sure it doesn't really delete everything that you installed on the system, but leaves behind some big DLL's and a few hundred registry entries. Hey, when your girlfriend dumped you she never gave back the ring: if a customer dumps you why should they get back their disk space and system performance?

Examples of these points are too numerous to even begin to mention.

When there are optional components to install or other choices the user must make, don't waste the users time by explaining what any of these options mean.

Users are easily confused by long, explanatory text like "Select this option if you are converting from database Xyz version 7. This will automatically read your Xyz 7 files, convert them to the new database format, and then delete them." Much better to give a simple, concise explanation like "V7 xvert".

If your product includes complicated and confusing features that most of your customers will not want to use, and your programmers were foolish enough to provide options to turn these features on or off, make sure the install initially sets them all to "on".

My favorite entrant in this category is a certain word processing program from a major software company. It includes a feature to automatically start sequentially numbering lines or paragraphs if you begin any line with a number. Shortly after buying and installing this product, my daughter tried to use it to type up her math homework. So she set out to type "7", next line "+3", then an underline, then next line "10". She typed "7" and pressed enter. The program promptly supplied "8". We spent considerable time figuring out just what was doing this and how to turn it off.

Take it for granted that every customer has exactly the same hardware and software configuration that you have.

Make sure your software will only run on the absolute latest version of Windows or the absolute latest version of the Pentium chip, even if you don't really need any of the new features. Tie your product to a specific Web browser, or better yet, a specific version of a specific Web browser. Assume that all your customers have the highest-resolution video boards and monitors available on the market, or better yet that they have some oddball video card that you bought at the manufacturer's closeout sale. Etc.Some examples:

I once bought a modem that included hardware features and supporting software to let your computer work as a video phone. Cool I guess, but not a feature I particularly cared about. So the fact that it said on the box that I needed a certain version of the Pentium chip to do the video phone stuff -- a version later than what I had -- didn't particularly bother me. Except ... except that it turned out that the modem software wouldn't even start up unless you had the chip that supported the video conferencing, even if all you were trying to do was connect to the Internet.

But I give first prize to this product: Their install program automatically and without warning reformatted drive D:, and then used it as work space to unpack their archives before moving files to the appropriate directory. I guess the people who invented this product had a drive D: set up on their systems as some kind of scratch work area. But, uh, not everybody in the world does that. At the time I was using a computer that had two physical drives: a small drive C: that had the operating system and some system-type stuff, and then a large drive D: with all my real work. For someone with no drive D: at all, I presume the install would have simply failed. For someone with a drive D:, like me, all the work you'd done since you bought the computer would suddenly be erased. Luckily for me, their install program blew up for other, unrelated reasons before it got to the reformatting part, and I was trying to figure out what the problem was when I saw the "format d:" stuff.

Well, I'm sure these tips only scratch the surface. But they're a start. Try to apply them, and before you know it you'll be writing install scripts just like the pros!

© 2003 by Jay Johansen


vijay Mar 14, 2012

hi sir we are developing a project by using java scripting with html pages, but we don't know how to write an installation code which is used to install that product in client system. so kindly suggest me how to write the installation code. and also it is very helpful if u have any example code on it.

plz reply me sir.

Jay Johansen Mar 16, 2012

Here's my shortest answer: I have an installation program I wrote about ten years ago. (Wow, long time.) It's not particularly pretty or fancy but it works. And while a client paid me to write it, it was under a contract that allows me to give it away for free. I tried to attach it to an email to you but Gmail said it didn't like the attachment, I don't know if because it's too big or what. If you're interested, I can put it on a website where you can download it.

This install program uses a script to tell it what to actually install. I'm sending you an example install script. The gist of it is that there are various sections to the script where you can give the list of files to be installed, registry keys to be set, text to display for license screens, etc. It allows you to pick any number of directories to copy files to, either user-specified or hard-coded. I'm sure the script is not obvious, but if you're interested in using this let me know and I'll see if I can throw together some explanation. (I don't think we ever wrote any documentation on this, other than the code itself.)

(If you want to play with this, maybe I should at least tell you this much: An install package or disk must include setup.exe and setup.ini in its top-level directory. Under that should be a directory named "garage" that contains all the files to be installed. If it's a CD you probably also want an autorun.inf to make the setup run automatically when the disk is inserted.)

I'm happy to chat with you about your installation issues. Actual I wonder why you need an installation program at all. If this is a web site, why not just hand install it? Or is the idea that you will sell this product and each client will install it on his own web site?

Add Comment