在编译安装程序时,只有在指定路径中存在"readme“文件时,我才有下面的代码来显示InfoBeforeFile页面。
此外,在编译时,我希望在"readme“文件不存在时显示Info/警告消息。
#define readmeFile 'readme.rt'
[Setup]
#if FileExists(readmeFile)
InfoBeforeFile=notes.rtf
#else
;Is it possible to generate info message on Inno setup console when file does not exist ?
#endif欢迎使用Inno安装程序的任何其他部分显示来自安装部分的信息消息。
发布于 2018-09-27 10:17:48
您可以使用预处理指令
#define readmeFile 'readme.rt'
[Setup]
#if FileExists(readmeFile)
InfoBeforeFile=notes.rtf
#else
#pragma warning "Readme does not exist"
#endif您将在编译安装程序时获得此输出:
ISPP预处理 ISPP警告:自述文件不存在。 ISPP预处理
还有#pragma message。
为了清楚起见:这与Setup部分无关。使用#的所有行都是预处理器指令(如C/C++中的),这些指令甚至在Inno安装编译器解析部分之前就被处理了。
当自述文件不存在时,Inno安装程序编译器只会看到:
[Setup]当自述文件存在时,Inno安装编译器将看到:
[Setup]
InfoBeforeFile=notes.rtfhttps://stackoverflow.com/questions/52534602
复制相似问题