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.
Page 1 of 1
Install Script Autoit problems with the finish window
#2
Posted 05 June 2007 - 03:39 AM
anac, on Jun 5 2007, 07:06 PM, said:
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")
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
#4
Posted 05 June 2007 - 04:37 AM
#5
Posted 05 June 2007 - 05:47 AM
anac, on Jun 5 2007, 10:06 AM, said:
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.
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
#6
Posted 06 June 2007 - 01:02 AM
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 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.
#7
Posted 07 June 2007 - 04:01 AM
anac, on Jun 6 2007, 08:02 AM, said:
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 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
Share this topic:
Page 1 of 1



Help
Back to top









