Can Inno Setup halt upon Exec() failure?

Advertisements

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?

>Solution :

Use #if and #error directives:

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

Leave a ReplyCancel reply