brian75 Posted August 12, 2013 Share Posted August 12, 2013 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! Link to comment Share on other sites More sharing options...
Moderators Solution JLogan3o13 Posted August 12, 2013 Moderators Solution Share Posted August 12, 2013 You can always do a simple If statement: RunWait("MyApp.exe") If Not @error Then MsgBox(0, "", "Success!") "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Chimaera Posted August 12, 2013 Share Posted August 12, 2013 Or look for the exit code from the program and utilise that like above If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
0xdefea7 Posted August 12, 2013 Share Posted August 12, 2013 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 Link to comment Share on other sites More sharing options...
brian75 Posted August 19, 2013 Author Share Posted August 19, 2013 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now