29 November 2012

Stepping through an installation with AutoIT

Share

Programs such as trial versions of Autodesk and Adobe CS6 cannot be packaged up for distribution. You may be put in a situation where you need to deploy a trial version out to a set of users for them to evaluate it. The traditional packaging programs are not going to work here because of the licensing issue. Here is how to use AutoIT to deploy them.

You will want to first step through the program documenting every keystroke required, from start to finish. You do not want to use your mouse. Next, Open up AutoIT. The first thing you will want to do is initiate the installation with the simple Run command. Next, use the WinWait command to wait for the first screen to appear. You will see the title of the window at the top left bar. Use the WinActivate to make sure that window is at the forefront. There are now two ways to proceed to the next page if the window title does not change. I use the WinSetTitle command to change the title of the window. When the next window appears, the title usually changes back to the default, Which is what you next set the WinWait to wait for. If the name does not change on the next page, then you will be forced to guesstimate the time it will take to proceed to the next page on the slowest system you have. Another important thing to remember is to use the Sleep command between each command because the script can go faster than the program is executing, therefor becoming asynchronous, thereby causing the installation script to go in a permanent pause state. I usually use 500 milliseconds, which seems to always be sufficient. Another important thing to do is comment between each screen in the script. That way, you will know where the script is between each window.