MSFN Forum: Install Script Autoit - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Install Script Autoit problems with the finish window Rate Topic: -----

#1 User is offline   anac 

  • Group: Members
  • Posts: 3
  • Joined: 04-June 07

Posted 05 June 2007 - 03:06 AM

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.


#2 User is offline   soporific 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 705
  • Joined: 12-June 05

Posted 05 June 2007 - 03:39 AM

View Postanac, 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")

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

#3 User is offline   anac 

  • Group: Members
  • Posts: 3
  • Joined: 04-June 07

Posted 05 June 2007 - 04:07 AM

:(
it's not working

#4 User is offline   soporific 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 705
  • Joined: 12-June 05

Posted 05 June 2007 - 04:37 AM

View Postanac, on Jun 5 2007, 08:07 PM, said:

:(
it's not working


OK, you need to provide much more information than that. What did you try that is not working?

#5 User is offline   oscardog 

  • Member
  • PipPip
  • Group: Members
  • Posts: 234
  • Joined: 29-June 06

Posted 05 June 2007 - 05:47 AM

View Postanac, 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.

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 User is offline   anac 

  • Group: Members
  • Posts: 3
  • Joined: 04-June 07

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.

#7 User is offline   oscardog 

  • Member
  • PipPip
  • Group: Members
  • Posts: 234
  • Joined: 29-June 06

Posted 07 June 2007 - 04:01 AM

View Postanac, 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 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

#8 User is offline   jondercik 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 445
  • Joined: 15-January 04

Posted 07 June 2007 - 06:30 AM

You could always kill the process

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy