Sign in to follow this  
Followers 0
bcharris

script paused

9 posts in this topic

I've been reading through this forum for ideas on why my script may be pausing. The closest post I've come to so far is: # 121829

http://www.autoitscript.com/forum/index.ph...29entry121829

The script below installs an application and answers all of the prompts. On some machines, both W2k and XP, the script pauses. I thought initially, that this may be caused due to user intervention or perhaps another application might be running and interrupting the script...

When the script pauses, I am not able to "unpause" only "exit".

Please advise, thanks!

CODE

______________________________________________________________

Run ("setupex.exe")

WinWaitActive ("InstallShield Self-extracting EXE")

Send("!y")

WinWaitActive ("InstallShield Self-extracting Exe")

Send("equinox{ENTER}")

WinWaitActive ("Readme Information")

Send("!n")

WinWaitActive ("Install")

Send("{SPACE}")

WinWaitActive ("Install")

Send("{SPACE}")

WinWaitActive ("Choose Destination Location")

Send("!n")

WinWaitActive ("DlgcacWinName")

Send("!n")

WinWaitActive ("C:\Documents and Settings\All Users\Start Menu\Programs\Callisto4.3")

Send("!{F4}")

WinWaitActive ("Setup Complete")

Send("{SPACE}")

END CODE

______________________________________________________________

Share this post


Link to post
Share on other sites



Additionally, The script pauses at the last prompt.

Share this post


Link to post
Share on other sites

Where is it pausing? It's probably still waiting for a certain window to become active. Check your spelling on the titles and consider adding a timeout to the WinWaitActive lines


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

Where is it pausing? It's probably still waiting for a certain window to become active. Check your spelling on the titles and consider adding a timeout to the WinWaitActive lines

and try this

Dim $sleeper = 500; change to any sleep time that works

Opt("TrayIconDebug", 1);0=no info, 1=debug line info

Run ("setupex.exe")
Sleep($sleeper)
WinWaitActive ("InstallShield Self-extracting EXE")
Send("!y")
Sleep($sleeper)
WinWaitActive ("InstallShield Self-extracting Exe")
Send("equinox{ENTER}")
Sleep($sleeper)
WinWaitActive ("Readme Information")
Send("!n")
Sleep($sleeper)
WinWaitActive ("Install")
Send("{SPACE}")
Sleep($sleeper)
WinWaitActive ("Install")
Send("{SPACE}")
Sleep($sleeper)
WinWaitActive ("Choose Destination Location")
Send("!n")
Sleep($sleeper)
WinWaitActive ("DlgcacWinName")
Send("!n")
Sleep($sleeper)
WinWaitActive ("C:\Documents and Settings\All Users\Start Menu\Programs\Callisto4.3")
Send("!{F4}")
Sleep($sleeper)
WinWaitActive ("Setup Complete")
Send("{SPACE}")

hope that helps

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Thank you both, SpookMeister & Valuater,

You were right, issue was with waiting for a window to become active, at the following line:

WinWaitActive ("C:\Documents and Settings\All Users\Start Menu\Programs\Callisto4.3")

Send("!{F4}")

Reason: This window (normally) opens when the application short-cuts are copied to the PC. On some PCs this window does not open, the short-cuts are created in the background.

Q: Would it be best to place a condition looking for the the window...or is there a better way to address?

Share this post


Link to post
Share on other sites

try this

While 1
    
    If WinActive("this title") = 1 then exitloop
    
    If WinActive("that title") = 1 then
    ; do this
    EndIf
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Perhaps Adlib maybe more suitable. This is what I would try.

Run ("setupex.exe")
WinWaitActive ("InstallShield Self-extracting EXE")
Send("!y")
WinWaitActive ("InstallShield Self-extracting Exe")
Send("equinox{ENTER}")
WinWaitActive ("Readme Information")
Send("!n")
WinWaitActive ("Install")
Send("{SPACE}")
WinWaitActive ("Install")
Send("{SPACE}")
WinWaitActive ("Choose Destination Location")
Send("!n")
WinWaitActive ("DlgcacWinName")
Send("!n")
AdlibEnable('_Adlib')
WinWaitActive ("Setup Complete")
Send("{SPACE}")
AdlibDisable()

Func _Adlib()
    If WinActive("C:\Documents and Settings\All Users\Start Menu\Programs\Callisto4.3") Then
        Send("!{F4}")
    EndIf
EndFunc

Edit: Using Opt(WindowTitleMatchMode, 2) may make the explorer window title a little better with a substring required only.

Edited by MHz

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

@MHz

do you need to AdlibDisable() after the result is true???

i thought this would continue the function until disabled

???

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

It just closes the script neatly. The AdlibEnable runs until AdlibDisable is called or the script finishes. You could probably leave out AdlibDisable() as it is running it until the end...but covering all the bases makes for a happy script. B)

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  
Followers 0