Exec()预处理器函数失败时,Inno Setup编译器是否可以停止



My Inno Setup脚本在使用#expr编译时运行批处理脚本,如下所示:

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

根据设计,#expr忽略了Exec()调用的返回值。这会默默地丢弃任何错误,这在我的情况下是不可取的。

Exec()失败时,是否可以使Inno Setup停止编译?

使用#if#error指令:

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

最新更新