I'm using Wise Installation System 9.02

I want to have my script execute another program, and should it fail will an exit code other than 0, I want my script to exit with the same error code.

Put another way, if I call MSIExec to install an application and the installation fails with exit code 1603, I want to exit my wise script with exit code 1603.

Is there any way to use a variable for the Application Exit Code? Does anyone have any other ideas?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
You should be able to use the PROCEXITCODE variable in Wise when you execute another application. When you choose the script piece for "Execute program" make sure you check the "Wait" box and for the variable choose PROCEXITCODE. This should capture the exit code of the program you just called.

Hope that helps.
Answered 04/20/2006 by: yarborg
Blue Belt

Please log in to comment
0
That part isn't the problem. I don't have any problem determining the exit code of the called program, the issue is with the Exit function in Wise. It won't let me set the Application Exit Code programatically duing execution (at least I haven't figured out how).

When using the exit command, it demands that you enter an non-negative integer, and won't let me enter a variable name.
Answered 04/20/2006 by: BoyGenius
Orange Belt

Please log in to comment
0
While its not a cools as passing INSTALL_RESULT as the wrapper's exit code, I've found a happy medium:

I've configured my program to use an .MIF (I've never bothered to before). Now, if the installation launched by my wrapper exits with a code other than 0, my wrapper still exits with an exit code that means nothing, but I can include the results of INSTALL_RESULT in the text written to the .MIF.

...at least I think I can. I've just started testing.
Answered 05/24/2006 by: BoyGenius
Orange Belt

Please log in to comment
0
Can you tell me how you were able to create a .mif with your WiseScript to accomplish this? While I am still hoping I will find something that will allow me to exit with the appropriate code (after all that capability makes sense when used as a wrapper) I am researching alternate reporting methods.

Thank you!
Answered 07/09/2008 by: mupdike
Senior Yellow Belt

Please log in to comment
0
LOL...you're expecting an answer to a resurrected post from TWO YEARS AGO? :)

I Googled with the search term

WiseScript +".MIF"

I figure the top few hits ought to provide an answer for you or, at the very worst, some hefty clues.
Answered 07/10/2008 by: VBScab
Red Belt

Please log in to comment
0
I knew there was a risk in resurrecting this old of a post. I was hoping that someone had a good link or method already doc'd that could be shared. I've been googling the issue, of course, and have found a few links with some potential but still hoped to find something a bit more concrete here.

Thanks!
Answered 07/10/2008 by: mupdike
Senior Yellow Belt

Please log in to comment
2
You can do this using the 'ExitProcess' Windows API function (it terminates the current process and allows you to specify the exit code).

Set a variable e.g. EXITCODE in your Mainline event code as required, e.g. after calling MSIEXEC, Set variable EXITCODE to %INSTALL_RESULT%.

In the Wise Script editor, select the 'Exit' event (this runs when an Exit Installtion command is used).

Add a 'Call DLL Function' command:

[blockquote]

DLL Pathname=%SYS32%\kernel32.dll
Function Name=ExitProcess
Select 'Call a function with variable parameter list'
Add parameter:

[blockquote]
Parameter Type=long
Passing Type=Normal
Value Source=Variable
Variable Name=EXITCODE[/blockquote]
Return Value Type=long[/blockquote]
Some more info on the Windows function

One thing to remember - the exit code integer specified in the Wise Exit Installation command will be ignored, so you if you want to control the exit code within your code, you need to remember to set the EXITCODE variable before exiting.
Answered 07/30/2008 by: nortonl
Senior Yellow Belt

Please log in to comment
0
This method works just the same in older versions of Wise Script which do not have the Exit Code parameter on the Exit Installation command.
Answered 07/30/2008 by: nortonl
Senior Yellow Belt

Please log in to comment
0
Oops - just edited the above post as I left out the all important 'Function Name=ExitProcess'.
Answered 07/31/2008 by: nortonl
Senior Yellow Belt

Please log in to comment
0
Fyi: Late to the party here (and resurrecting this thread for the third time), but just tried nortonl's method. Am happy to report it works great, and --even better-- much simpler than messing with .mif files.

I also found a handy VBscript someone posted to verify the Execute Program's "%INSTALL_RESULT%" value is really being passed along as the "wrapper" EXE's final exit code:
https://www-secure.symantec.com/community/download/10831/vbscript-install-application-exit-code

Hope this helps!
Answered 02/24/2009 by: norexx
Orange Belt

Please log in to comment
Answer this question or Comment on this question for clarity