Inno Setup:如何在#error指令消息中扩展预处理器变量

时间:2016-08-24 09:54:07

标签: inno-setup preprocessor

我有一个Inno Setup脚本,它将文件作为预处理器步骤查找:

#define a_path GetEnv("INSTALLER_FILES")
#define install_file FindFirst(a_path + "\pattern*.*")

如果找不到install_file,我想发出错误:

#if install_file == 0
    #error No installer found at {#a_path}
#endif

但ISPP只在编译时写入文字源代码:

> script.iss: [ISPP] No installer found at {#a_path}

是否可以在#error指令中扩展预处理器变量?

1 个答案:

答案 0 :(得分:3)

#error directive的参数不能包含变量。

但您可以改为使用#pragma error directive

#pragma error "No installer found at " + a_path