Sign in to follow this  
Followers 0
st4vr0s

Windows 7 Loops scripts

6 posts in this topic

Hi,

I've been working with Autoit for a while now in XP and Vista but its got to the stage I need to write some scripts for Windows 7.

I've just written a basic installation script for 4 pieces of software with custom options. In XP or Vista I had no problems at all but with Windows 7 the compliled .EXE's in either x86 or x64 format loop when it gets to the end.

In other words after the last command has been completed the script starts again from the beginning instead of quitting.

Any ideas why this may be happening?

Thanks

Share this post


Link to post
Share on other sites



Win 7 is going to provide us with a whole new set of issues. You didn't provide any code that we can even look at though. You may have to add an Exit in there or you may have to find out what is really going on with Windows 7 or you may have to ...ad infinitum.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Win 7 is going to provide us with a whole new set of issues. You didn't provide any code that we can even look at though. You may have to add an Exit in there or you may have to find out what is really going on with Windows 7 or you may have to ...ad infinitum.

Without posting pages of boring code the start looks something like this ...

Run ("C:\TESTS\INSTALLERS\w7\software.exe")
WinWait ("Setup")
WinActivate ("Setup")
WinActivate ("Setup")
WinWaitActive ("Setup")
Send ("!n")

and ends with

Send ("!n")
WinWait ("InstallShield Wizard","The InstallShield Wizard has updated")
WinActivate ("InstallShield Wizard","The InstallShield Wizard has updated")
WinActivate ("InstallShield Wizard","The InstallShield Wizard has updated")
Send ("{SPACE}")
Sleep (1000)
Send ("{ENTER}")
Send ("{SPACE}")
Sleep (1000)
Send ("{ENTER}")

When I test each section of code i run the usual CTRL+F5 then run F5 if no errors occur. The scripts end as expected this way but not when they are run from a compiled exe.

Share this post


Link to post
Share on other sites

3 tips:

- use "Sleep" between each "Send", and don't repeat them if not needed.

- maybe RunAs.. admin, if Installer writes to C:\..

- sometime, 1 sec of pause is not enough..


_____________________________________________________________________________

Share this post


Link to post
Share on other sites

Win 7 is going to provide us with a whole new set of issues. You didn't provide any code that we can even look at though. You may have to add an Exit in there or you may have to find out what is really going on with Windows 7 or you may have to ...ad infinitum.

Thanks Guys,

An "Exit" fixed it :)

Will add it to all my Windows 7 scripts from now on.

Thanks again for all your replies.

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