anac Posted June 5, 2007 Share Posted June 5, 2007 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 windowWinWait("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-F4Thank you. Link to comment Share on other sites More sharing options...
soporific Posted June 5, 2007 Share Posted June 5, 2007 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 windowWinWait("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 More sharing options...
anac Posted June 5, 2007 Author Share Posted June 5, 2007 it's not working Link to comment Share on other sites More sharing options...
soporific Posted June 5, 2007 Share Posted June 5, 2007 it's not workingOK, you need to provide much more information than that. What did you try that is not working? Link to comment Share on other sites More sharing options...
oscardog Posted June 5, 2007 Share Posted June 5, 2007 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 windowWinWait("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-F4Thank 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 More sharing options...
anac Posted June 6, 2007 Author Share Posted June 6, 2007 Hello,back with questionI 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 - contentsWinWaitActive("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")Send("!n");InstallShield Wizard - user informationWinWait("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")Send("!n");InstallShield Wizard - registerWinWaitActive("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 More sharing options...
oscardog Posted June 7, 2007 Share Posted June 7, 2007 Hello,back with questionI 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 - contentsWinWaitActive("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")Send("!n");InstallShield Wizard - user informationWinWait("Setup - S.T.A.L.K.E.R. - Shadow of Chernobyl")Send("!n");InstallShield Wizard - registerWinWaitActive("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")EndIforIf WinActive("Untitled -") Then MsgBox(0, "", "Window active sending after sleep")EndIfetcThese such lines can be removed later and may point to where the script is failingWithout using the software it is tricky to pinpoint the fault precisely Link to comment Share on other sites More sharing options...
jondercik Posted June 7, 2007 Share Posted June 7, 2007 You could always kill the process Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now