Jump to content

I am with a small doubt on AutoIt


Jorex

Recommended Posts


If you would like some help, then providing some information could give us an idea as to your problem. Script, Installer, Software deployment method...or any suitable information.

Thanks

:)

Link to comment
Share on other sites

Sounds like your script is still waiting for something. Maybe your in a loop somewhere waiting for something to happen or your using one of the WinWaitxxx functions. Without seeing your script, it's going to be hard to help you :)

Link to comment
Share on other sites

Hello friends, this below is the script that doesn't close after the installation concluding.

*****************************

Run("Nitro_PDF_Pro.exe /s")

Sleep(1000)

;--- AutoIt Macro Generator V 0.21 beta ---

Opt("WinTitleMatchMode", 4)

WinWait("NitroPDF","")

$CLVItem = ControlListView("NitroPDF","","SysListView321","FindItem","Nitro_PDF_Pro.exe")

ControlListView("NitroPDF","","SysListView321","SelectClear")

ControlListView("NitroPDF","","SysListView321","Select",$CLVItem)

WinWait("Nitro PDF Professional - InstallShield Wizard","The InstallShield® Wizard wi")

ControlClick("Nitro PDF Professional - InstallShield Wizard","The InstallShield® Wizard wi","Button1")

Sleep(1000)

WinWait("Nitro PDF Professional - InstallShield Wizard","&Organization:")

ControlClick("Nitro PDF Professional - InstallShield Wizard","&Organization:","Button5")

Sleep(1000)

Sleep(1000)

Sleep(1000)

WinWait("Nitro PDF Professional - InstallShield Wizard","I &accept the terms in the lic")

Sleep(1000)

ControlClick("Nitro PDF Professional - InstallShield Wizard","I &accept the terms in the lic","Button3")

Sleep(1000)

Sleep(1000)

ControlClick("Nitro PDF Professional - InstallShield Wizard","I &accept the terms in the lic","Button5")

Sleep(1000)

Sleep(1000)

Sleep(1000)

Sleep(1000)

Sleep(1000)

WinWait("Nitro PDF Professional - InstallShield Wizard","&Complete")

ControlClick("Nitro PDF Professional - InstallShield Wizard","&Complete","Button5")

Sleep(1000)

Sleep(1000)

Sleep(1000)

Sleep(1000)

Sleep(1000)

WinWait("Nitro PDF Professional - InstallShield Wizard","Add Nitro PDF to the Desktop.")

ControlCommand("Nitro PDF Professional - InstallShield Wizard","Add Nitro PDF to the Desktop.","Button4","UnCheck","")

Sleep(1000)

Sleep(1000)

Sleep(1000)

ControlClick("Nitro PDF Professional - InstallShield Wizard","Add Nitro PDF to the Desktop.","Button1")

Sleep(1000)

Sleep(1000)

Sleep(1000)

Sleep(1000)

WinWait("Nitro PDF Professional - InstallShield Wizard","NewBinary1")

Sleep(1000)

Sleep(1000)

ControlClick("Nitro PDF Professional - InstallShield Wizard","NewBinary1","Button2")

Sleep(1000)

Sleep(1000)

WinWait("Nitro PDF Professional - InstallShield Wizard","The InstallShield Wizard has s")

Sleep(1000)

Sleep(1000)

Sleep(1000)

ControlClick("Nitro PDF Professional - InstallShield Wizard","The InstallShield Wizard has s","Button1")

Sleep(1000)

Sleep(1000)

WinWait("Nitro PDF","Try Out")

Sleep(1000)

Sleep(1000)

Sleep(1000)

ControlClick("Nitro PDF","Try Out","Afx:10000000:81")

Sleep(1000)

Sleep(1000)

Sleep(1000)

Sleep(1000)

Sleep(1000)

WinWait("Thank you for installing Nitro PDF Professional - Microsoft Internet Explorer","Links")

;--- End ---

**************************************************************************

Link to comment
Share on other sites

A few of suggestions:

