Jump to content

To Run() or to ShellExecute


Recommended Posts

Sorry for my ignorance, but I don't know exactly how this is used.

Well, just an off the cuff example...

CODE
$pid = Run("D:\someinstaller.exe");

$handle = _ProcessOpenHandle($pid)

WinWaitActive("Welcome")

ControlClick("Welcome", "", "[CLASS:Button; TEXT:&Next >]")

; some more control code telling the installer what to do

WinWait("Setup Complete")

ControlClick("Setup Complete", "", "[CLASS:Button; TEXT:Finish]")

$status = _ProcessGetExitCode($pid, $handle)

If $status = 1603 Then

MsgBox(16, "Failed", "Installation failed!")

ElseIf $status <> 0 Then

MsgBox(32, "Huh", "Installation returned status " && $status)

Else

MsgBox(64, "Success", "Installation succeeded!")

EndIf

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...