Jump to content

Help with pausing a script


Recommended Posts

Help!! :)

I have a script that launches a program which first extracts the files and then runs the main install program...(Windows XP SP2). I want to first verify that the extraction process wnidows is active and then pause the script while the program install window is active. Right now, my script works except for when the install program finishes. At that time, the script just seems to stop.

Can someone tell what is going on, why it stops after XPSP2 finishes, and possible provide a better way of doing this?

;Run Windows XP SP2
Run("XPSP2.exe /passive /norestart /o /f", "C:\Windows\Temp\XPSP2", @SW_MAXIMIZE)
Sleep(1000)
$Extract = WinExists("Extracting Files", "")
Do
    If $Extract = 0 Then
        Sleep(1000)
    EndIf
Until $Extract = 1
Sleep(1000)
WinWait("Windows XP Service Pack 2 Setup Wizard", "")
;Disable the Cancel (2) and  Help (9) buttons during SP2 installation.
ControlDisable("Windows XP Service Pack 2 Setup Wizard", "Cancel", 2)
ControlDisable("Windows XP Service Pack 2 Setup Wizard", "Help", 9)
$Active = WinExists("Windows XP Service Pack 2 Setup Wizard", "")
Do
    If $Active = 1 Then
        Sleep(1000)
    EndIf
Until $Active = 0
RunWait(@ScriptDir & "\LaunchSP2Reg.exe","",@SW_HIDE)
;Restart copmuter

Thanks!

Link to comment
Share on other sites

might try something like:

;Run Windows XP SP2
Run("XPSP2.exe /passive /norestart /o /f", "C:\Windows\Temp\XPSP2", @SW_MAXIMIZE)
WinWait("Extracting Files", "")
While WinExists("Extracting Files", "")
      Sleep(1000)
WEnd
Sleep(1000)
WinWait("Windows XP Service Pack 2 Setup Wizard", "")
;Disable the Cancel (2) and  Help (9) buttons during SP2 installation.
ControlDisable("Windows XP Service Pack 2 Setup Wizard", "Cancel", 2)
ControlDisable("Windows XP Service Pack 2 Setup Wizard", "Help", 9)
While WinExists("Windows XP Service Pack 2 Setup Wizard", "")
      Sleep(1000)
WEnd
RunWait(@ScriptDir & "\LaunchSP2Reg.exe", "", @SW_HIDE)
;Restart copmuter

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Instead

$Active = WinExists("Windows XP Service Pack 2 Setup Wizard", "")

Do

    If $Active = 1 Then

        Sleep(1000)

    EndIf

Until $Active = 0

try

WinWaitClose ( "Windows XP Service Pack 2 Setup Wizard" , "" )

Link to comment
Share on other sites

might try something like:

;Run Windows XP SP2
Run("XPSP2.exe /passive /norestart /o /f", "C:\Windows\Temp\XPSP2", @SW_MAXIMIZE)
WinWait("Extracting Files", "")
While WinExists("Extracting Files", "")
      Sleep(1000)
WEnd
Sleep(1000)
WinWait("Windows XP Service Pack 2 Setup Wizard", "")
;Disable the Cancel (2) and  Help (9) buttons during SP2 installation.
ControlDisable("Windows XP Service Pack 2 Setup Wizard", "Cancel", 2)
ControlDisable("Windows XP Service Pack 2 Setup Wizard", "Help", 9)
While WinExists("Windows XP Service Pack 2 Setup Wizard", "")
      Sleep(1000)
WEnd
RunWait(@ScriptDir & "\LaunchSP2Reg.exe", "", @SW_HIDE)
;Restart copmuter

<{POST_SNAPBACK}>

Thanks...I'll give it a try. :)
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...