tsherr Posted August 7, 2009 Share Posted August 7, 2009 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}") Link to comment Share on other sites More sharing options...
dantay9 Posted August 7, 2009 Share Posted August 7, 2009 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. Link to comment Share on other sites More sharing options...
tsherr Posted August 7, 2009 Author Share Posted August 7, 2009 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 Link to comment Share on other sites More sharing options...
dantay9 Posted August 7, 2009 Share Posted August 7, 2009 @ScriptLineNumber You could add a timeout to WinWait in case it does fail. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now