Jump to content

Script that fails - help debugging


Recommended Posts

The following script is compiled together with the Firefox1.5.exe installer application. The resulting executable is launched on the target XP workstation from a remote Windows computer using "psexec \\client -u client\administrator -p pass -c autoit.exe." Without the -i option this is a non-interactive session. The return code is captured and displayed by psexec.

The problem is the "Firefox Setup" window, which is the first "interactive" window. Unless psexec is run with -i and a user is logged into the target workstation, this window is not active. It does not respond to "Send". Also its Next button responds in an unexpected way to "ControlSend" or "MouseClick": it promptly closes the window rather than "pressing" the button. :P The intention of this script is to automate the upgrade of Firefox on 250 workstations, so I need it to press the button and continue the install instead of killing the application.

Any thoughts?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Install Firefox

AutoItSetOption ( "RunErrorsFatal", 0 )

;see if this helps pressing buttons on non active windows

AutoItSetOption ("WinDetectHiddenText", 1)

If NOT FileInstall("C:\FirefoxSetup1.5.exe", "C:\temp\") Then

Exit 2

EndIf

$rcode=Run("C:\temp\FirefoxSetup1.5.exe")

If @error Then

Exit 3

EndIf

WinWait("Firefox Setup", "",15)

If WinExists ( "Firefox Setup" ) Then

WinActivate ( "Firefox Setup" )

Else

Exit 4

EndIf

$zcode=0

$state = WinGetState("Firefox Setup", "")

If BitAnd($state, 1) Then

$zcode=$zcode & 1

EndIf

If BitAnd($state, 2) Then

$zcode=$zcode & 2

EndIf

If BitAnd($state, 4) Then

$zcode=$zcode & 4

EndIf

If BitAnd($state, 8) Then

$zcode=$zcode & 8

EndIf

If BitAnd($state, 16) Then

$zcode=$zcode & 16

EndIf

If BitAnd($state, 32) Then

$zcode=$zcode & 32

EndIf

;this window is not active and the Next button is hidden

;in a non interactive install

$ycode=Send("{ENTER}")

;$ycode=ControlSend ( "Firefox Setup", "", 12325, "{SPACE}")

;$ycode=ControlShow ( "Firefox Setup", "", 12325 )

;$ycode=ControlFocus ( "Firefox Setup", "", 12325 )

;$ycode=ControlClick ( "Firefox Setup", "", 12325 )

WinWait( "Software License Agreement", "", 15 )

If WinExists("Software License Agreement") Then

WinActivate("Software License Agreement")

Else

Exit 5

EndIf

Send("{UP}")

Send("{ENTER}")

WinWait("Setup Type", "", 15)

If WinExists ("Setup Type") Then

WinActivate ("Setup Type")

Else

Exit 6

EndIf

Send("{ENTER}")

If NOT WinWait("Select Components", "", 15) Then

Exit 7

EndIf

WinActivate("Select Components")

Send("{ENTER}")

If NOT WinWait("Install Complete", "", 120) Then

Exit 8

EndIf

WinActivate("Install Complete")

Send("{SPACE}")

Send("{ENTER}")

;Sleep (10000)

ProcessWaitClose($rcode)

If FileDelete ("C:\temp\FirefoxSetup1.5.exe") Then

Exit 0

Else

Exit 10

EndIf

Link to comment
Share on other sites

I found out it's just the "Next" button that's behaving weird. The "Cancel" button works fine. So it looks like an error with the Firefox installer itself.

I'd be curious to hear if someone has suggestions to working around this.

actually i think there's another thread about the exact same issue that's gotten some replies...
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
 Share

  • Recently Browsing   0 members

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