简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM