Jump to content
Sign in to follow this  
AVasile

Restore window

Recommended Posts

AVasile

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

Share this post


Link to post
Share on other sites
bogQ

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 by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites
seandisanti

you could also just use blockinput() to prevent the user from clicking when they're not supposed to.

Share this post


Link to post
Share on other sites
AVasile

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 / AGREE

Will this send the click to the button or to the W

Share this post


Link to post
Share on other sites
bogQ

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 by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites
AVasile

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

Share this post


Link to post
Share on other sites
AVasile

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.