Jump to content

Help showing a success/failure message


Go to solution Solved by JLogan3o13,

Recommended Posts

Posted

Hi Everyone,

I am using the RunWait command to install a program and would like to pop up a message box based on whether or not the program installed successfully.  What's the best way to do this?  I was thinking about using a select case statement based on the return value of the RunWait command (return value of 0 = install failed, return value of not 0 = install succeeded).  If this will work how do I capture the return value of the RunWait command to use in my select case statement?  I'm sure others have done something like this but couldn't find anything in the forums.  I may be just too ignorant to know what keywords to use in my search.  I greatly appreciate any help!

Posted

Checking the exit code of the run command is a good start. If it were me, I would check the file size of the main exe I was installing, then compare it against the actual size which I hardcode. Something like:

$iFileSize = 1024 ; or whatever the size is returned by (FileGetSize / 1024) 
RunWait("MyApp.exe")
If Not @error Then 
    If (FileGetSize("PathToMainExe.exe")/1024) = $iFileSize Then
        MsgBox(0, "", "Istallation success!")
    Else
        MsgBox(16, "Error", "Install failed.")
    EndIf
EndIf
Posted

Thanks for the responses everyone!  I ended up using your suggestion JLogan3o13...it looked easy and simple and it seems to work well.  Here's what I did:

If Not @error Then
        MsgBox (0, "Franson Install", "Franson Installed Successfully", 5)
    Else
    MsgBox (0, "Franson Install", "Franson Install Failed", 5)
EndIf

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
×
×
  • Create New...