Question

I compile an NSIS script to a .exe install file. I launch the .exe with command line \S silent option.

Installation performs silently as wanted, but there is exit code 1. Exit code 1 corresponds to case with user choosing cancel on the wizard. However, install is successful and mode is silent (no user interaction). Also, where does this exit code comes from, and how to manually enforce an exit code 0?

I have an idea i could do something in .onInstSuccess function, to enforce an exit code 1 if installation is successful.

Also, ExecWait is capturing the exit code into a variable, but has got no 'set' option.

What would you recommend?

Thanks and regards

Was it helpful?

Solution

Without any sample code it is a bit hard to guess what the problem could be!

You can set a specific exit code with SetErrorLevel.

As far as ExecWait goes, setting anything makes no sense, when it returns the child process has ended. If you want to use the exit code of a child process all you need is to get it:

ExecWait '"c:\foo.exe"' $0
SetErrorLevel $0
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top