Last summer I started working on a project for unattended installations written in AutoIT. AutoIT is a very simple scripting language that was originally written to automate installing programs. It has been expanded to be able to do more than just simple automation. It also has its own IDE which uses SciTE. Features include syntax highlighting, code completion and a very nice help manual with examples for each function. I have even written a very lightweight FTP client to replace using Microsoft’s FTP client and Expect at work.
My original idea was to simply have a program record all changes made to the registry and file system and create a new installer. This worked fine for a few simpler programs. This didn’t work for everything though, some programs had a few thousand registry entries and I didn’t feel like going through them all. I wasn’t sure what changed while Windows was running and I didn’t want to include those entries with the new installer. I ended up getting frustrated and trying other methods. I wanted it to be consistent rather than having a bunch of ideal ways of depending on the type of installer. The only option that I found was to automate the clicking of the buttons in the installer. This would work for pretty much everything and I didn’t have to worry about tracking registry changes.
This method has several disadvantages though and it will take up your screen while it performs the installation. You can’t be doing anything else while it is performing an installation. Several controls at the time couldn’t be manipulated with the built-in functions and I had to rely on the mouse. Since the installation is running while the user is logged in they have to be an administrator. Also, if want to run an installation with administrative privileges and the user is a limited user you can’t allow the user to manipulate the program. Doing so would allow privilege escalation. Programs also seemed to act differently while running like this. There is a function built in to block input but after a user issues a three finger salute (ctrl + alt + del) it will re-enable the keys and mouse. The only way to overcome this is to simply issue the call over and over. If anything goes wrong with the input disabled there will be limited things you can do to continue.
Despite these limitations I continued to develop it :S I made installers for about 30 programs and automated many Windows settings. I haven’t made any changes to it since the end of the summer last year. I’m releasing it so that someone may make use of it and it doesn’t become a complete waste. You can find the code here.
I will go over briefly the operation of the program. I started a with a slipstreamed Windows XP Professional CD with SP2 and all of the hotfixes. You will need to have the installation run runonce_script.exe (using WINNT.SIF) once the installation finishes. This will search for a CD with the label called “unattended” and run unattended.exe. This program loads unattended.ini to determine which programs to run. It creates a shortcut C:\Documents and Settings\All Users\Start Menu\Programs\Startup\runonce.lnk to runonce_script.exe. So when the computer reboots it will continue where it left off. The reason I didn’t use a registry entry here is because I found a problem with doing it that way. During testing my computer took longer than usual to load and some program started to install before explorer loaded and it didn’t properly click on the buttons. I also used to have a two minute timeout before it would start but I found this rather annoying when I was testing.
The next program to run by default is to install drivers. Depending on how many computers you are setting up the drivers can be on a separate CD. It will search through the computers.ini file and based on the computer name load the settings out of the ini file in the computers folder. You can also have it copy the drivers to the hard drive in case you need them later.
The program SP3 (not an actual service pack) which installs remaining hot fixes that wouldn’t properly slipstream. I included additional updates including the .NET frameworks and Windows Media Player.
The install will setup per user settings next by using the AutoAdminLogon registry key to login the user and reboot. It can load additional registry settings as well. Sadly this area relies on using sleep for delays and will probably break under slow machines. It will customize the taskbar, start menu, folder settings and a few others.
The system customizations come next and include the components that are in add or remove programs and the systems tab. I’m pretty sure that it doesn’t cover everything in the system properties because I got rather lazy and I only needed to change a few things. This area will also turn on the activity icons for the network adapters.
Norton Ghost 2003 was used to save my now pristine system that I could return to it before installing all the programs. This was back before I knew about SteadyState (formally Shared Computer Toolkit).
Lastly, it will go though installing programs. This can use another different CD as well. The basic design it to match some area of text that is visible and press a button. There is no checking to see if the program is installed before running. For installers that can determine if the program is already installed it will just cancel the installation of the program. While over the course of creating this many programs had newer versions come out and I updated several of the scripts to work with the latest version. What changes between versions? Well when I was using (control IDs?) they would be different between the versions. I found out that the most consistent installer was Firefox. Which only required me to rename the script to match the new version. Usually the installers don’t change much and once you have created an installer updating it is fairly painless. This type of unattended installation requires a lot of effort to keep up to date.
Ideally this problem is because of people not creating installers with silent switches. Reflecting on this whole process I think ideally I should have created custom installers for programs. I probably would have left the MSI packages (I wanted consistency and control) alone since they were the ones that made the largest amount of registry changes. A lot of the changes could be turned into a registry file that could be imported instead of automating mouse movements and button clicks. I’m glad on Linux this problem doesn’t exist.

how did you do the silent install with autoit ?