Jump to content

Install Script Autoit


Recommended Posts

Hello,I am using Autoit to generate a script for installing a game.After the instalation is complete the next window is "finish" ( or other windows depending on the game,like installing DirectX,etc).Well,this one last window seems not to be active no matter what I do.

this is what I wrote

.............

WinWaitActive("Setup")

Send("!i")

;at this point the game is installed but the script continues with another window

WinWait("Contents")

If Not WinActive("Contents") Then WinActive("Contents")

WinWaitActive("Contents")

Send("!n")

P.S. does anyone know how to close a window,something similar to Alt-F4

Thank you.

Link to comment
Share on other sites


Hello,I am using Autoit to generate a script for installing a game.After the instalation is complete the next window is "finish" ( or other windows depending on the game,like installing DirectX,etc).Well,this one last window seems not to be active no matter what I do.

this is what I wrote

.............

WinWaitActive("Setup")

Send("!i")

;at this point the game is installed but the script continues with another window

WinWait("Contents")

If Not WinActive("Contents") Then WinActive("Contents")

WinWaitActive("Contents")

Send("!n")

i dunno if this is the best forum for your question but here's some examples of the code i use for some of my scripts:

Run("kb931836.exe /Q:A /R:N")
WinWaitActive("Date/Time Properties", "")
Sleep(1500)
ControlClick ("Date/Time Properties", "", 1)

and

<beginning snipped>
ControlClick ("Finished", "", 1023)
Sleep(999)
ControlClick ("Finished", "", 1024)
Sleep(999)
ControlClick ("Finished", "", 1)

Notice how they both use the exact information as opposed to just sending a return key.

If you use the information tool that comes with AutoIT 3.2 it will tell you the text you need to look for. You need to get the text EXACTLY right otherwise the active window won't be found. Then use ControlClick with the same info to exit. So, use the tool to find the exact text of the dialog box, and also the ControlID of the control you wish to click. And then use the example above to exit the last box.

HTH

Link to comment
Share on other sites

Hello,I am using Autoit to generate a script for installing a game.After the instalation is complete the next window is "finish" ( or other windows depending on the game,like installing DirectX,etc).Well,this one last window seems not to be active no matter what I do.

this is what I wrote

.............

WinWaitActive("Setup")

Send("!i")

;at this point the game is installed but the script continues with another window

WinWait("Contents")

If Not WinActive("Contents") Then WinActive("Contents")

WinWaitActive("Contents")

Send("!n")

P.S. does anyone know how to close a window,something similar to Alt-F4

Thank you.

You will need to set focus onto the last window, use WinActivate then WinActive to check that window has been selected then WinClose when finished

Link to comment
Share on other sites

Hello,back with question

I did how soporific explain to me but still it's not working.

I did exactly as oscardog wrote and the same thing,nothing happens.

This is how I tried and seems to work

WinWaitActive("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")

Send("!i")

Sleep(930000) ;here is the difference

;InstallShield Wizard - contents

WinWaitActive("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")

Send("!n")

;InstallShield Wizard - user information

WinWait("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")

Send("!n")

;InstallShield Wizard - register

WinWaitActive("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")

Send("!n")

But using Sleep it's not the right way to do.Because the install might take more or less on different PC's than the value wrote there.

Link to comment
Share on other sites

Hello,back with question

I did how soporific explain to me but still it's not working.

I did exactly as oscardog wrote and the same thing,nothing happens.

This is how I tried and seems to work

WinWaitActive("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")

Send("!i")

Sleep(930000) ;here is the difference

;InstallShield Wizard - contents

WinWaitActive("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")

Send("!n")

;InstallShield Wizard - user information

WinWait("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")

Send("!n")

;InstallShield Wizard - register

WinWaitActive("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")

Send("!n")

But using Sleep it's not the right way to do.Because the install might take more or less on different PC's than the value wrote there.

I would think you would need some kind of delay between sending the different sets of keystrokes, try using a sleep time of a second or 2, the 5ms default is possibly acting before the child/parent window has been updated. Also enter some debug code to point out where the errors occur, i.e

If WinExists("Untitled -") Then

MsgBox(0, "", "Window exists sending keystrokes after sleep")

EndIf

or

If WinActive("Untitled -") Then

MsgBox(0, "", "Window active sending after sleep")

EndIf

etc

These such lines can be removed later and may point to where the script is failing

Without using the software it is tricky to pinpoint the fault precisely

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...