Posted by: chaiguy1337 on: October 21, 2008
Since the beginning of the FeedBeast project, I’ve been on something of a quest to find the perfect self-extracting executable maker, and I’m delighted to say I’ve finally found it! You may have already heard of it; it’s called WinRAR.
Windows software deployment is a complex process. Coming from the Mac and getting dumped into the deep end of Windows deployment, so to speak, it was quite a shock. There are a great many things you need to worry about just to get your software onto your end-user’s PC, and the headaches are multiplied if you’re deploying a .NET-based app like FeedBeast or OrangeNote.
One of the key concerns in such a deployment is making sure that the user’s computer has the .NET framework installed, before even beginning the installation of your product. This is done with the aid of what’s called a “bootstrapper”. [I'm not entirely sure where that term came from, but I reckon it has something to do with the idea of "strapping" something onto your program, which is exactly what a bootstrapper does.] It’s basically a second executable that sits alongside your installer (usually called “setup.exe”) that performs several checks to make sure your system has the necessary “prerequisites” for your program to run and/or install, optionally downloading and installing them if they are lacking.
The problem that arises from this configuration is we now have a whole directory of junk to distribute, not a nice clean singular installer file like we started with. In today’s web-deployed world, this is a real problem: users don’t want to have to download and extract a zip file just to gain access to the installer. This is where a self-extracting executable comes in.
A self-extracting executable bundles all of these pieces together into a zip file, but packages that zip file as an actual executable program, with enough logic built-in that it can extract its contents and launch the bootstrapper silently, so that it appears as though the self-extractor is the installer. This is the perception we want to give the user, because it makes things all that much simpler if they can just download a single executable file, run it, and install the program they’re trying to get.
However, it’s not always so easily achieved.
The thing is, while the idea of the self-extractor is simple, there are actually a lot of subtle points that need to be addressed when building the perfect one. First of all, we need to keep in mind that the self-extractor is what the user is going to see, not the (now embedded) installer. Therefore, the ability to customize its icon is quite handy and professional. But there’s more.
Here’s my checklist for capabilities in a self-extracting executable maker, all of which WinRAR excels at:
There are also a ton more options such as the ability to customize the dialogs and logo and display a license agreement–there are seven tabs worth of customizations for self-extracting executables alone!
To put it plainly, WinRAR is well worth the $29 single-user fee. The self-extraction options alone are worth the price. However if even that is too steep for your tastes, there are some free options available, like 7-Zip and IExpress, but if you want the whole package, and my advice, go with WinRAR.
Next: How to write a simple but flexible bootstrapper using the awesome AutoIt scripting language!
Update: I just discovered that WinRAR self-extracting executables even support command-line argument passing! This means I can pass arguments to my WinRAR self-extractor and it will pass them along to the bootstrapper, which (depending on the bootstrapper) can even forward them onto the actual msi, allowing you to define variables that can then be interpreted by the installation engine! Awesome!
June 1, 2009 at 1:59 pm
How do you go about passing parameters using the WinRar SFX?