1) Use the Opt keyword to turn on debugging. Then you can put the cursor over the icon in the system tray and it will tell you what line the script is executing.

2) WinWait just waits for the window to appear. Use WinWaitActive to wait for the window to appear and become the active window. You can probably eliminate all of your sleep statements if you do this. If you need to make a window active after it appears (say some other window has grabbed the focus just after the window pops up), you can do this:

WinWait("Nitro PDF Professional - InstallShield Wizard","The InstallShield® Wizard wi")
WinActivate("Nitro PDF Professional - InstallShield Wizard","The InstallShield® Wizard wi")

This will wait for the window to become visible and then make it the active window. My bet is this is where your problem is.

3) Get rid of all those Sleep statements. Every machine runs differently and the time for a window to appear on one machine is different on another machine. Use the technique above.

4) You need to put some error checking after:

$CLVItem = ControlListView("NitroPDF","","SysListView321","FindItem","Nitro_PDF_Pro.exe")

You're not checking $CLVItem or @error to see if the function succeeded before using $CLVItem in further statements.

Hope this helps

Link to comment
Share on other sites

Start with this:

Opt("TrayIconDebug", 1)

Run("Nitro_PDF_Pro.exe /s")
WinWaitActive("NitroPDF", "")

$CLVItem = ControlListView("NitroPDF", "", "SysListView321", "FindItem", "Nitro_PDF_Pro.exe")
if @error = 1 then
MsgBox(16, "Error", "$CLVItem failed");
endif
ControlListView("NitroPDF", "", "SysListView321", "SelectClear")
ControlListView("NitroPDF", "", "SysListView321", "Select" , $CLVItem)

WinWaitActive("Nitro PDF Professional - InstallShield Wizard", "The InstallShield® Wizard wi")
ControlClick ("Nitro PDF Professional - InstallShield Wizard", "The InstallShield® Wizard wi", "Button1")

WinWaitActive("Nitro PDF Professional - InstallShield Wizard", "&Organization:")
ControlClick ("Nitro PDF Professional - InstallShield Wizard", "&Organization:", "Button5")

WinWaitActive("Nitro PDF Professional - InstallShield Wizard", "I &accept the terms in the lic")
ControlClick ("Nitro PDF Professional - InstallShield Wizard", "I &accept the terms in the lic", "Button3")
ControlClick ("Nitro PDF Professional - InstallShield Wizard", "I &accept the terms in the lic", "Button5")

WinWaitActive("Nitro PDF Professional - InstallShield Wizard", "&Complete")
ControlClick ("Nitro PDF Professional - InstallShield Wizard", "&Complete", "Button5")

WinWaitActive ("Nitro PDF Professional - InstallShield Wizard", "Add Nitro PDF to the Desktop.")
ControlCommand("Nitro PDF Professional - InstallShield Wizard", "Add Nitro PDF to the Desktop.", "Button4", "UnCheck", "")
ControlClick ("Nitro PDF Professional - InstallShield Wizard", "Add Nitro PDF to the Desktop.", "Button1")

WinWaitActive("Nitro PDF Professional - InstallShield Wizard", "NewBinary1")
ControlClick ("Nitro PDF Professional - InstallShield Wizard", "NewBinary1", "Button2")

WinWaitActive("Nitro PDF Professional - InstallShield Wizard", "The InstallShield Wizard has s")
ControlClick ("Nitro PDF Professional - InstallShield Wizard", "The InstallShield Wizard has s", "Button1")

WinWaitActive("Nitro PDF", "Try Out")
ControlClick ("Nitro PDF" ,"Try Out", "Afx:10000000:81")

Exit

I haven't run this because I don't have access to Nitro PDF, but it should be close.

Now, if the script doesn't finish (the AutoIt icon is still in your system tray), hover your cursor over the AutoIt icon (the one in your system tray) and it will popup a box telling you what line on the above script it is on. From there, you can modify the script to correct the problem.

Edited by PaulIA
Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...