AVasile Posted August 17, 2010 Share Posted August 17, 2010 I am putting together a script that will run and complete all the fields for an installer - LogmeIn. The issue that I have is that, if the user clicks outside the main install window or another program takes focus, the script will fail because it will not send the commands properly. This is what I use to check and restore the window before I move on: If WinExists("LogMeIn", "Power Management") = 1 Then WinWait("LogMeIn", "Power Management") WinActivate("LogMeIn", "Power Management") WinWaitActive("LogMeIn", "Power Management") ControlClick("LogMeIn", "",954) ; unselect AC option ControlClick("LogMeIn", "",623) ; if window is availalbe click to unselect the option ; and then click Next EndIf That did not restore the focus. I also tried the code below but it only worked with the first dialog screen - I need this to be applied to all screens: $handle2=WinGetHandle("LogMeIn License Agreement","") if @error then MsgBox(0,"","There was an error installing. Please restart the installation!") exit 3 else WinSetState ( "LogMeIn License Agreement", "", @SW_SHOW ) WinWait("LogMeIn License Agreement","") WinActivate("LogMeIn Licesnse Agreement","") WinWaitActive("LogMeIn License Agreement","") ControlClick("LogMeIn", "",623);Button ID for NEXT / AGREE Endif Any help will be appreciated. Thank you Link to comment Share on other sites More sharing options...
bogQ Posted August 17, 2010 Share Posted August 17, 2010 (edited) Which LogMeIn Product do you use? Edit: $handle2=WinGetHandle(" LogMeIn License Agreement","") if @error then MsgBox(0,"","There was an error installing. Please restart the installation!") exit 3 else WinActivate($handle2,"") WinWaitActive($handle2,"") ControlClick($handle2, "", "[TEXT:I Agree]");Button ID for NEXT / AGREE Endif Note that name of the main win have starting space Edit2: Im 99% shure that LogMeIn.msi support silent instalation (hit search button on forum or hit google) And that crontolclick is working with no focus on that win Edited August 18, 2010 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
seandisanti Posted August 18, 2010 Share Posted August 18, 2010 you could also just use blockinput() to prevent the user from clicking when they're not supposed to. Link to comment Share on other sites More sharing options...
AVasile Posted August 18, 2010 Author Share Posted August 18, 2010 Which LogMeIn Product do you use? Edit: $handle2=WinGetHandle(" LogMeIn License Agreement","") if @error then MsgBox(0,"","There was an error installing. Please restart the installation!") exit 3 else WinActivate($handle2,"") WinWaitActive($handle2,"") ControlClick($handle2, "", "[TEXT:I Agree]");Button ID for NEXT / AGREE Endif Note that name of the main win have starting space Edit2: Im 99% shure that LogMeIn.msi support silent instalation (hit search button on forum or hit google) And that crontolclick is working with no focus on that win I use the free version and that is why I cannot have a silent installer.ControlClick($handle2, "", "[TEXT:I Agree]");Button ID for NEXT / AGREEWill this send the click to the button or to the W Link to comment Share on other sites More sharing options...
bogQ Posted August 18, 2010 Share Posted August 18, 2010 (edited) It shud send click to button, my version dont have 623 ID on that button, and with text if im not wrong it shud work on diffrent versions. Once again so that you dont miss it, its " LogMeIn License Agreement" not "LogMeIn License Agreement" Did you test to see if my code is working on your version of logmein? Edited August 18, 2010 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
AVasile Posted August 18, 2010 Author Share Posted August 18, 2010 It shud send click to button, my version dont have 623 ID on that button, and with text if im not wrong it shud work on diffrent versions.Once again so that you dont miss it, its " LogMeIn License Agreement" not "LogMeIn License Agreement" Did you test to see if my code is working on your version of logmein?I am testing it right now - give me few seconds Link to comment Share on other sites More sharing options...
AVasile Posted August 18, 2010 Author Share Posted August 18, 2010 It seems to be working - amazing - I did not see the space on that title. If you want I can post the entire code so that you can give me your opinion or better feedback Thank you for your help 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