Making tools to automate repetitive tasks is an important and sometimes overlooked software developer skill. Where I work, we have scripts for automating a nightly build (check out, build, unit test, email the results), deploying our website, deploying our software to test, staging and production environments, checking in released binaries, etc.
One of the things I need to do a lot is make small demonstrations of the software my company sells, complete with an installation program. Almost all of my installers do the same three things: put some files in the program directory or web server document directory, make some registry entries, and maybe make an ODBC DSN.
I use a tool called InstallMaster from Wise to make installers. It's a great tool, but it's designed to handle a wide range of installation possibilities. After doing my second install, it was clear that I was only going to need a small subset of its features.
Luckily, InstallMaster files are text files and are fairly easy to read and generate. I took one of the files and looked for the specific things I would want to change. Then I designed a simple property file to express those parameters. A Perl script reads this file and customizes the Wise template based on the specifics of my install. The file looks like this:
# project settings
# files to install
# registry entries
Now, the next interesting thing about my projects is that even their parameter files don't differ that much from project to project. So, next I wrote a Perl script to generate the parameter file from a project directory. It looks for the standard sub-directories and generates the parameter file for whatever is there. Next, it runs the script to generate the file for InstallMaster, and finally it runs InstallMaster on that to generate the installation program.
It's now at the point where I can make a new project, use the standard directory names and then when I'm done just run:
and get a MyProject.exe suitable for sending to a customer.
At work last week, I overheard someone say:
If you're going to buy that house, you really should take my wife there, because she can tell right off if it's haunted.
He then went on to tell anecdotes of how she had detected hauntings before. He was totally serious.