Sign in to follow this  
Followers 0
zepp

Script only works on 2nd execution?

5 posts in this topic

Hey guys,

So I created a script to automate an installation of LogMeIn and it works perfectly if I just run the .au3! However, after compiling it, it will only work the 2nd time I run it! The installation program will launch and then do nothing it's supposed to. So I cancel out and run it again and it works every time! So I would guess that something needs to be running in the background before it will work but I have been unable to find any information on anything like that. As far as I can tell, as long as you include the installation file properly (which I managed to figure out) all you should need to do aside from that is compile the script! Is that correct?

I am at work so I can't include my code here now but if anyone has any suggestions as to what might be causing this I would really appreciate it. I will post the entire script later.

Thanks!

-zepp

Share this post


Link to post
Share on other sites



Hey guys,

So I created a script to automate an installation of LogMeIn and it works perfectly if I just run the .au3! However, after compiling it, it will only work the 2nd time I run it! The installation program will launch and then do nothing it's supposed to. So I cancel out and run it again and it works every time! So I would guess that something needs to be running in the background before it will work but I have been unable to find any information on anything like that. As far as I can tell, as long as you include the installation file properly (which I managed to figure out) all you should need to do aside from that is compile the script! Is that correct?

I am at work so I can't include my code here now but if anyone has any suggestions as to what might be causing this I would really appreciate it. I will post the entire script later.

Thanks!

-zepp

You should post when you get home and show the script... anything anyone tells you will just be here say.

I use LogMeIn.com as well... how are you automating the installation?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

You should post when you get home and show the script... anything anyone tells you will just be here say.

I use LogMeIn.com as well... how are you automating the installation?

See for yourself. Any feedback is appreciated.

#NoTrayIcon

Opt("WinTitleMatchMode", 2)

FileInstall("C:\Program Files (x86)\AutoIt3\Include\logmein.msi",@TempDir & '\logmein.msi')

ShellExecuteWait(@TempDir & '\logmein.msi')

WinWaitActive("LogMeIn","LogMeIn")

ControlSend("LogMeIn", "Next >", 1001, "{ENTER}")

WinWaitActive("LogMeIn License Agreement","I Agree")

ControlSend("LogMeIn License Agreement","I Agree", 1001, "{ENTER}")

WinWaitActive("LogMeIn","Typical")

ControlSend("LogMeIn", "Typical", 1001, "{ENTER}")

WinWaitActive("LogMeIn","Computer Description")

WinWaitNotActive("LogMeIn","Computer Description")

If WinExists("LogMeIn", "Computer Access Code") Then

WinWaitActive("LogMeIn","Computer Access Code")

Send("code{TAB}code")

ControlSend("LogMeIn", "Computer Access Code", 1001, "{ENTER}")

EndIf

WinWaitActive("LogMeIn","LogMeIn Free")

Send("{TAB}{TAB}{TAB}email address{TAB}password")

ControlCommand("LogMeIn","LogMeIn Free", 590, "Check")

ControlSend("LogMeIn", "LogMeIn Free", 1001, "{ENTER}")

WinWaitActive("LogMeIn Destination","Destination")

ControlSend("LogMeIn Destination", "Destination", 1001, "{ENTER}")

WinWaitActive("LogMeIn","Completed")

ControlSend("LogMeIn","Completed", 1018, "{ENTER}")

FileDelete(@TempDir & '\logmein.msi')

It works so perfectly before compiling. Any thoughts?

Share this post


Link to post
Share on other sites

I played around with it myself... it has a silent install that worked fine for me and it was only 1 line lol...

Anyway... I don't know what the issue would be looking at your code... I'm unsure if it's the () parenthesis in the fileinstall (which I'm assuming you are saying it's failing at ShellExecuteWait(), and I'm quite unsure why your using "Wait" when you have WinWait() as well.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I played around with it myself... it has a silent install that worked fine for me and it was only 1 line lol...

Anyway... I don't know what the issue would be looking at your code... I'm unsure if it's the () parenthesis in the fileinstall (which I'm assuming you are saying it's failing at ShellExecuteWait(), and I'm quite unsure why your using "Wait" when you have WinWait() as well.

Not clear on what you mean on the fileinstall() but removing the wait from ShellExecute fixed the issue. Thanks

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