Sign in to follow this  
Followers 0
tsherr

WinWaitActive question

4 posts in this topic

I'm trying to automate the install of MalwareBytes Anti-Malware. The code is below. Everything works fine until I get to this line:

WinWaitActive("Setup - Malwarebytes' Anti-Malware","Select Additional Tasks")

And then the script stops. It appears that it isn't seeing that this window is active, yet this window came up the same way all of the proceeding ones did, and I used Window Info to get the title and text in the window. So I'm thinking I'm missing something. What am I doing wrong?

Thanks,

T

(Full code follows)

Run ( "q:\malwarebytes\mbam-setup.exe")

WinWaitActive ("Select Setup Language")

Send ("{ENTER}")

WinWaitActive ("Setup - Malwarebytes' Anti-Malware","Welcome to the Malwarebytes' Anti-Malware Setup Wizard")

Send ("!N")

WinWaitActive ("Setup - Malwarebytes' Anti-Malware","License Agreement")

Send ("!A")

Send ("!N")

WinWaitActive ("Setup - Malwarebytes' Anti-Malware","Version")

Send ("!N")

WinWaitActive ("Setup - Malwarebytes' Anti-Malware","Where should Malwarebytes")

Send ("c:\firststep\malwarebytes")

Send ("!N")

WinWaitActive ("Folder Exists")

Send ("!Y")

WinWaitActive ("Setup - Malwarebytes' Anti-Malware")

Send ("!D")

Send ("!N")

WinWaitActive ("Setup - Malwarebytes' Anti-Malware","Where should Setup place the program's shortcuts?")

Send ("!D")

Send ("!N")

WinWaitActive("Setup - Malwarebytes' Anti-Malware","Select Additional Tasks")

Send ("!D")

Send ("!N")

WinWaitActive ("Setup - Malwarebytes' Anti-Malware","Setup is now ready to begin installing Malwarebytes' Anti-Malware on your computer.")

Send ("!I")

WinWaitActive ("Setup - Malwarebytes' Anti-Malware","Setup has finished installing")

Send ("!F")

WinWaitActive ("Malwarebytes' Anti-Malware","The latest version")

Send ("{SPACE}")

WinWaitActive ("Malwarebytes' Anti-Malware","Congratulations, Malwarebytes")

Send ("{SPACE}")

Share this post


Link to post
Share on other sites



First off, I see you are new. I would suggest using ControlClick() instead of Send. That would stabilize the script more. Instead of using WinWaitActive, you could use WinWait and then activate the window after it exists.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

First off, I see you are new. I would suggest using ControlClick() instead of Send. That would stabilize the script more. Instead of using WinWaitActive, you could use WinWait and then activate the window after it exists.

Thanks! I tried the WinWait and then WinActivate, but the script stops at WinWait. Is there anyway for me to tell what line the script stops at?

T

Share this post


Link to post
Share on other sites

@ScriptLineNumber

You could add a timeout to WinWait in case it does fail.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

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