I know, I know, I know…… I know what yer thinking…. “Why????”. Well, as much as I am against it, I didn’t have a choice. A client demanded we deploy it at one of their facilities despite all the sensible arguments we had against it. All that aside, I figured if I had to install it on 40 machines, I was at least going to do a mass deployment from remote and not go around installing it one at a time. Screw that.
So I went to work figuring out a way to install it quietly and without user intervention. This turned out to be far more difficult than I had planned. But, in the end, I hashed out what I believe to be a fairly straight-forward solution. Before I go into this tutorial, you’re going to need some tools….
Optionally, another nice thing to have is Notepad ++, which is more like a code editor than Windows Notepad. It isn’t a full-blown IDE or anything, but it is capable of syntax hi-lighting and has support for a multitude of languages. I find it handy for editing config files, etc.
Now that you have the tools, install everything -except- AIM 7. Once you’ve done that, kick off the AIM 7 installer and then STOP.

Stop when you see this screen
Now look for “setup.exe” in your Task Manager and kill the process. When the setup launches, it properly unpacks the contents of the installation package to a subdirectory in your local temp directory. On my Windows XP box, this path is “C:\Documents and Settings\<user name>\Local Settings\Temp\AIM_7.3.14.1″.

At this point, I created a project folder to hold the contents of the package. You can create it anywhere (not inside the unpacked AIM folder). I called mine “AIM” and then created a subdirectory called “source” and another called “build”. Under the “source” directory, I created another called “package”, which I then copied the contents of the AIM7 folder in my temp directory to. Now if you take a look at the “setup.ini” file in your “package” directory, you’ll notice 3 sections at the end of the file called “SEARCH”, “HOMEPAGE”, and “IETOOLBAR”. These are optional components that the AIM7 asks you to install. Simply comment these entire sections out. Like so:

Note the commented sections.
Once you’ve made the changes, save the file. This will give the installer nothing to prompt you for at the beginning of setup AND prevent the installation of AIM’s extra crap. Now launch XN Resource Editor and open “gui.dll” in the “package” folder. Locate dialog # 107 as shown below:

You need to completely remove this dialog. Simply right-click on the dialog in the tree and then click “Delete Resource”. Save the changes. By removing this dialog, we get rid of the prompt at the end of the setup basically just asking us to click “OK”. At this point, we’re done hacking the installer, now we can move on to the fun stuff. First, we need to re-package the contents as a self-extracting archive. Launch PeaZip, then click File–>Create Archive. Choose “self-extracting” as the type, then drag the entire “package” directory onto the PeaZip window, then click the “create .sfx” button to create the package. When asks where to save it, choose your “build” directory we created earlier. You should now have a file called “package.exe” in your “build” folder.

Now we’re going to need a script to kill any existing AIM processes at runtime, then unpack the “package.exe” file and run the “setup.exe” program. Enter AutoIt. I love this scripting language. Its free, lightweight, very fast, extremely powerful and can be compiled to a standalone executable. You can download my script here. Feel free to write your own that accomplishes the same task, or use mine directly, or use mine as an example.
Essentially what the script does is kill any previous AIM process versions using a helper function, then creates a temp directory and moves the “package.exe” file to it. Once there, it unpackages the package into the temp directory (quietly). This will create a “package” subdirectory inside the temp directory containing the package contents we modified earlier. The script then runs the “setup.exe” file inside the “package” directory and waits for it terminate. Once the process terminates, it removes the “package” directory and the “package.exe” file.
Once you have your script, compile it as “aim_silent_setup.exe” in your “build” folder. You can do this by clicking Tools–>Compile from the AutoIt code editor (SciTE4AutoIt3). You should now only have 2 files in your build folder, “aim_silent_setup.exe” and “package.exe”. Now you’re in the homestretch.
Launch SFX Maker and click the “Directory” tab. Choose your “build” folder for the “Directory Path” option, then choose “aim_silent_setup.exe” for the “File to Run” option, then choose where you want to save the SFX (silent self-extracting installer), and then choose the “aim.ico” file from your source “package” folder to use as your icon. See below:

Ready to build the package.
Now all you have to do is click the “Create” button and it will compile the final package. At runtime, this package will unpack our 2 exe’s and then run the “aim_silent_setup.exe” which does the rest. Once “aim_silent_setup.exe” is finished, the SFX will cleanup our 2 exe’s from the temp directory it unpacks them to.
And there you go! A self-contained installer that won’t prompt the user and runs (mostly) silent. I tested running this without an interactive session with SYSTEM privileges and it seemed to work just fine. I had no trouble deploying to the 40 workstations I had to get it installed on via a DeepFreeze maintenance window.
Caveat:
If an error occurs during the AIM setup, it is possible the installer will stop and attempt to prompt the user with an error message. I have found no good way to counter this other than to add some code to the AutoIt script to basically monitor the process and force-terminate if it is still running after a certain length of time. The AIM setup itself does not support silent mode switches or anything like that, so the only good way to handle this is use our boot-strapper script to react based on theoretical scenarios. Yes, you could possibly wait for a window title to appear and simulate a button click or something, but since this is designed to be able to run from a non-interactive session, that may not be an option. Just something to think about.