Jump to content
Sign in to follow this  
catbird61

AutoIT "best practices"?

Recommended Posts

catbird61

Hi, I'm just getting started with AutoIT, automating a driver install that has resisted any kind of repackaging because both Windows driver signing and file protection interfere. The manufacturer has only provided an interactive driver install program with no provision for unattended installation, and the company's support staff have pretty much blown me off (as I expected they would). Saw a reference to this product in researching workarounds and am very impressed -- wish I'd known about this a long time ago and for numerous purposes.

Anyway, I have a script working, although in need of a few refinements, but I'm a little concerned about whether I'm doing things the way that will yield the most robust results. The driver install program is a wrapper exe that calls subinstallation routines. It starts out with a lengthy unpacking and file validation process; then wrapper executes. Each subinstall program takes a keystroke or two and then runs for a little while before the next dialog appears.

So far I've been able to get this working with sleep commands, but I'm worried that if something else is using resources on the computer -- something I'd like to say for sure won't happen, because this install is going to be part of a larger configuration process that will ultimately be controlled by our customer -- the sleep pauses will be insufficient. It will be run on a limited number of models of machines with a fairly consistent environment, well, at least at the point this configuration will be run. My impression is that it's not important whether the sleeps are too long, just if they're too short.

Should I be doing this a more sophisticated way and what would that way be? Find out the process names for all the subinstallation programs and use ProcessWait to monitor and then send the next keystrokes? Should WinWaitActive be detecting the windows without the sleeps if I AutoItSetOptions set appropriately?

Many thanks,

Maggie

Share this post


Link to post
Share on other sites
erik7426

Hi, I'm just getting started with AutoIT, automating a driver install that has resisted any kind of repackaging because both Windows driver signing and file protection interfere. The manufacturer has only provided an interactive driver install program with no provision for unattended installation, and the company's support staff have pretty much blown me off (as I expected they would). Saw a reference to this product in researching workarounds and am very impressed -- wish I'd known about this a long time ago and for numerous purposes.

Anyway, I have a script working, although in need of a few refinements, but I'm a little concerned about whether I'm doing things the way that will yield the most robust results. The driver install program is a wrapper exe that calls subinstallation routines. It starts out with a lengthy unpacking and file validation process; then wrapper executes. Each subinstall program takes a keystroke or two and then runs for a little while before the next dialog appears.

So far I've been able to get this working with sleep commands, but I'm worried that if something else is using resources on the computer -- something I'd like to say for sure won't happen, because this install is going to be part of a larger configuration process that will ultimately be controlled by our customer -- the sleep pauses will be insufficient. It will be run on a limited number of models of machines with a fairly consistent environment, well, at least at the point this configuration will be run. My impression is that it's not important whether the sleeps are too long, just if they're too short.

Should I be doing this a more sophisticated way and what would that way be? Find out the process names for all the subinstallation programs and use ProcessWait to monitor and then send the next keystrokes? Should WinWaitActive be detecting the windows without the sleeps if I AutoItSetOptions set appropriately?

Many thanks,

Maggie

I created a script that automates the install of some games. It does basically what you want. It uses WinWait, WinActivate, and ControlClick. If you haven't already check out those commands in the Help file. An invaluable tool when writing your script is the AU3Info found in the SCITE editor under tools. Here is a snippet of my script...

Opt("WinTitleMatchMode", 4)
Opt("WinTextMatchMode", 1)
Opt("WinDetectHiddenText", 1)
Opt("WinWaitDelay", 50)

Run($ProgEXE)

WinWait("Setup","It is recommended that you close all other applications")
If Not WinActive("Setup","It is recommended that you close all other applications") Then WinActivate("Setup","It is recommended that you close all other applications")
ControlClick("Setup","It is recommended that you close all other applications","TButton1")

Share this post


Link to post
Share on other sites
Bert

If I remember right (cobwebs in the way here...) you could do a Wise install. What you do is take a PC and take a snapshot of all the settings and so forth. Install the driver in this case, then take a second snapshot. Do a compare, and see what was changed. This is what you put in the package. You are basically making your own installer, but you get what you want.

http://www.symantec.com/business/package-studio

Installshield makes a simular product that will do the same thing. There may be a opensource varient, but I do not know what it is.

Share this post


Link to post
Share on other sites
catbird61

Many thanks . . . it was obvious to me that there were better ways to be doing this, but there were so many choices I needed help with knowing what my first approach should be. Maggie

I created a script that automates the install of some games. It does basically what you want. It uses WinWait, WinActivate, and ControlClick. If you haven't already check out those commands in the Help file. An invaluable tool when writing your script is the AU3Info found in the SCITE editor under tools. Here is a snippet of my script...

Opt("WinTitleMatchMode", 4)
Opt("WinTextMatchMode", 1)
Opt("WinDetectHiddenText", 1)
Opt("WinWaitDelay", 50)

Run($ProgEXE)

WinWait("Setup","It is recommended that you close all other applications")
If Not WinActive("Setup","It is recommended that you close all other applications") Then WinActivate("Setup","It is recommended that you close all other applications")
ControlClick("Setup","It is recommended that you close all other applications","TButton1")

Share this post


Link to post
Share on other sites
Smiley357

I have had the same issue that you have with drivers and software installs. Most of the time the exe is just a packager. If you pause the install and watch the temp files (or if it gives you the location just look there) I have found that an .msi is already created. All you have to do is add the correct switch to do a silent install. If there isnt an .msi I have found that the drivers themselves have switches to make them install silently. After you run the exe that unpacks the files, open up command prompt and type the setup.exe /? or whatever filename they have in the install folder. It should give you a list of switches on how to install the file silently.

There are several freeware software that Volly has described. Do a google search for msi packager opensource or msi packager freeware.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×