Search the Community
Showing results for tags 'exit code'.
-
I was looking at an example and it would Exit 1 on error. So what's wrong with that. Well, we can get an error from different aspects of the script, been the stub errored, or the wrapper errored, or finally, the script. What I propose is to start script errors on 3 onwards. Been 1 the error of AutoIt3, 2 of the wrapper, and finally the script. If you agree vote for me: "argumentum 2021" Really, if the concept is sound then say it and if not ... well, say it too PS: this is in regard to Exit codes of a script and not that of Return in a Function.
-
Hi, I have a problem in that one script runs successfully and gets to this line MsgBox(0x40,$UpdateID,"Successfully installed update " & $UpdateID) Exit(1) This script was started by another at this point: $InstallationResult = RunWait($ExeFileFullPath & " " & $InstallerParameters) ProcessWaitClose(StringReplace($FileName,"mmupdate","exe")) SplashOff() If $InstallationResult = $DesiredResult Then FileMove($ExeFileFullPath, $FileFullPath & ".done") LogWrite("Update succeeded") Else ; the update failed... oh dear what shall we do? If 1 = MsgBox(0x21,$PrettyScriptName,"The update failed to install - try again another time?") Then FileMove($ExeFileFullPath, $FileFullPath) LogWrite("Update failed - will be retried on next launch") Else FileDelete($ExeFileFullPath) LogWrite("Update failed - deleted by user request") EndIf EndIf I had two problems - first I had to put the processwaitclose in because otherwise the program would go onto the "update failed" msgbox before getting to the "update was successful" msgbox! second even with the processwaitclose it gives the $installationResult as 0 not 1 even though when it finally finished the first script the exit code must have been 1 as that follows after msgbox which shows? Any ideas? Is it possible that 2 exit codes are produced??? Is it possible for $installationResult to be set before the program finishes? Blessings Graeme