Russell Steen
Russell Steen

Reputation: 6612

How to make a custom action return non-zero

I'm working with the .NET Installer, and using a custom action executable file. According to this documentation, if it fails it must return non-zero. However this is new ground for me and I do not know how to make an executable "return" a value.

How does an custom action executable return a non-zero value and abort the install?

Upvotes: 0

Views: 160

Answers (1)

Mrchief
Mrchief

Reputation: 76258

If it is your executable, simply add an exception handler (try/catch block) and return (Environment.Exit(-1) -1 in the catch block, 0 otherwise.

If it is a third party, then you have less options. Try checking their manual or contact them directly.

Perhaps you can run the executable and see what values it returns from the command line. You may not have to do anything at all other than consuming it in your installer.

Upvotes: 1

Related Questions