There is a neat little tool called IExpress that has been around for a long time. IExpress creates a self-extracting EXE from a specified set of files. The resultant executable can be configured to prompt the user (“Are you sure you want to install?”), display a license file, run another executable (or batch file or .INF file), and run a post-installation command. The configuration is defined in a SED (Self Extraction Directive) file, which is based on the old school INI file format.
You can play with this yourself. Simply open the Run dialog and type “IExpress” and hit Enter:
Peruse the tool a bit. I think you will find this useful. I use it all the time. I just used in last week to ship a setup system to a client. It builds a nicely compressed, self-extracting (and cleans it self up after the final program executes), executable. Nice! The problem, of course, is that the IExpress user experience is one from at least ten years ago.
This weekend I thought I would solve that problem and another problem I have. Most of my client installs are .NET installations with all the required assemblies in the target directory. When I need to patch a single file, I usually create a simple self-extracting EXE using IExpress with a batch file to do the patching. That works great but I am always doing the same thing over and over again—a pattern that soon invokes the tool-builder in me.
So, here is an updated GUI for IExpress and a patching tool called QuickPatch!
IExpress takes command line switches for the silent creation of executables and the SED file format is easily reverse engineered (and it is somewhat documented). So, the task at hand is to create a system to generate the SED file and call IExpress to generate the executable. Here is a screen shot:
The application is a MDI (Multiple Document Interface) WinForms application. Along the left is a pane called the Patch Library, which is as you would expect: a library of all the patches created. The pane can be hidden. Clicking the button creates a new patch, which is displayed maximized in the main body of the form. Clicking the button will open the patch currently selected in the library. Clicking the button saves the current patch. The patch is saved as a binary representation of the Patch class (we will talk about how I implemented this in a later post). Clicking the button creates the patch.
All of the SED settings are supported:
- Optionally prompt the user with a text message
- Optionally display a license
- Run an executable
- Run an post-installation executable
- Specify how the windows should be displayed (normal, hidden, maximized, or minimized)
- Specify whether an animation should be displayed when the files are being extracted
- Specify reboot options
- Allow for the selection of files for inclusion in the executable
- Generate the executable.
First a target path for the resultant executable is selected. Then the build is performed. You can see the status messages above.
And viola! Your self extracting executable is created.