Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can Inno Setup halt upon Exec() failure?

My Inno Setup script runs a batch script using #expr, like so:

#expr Exec("\build.bat", null, null, 1)

By design, #expr ignores the return value of the Exec() call. This silently discards any errors, which is not desirable in my case.

Can Inno Setup be made to halt compiling upon Exec() failure?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Use #if and #error directives:

#if Exec("\build.bat", null, null, 1) != 0
    #error The build batch has failed
#endif
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading