gpt4 book ai didi

inno-setup - 创新设置 : How to expand preprocessor variable in #error directive message

转载 作者:行者123 更新时间:2023-12-05 00:54:51 24 4
gpt4 key购买 nike

我有一个 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 中扩展预处理器变量指示?

最佳答案

#error directive的论据不能包含变量。

但是您可以使用 #pragma error directive反而:

#pragma error "No installer found at " + a_path

关于inno-setup - 创新设置 : How to expand preprocessor variable in #error directive message,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39119990/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com