Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Inno Setup compiler halt upon Exec() preprocessor function failure?

Tags:

inno-setup

My Inno Setup script runs a batch script while compiling 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?

like image 734
Aaron Cicali Avatar asked Apr 13 '26 20:04

Aaron Cicali


1 Answers

Use #if and #error directives:

#if Exec("\build.bat", null, null, 1) != 0
    #error The build batch has failed
#endif
like image 115
Martin Prikryl Avatar answered Apr 22 '26 15:04

Martin Prikryl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!