Sign in to follow this  
Followers 0
nysportsfn

Need Assitance

3 posts in this topic

Hello everyone, I am new to the forums and to Autoit, used to use winbatch, but I am trying this now.

Anyway, I have the following code. It has worked for me many times, but its very inconsistent.

Sometimes it fails to send keys to the first screen and sometimes the last. Funny thing is when I hit next at the first screen it then works all the way until the last screen and then does nothing again. Any assitance would be nice.

[/code]; <AUT2EXE VERSION: 3.2.0.1>

; ----------------------------------------------------------------------------
; <AUT2EXE INCLUDE-START: G:\Scripts\Latest\Spstage2\infinst.au3>
; ----------------------------------------------------------------------------

;BlockInput(1)
;SplashTextOn("InForm 4.6 Installation", "Keyboard and mouse are locked during the InForm 4.6 installation.", -1, 100, -1, -1, -1, -1, 24)
Run ("C:\Install\Apps\InForm\SETUP.EXE")
WinWait("Phase Forward InForm 4.6")
Sleep (3000)
WinSetState("Phase Forward InForm 4.6", "", @SW_ENABLE)
Sleep (3000)
WinWaitActive("Phase Forward InForm 4.6")
Send ("!n")
WinWaitActive("Product Key")
Send ("******")
Sleep (3000)
Send ("!n")
WinWaitActive("Phase Forward InForm 4.6")
Send ("!a")
Send ("!n")
WinWaitActive("Phase Forward InForm 4.6")
Send ("!n")
WinWaitActive("Phase Forward InForm 4.6")
Send ("!n")
WinWaitActive("Phase Forward InForm 4.6")
Send ("{RIGHT}{DOWN}{SPACE}{DOWN}{DOWN}{DOWN}{SPACE}")
Sleep (3000)
Send ("!n")
WinWaitActive("Question")
Send ("!y")
WinWaitActive("Product Key")
Send ("!n")
WinWaitActive("Database Configuration")
Send ("***")
Sleep (3000)
Send ("!n")
WinWaitActive("Phase Forward InForm 4.6")
Send ("!y")
WinWaitActive("Phase Forward InForm 4.6")
Send ("!i")
Sleep (30000)    ;Installation will proceed. Wait 30 seconds
WinWaitActive("Phase Forward InForm 4.6")
Send ("{DOWN}{ENTER}")
RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce", "InformFinalConfig")
;SplashOff()
;BlockInput(0)

; ----------------------------------------------------------------------------
; <AUT2EXE INCLUDE-END: G:\Scripts\Latest\Spstage2\infinst.au3>
; ----------------------------------------------------------------------------
[code]

Share this post


Link to post
Share on other sites



The inconsistency could be from the time in display the window waiting.

If the windows has the same title, you could verify with its content using WinGetText().

If "some text" is present, then do the next thing.

Tip: An alternative to Send() it's ControlClick() too.

Share this post


Link to post
Share on other sites

Try this;

AutoItSetOption( "SendKeyDelay" , 40 )

;default=5

AutoItSetOption( "SendKeyDownDelay" , 40 )

;default=5

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