Diane

Help with Creating au3 Script from msi Using Window Info Tool

3 posts in this topic

Hi,

I am a newbie to Autoit and I've only done basic scripting before, so I was wondering if someone could take a look at my script and tell me where I'm going wrong please.  I am trying to run an msi which is on the network and I'm using the Window Info Tool to help me step through the wizard. 

When I run the script it returns "Exit Code: 0 Time: 47.21" (no idea what that code means) and the program doesn't install.  I think it might be failing at the point where it types in the name of the server (line 14 - starts "ControlSend"), but that's only a guess.  When it runs I can see the debugger icon in the system tray and when I hover over it I can see it at certain points of the script, mainly at each line of "WinWaitActive" and it seems to skip from line 10 to 20 really quickly.  When run manually, the installation takes several minutes to complete.

Here is my code:

#AutoIt3Wrapper_Run_Debug_Mode=Y
AutoItSetOption ("TrayIconDebug", 1)
Run ("\\ServerName\Software\Radan\Radan 2016 - UK+ROW - Hotfix 3 (34.0.03 32bit)\dvd_radan\Radan 2016.msi","C:\Program Files (x86)\Radan Software\Radan",@SW_SHOWMINIMIZED)
Sleep(1000)
WinWaitActive("[Class:Static]","",10)
ControlClick("[Class:Button]","WARNING: This program is protected",13553)
WinWaitActive("[Class:RichEdit20W]","License Agreement",10)
ControlClick("[Class:Button]","License Agreement",13372)
ControlClick("[Class:Button]","License Agreement",13553)
WinWaitActive("[Class:Static]","Please select a setup type",10)
ControlClick("[Class:Button]","Choose the setup type that best suits your needs",15250)
ControlClick("[Class:Button]","Choose the setup type that best suits your needs",13553)
Sleep(2000)
ControlSend("Radan 2016 - InstallShield Wizard","Server Name","[Class:Button; Instance:2]","PDM05")
Sleep(2000)
ControlClick("[Class:Button]","Server Name",13553)
ControlClick("[Class:Button]","Choose the shortcuts you would like to add to the start menu",13553)
ControlClick("[Class:Button]","Click Install to begin the installation",13588)
Sleep(2000)
WinWaitActive("[Class:RichEdit20W0]","",10)
ControlClick("[Class:Button]","Click Finish",13611)

 

In case it helps, I have attached the screenshots of the installation when run manually

Many thanks

Radan_Install.pdf

Share this post


Link to post
Share on other sites



1 hour ago, Diane said:

Hi,

I am a newbie to Autoit and I've only done basic scripting before, so I was wondering if someone could take a look at my script and tell me where I'm going wrong please.  I am trying to run an msi which is on the network and I'm using the Window Info Tool to help me step through the wizard. 

When I run the script it returns "Exit Code: 0 Time: 47.21" (no idea what that code means) and the program doesn't install.  I think it might be failing at the point where it types in the name of the server (line 14 - starts "ControlSend"), but that's only a guess.  When it runs I can see the debugger icon in the system tray and when I hover over it I can see it at certain points of the script, mainly at each line of "WinWaitActive" and it seems to skip from line 10 to 20 really quickly.  When run manually, the installation takes several minutes to complete.

Here is my code:

#AutoIt3Wrapper_Run_Debug_Mode=Y
AutoItSetOption ("TrayIconDebug", 1)
Run ("\\ServerName\Software\Radan\Radan 2016 - UK+ROW - Hotfix 3 (34.0.03 32bit)\dvd_radan\Radan 2016.msi","C:\Program Files (x86)\Radan Software\Radan",@SW_SHOWMINIMIZED)
Sleep(1000)
WinWaitActive("[Class:Static]","",10)
ControlClick("[Class:Button]","WARNING: This program is protected",13553)
WinWaitActive("[Class:RichEdit20W]","License Agreement",10)
ControlClick("[Class:Button]","License Agreement",13372)
ControlClick("[Class:Button]","License Agreement",13553)
WinWaitActive("[Class:Static]","Please select a setup type",10)
ControlClick("[Class:Button]","Choose the setup type that best suits your needs",15250)
ControlClick("[Class:Button]","Choose the setup type that best suits your needs",13553)
Sleep(2000)
ControlSend("Radan 2016 - InstallShield Wizard","Server Name","[Class:Button; Instance:2]","PDM05")
Sleep(2000)
ControlClick("[Class:Button]","Server Name",13553)
ControlClick("[Class:Button]","Choose the shortcuts you would like to add to the start menu",13553)
ControlClick("[Class:Button]","Click Install to begin the installation",13588)
Sleep(2000)
WinWaitActive("[Class:RichEdit20W0]","",10)
ControlClick("[Class:Button]","Click Finish",13611)

 

In case it helps, I have attached the screenshots of the installation when run manually

Many thanks

Radan_Install.pdf

UPDATE:

I set all the timeouts for the WinWaitActive lines to 0 and now it hangs on line 5, which is the first WinWaitActive line, and I have to force the execution to stop.

Does this mean that my Run command is wrong and it's not even starting the msi?

Share this post


Link to post
Share on other sites

It sounds like your script isn't finding that first window for some reason.  If you know the process name after the install starts (look in Task Manager) you can use the ProcessExists command to make sure the program is running before looking for the window.

On that first WinWaitActive line, does anything change if you change the line to something like this:

WinWaitActive("Radan 2016 - InstallShield Wizard","Radan 2016 Install",10)

 

 

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