Sign in to follow this  
Followers 0
HockeyFan

Help with pausing a script

5 posts in this topic

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!

Share this post


Link to post
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.

 

Share this post


Link to post
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" , "" )

Share this post


Link to post
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. :)

Share this post


Link to post
Share on other sites

Instead

try

<{POST_SNAPBACK}>

I think I tried this at one point, but for some reason it didn't work. Probably just an error in my script. I will try it agian just to make sure.

Thanks! :)

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