我需要(相信我)使用一个工具来生成安装程序中包含的文件列表。
包含生成的文件列表的文件将在包含后立即删除。 编译脚本时,Inno Setup 包含文件列表,但显示橙色警告消息
Failed to open included file: Cannot open file "D:\foo\TempFileList.txt". The system can not find the file
重现:
放置一个包含eg的文件TempFileList.txt
Source: "D:\foo\test.DE"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\foo\test.ES"; DestDir: "{app}"; Flags: ignoreversion
旁边是 Inno Setup 脚本,内容如下:
[Setup]
AppName=InnoTest
AppVerName=InnoTest
DefaultDirName={commonpf}\InnoTest
[Files]
#define TempFile SourcePath+'TempFileList.txt'
#include TempFile
#expr DeleteFile(TempFile)
编译时您会看到橙色警告消息。
为什么 Inno Setup 在处理完文件列表后仍要打开它?
谢谢!
最佳答案
来自"new"Inno Setup 6.1 IDE功能:
The Compiler IDE now automatically opens (up to 10)
#include
files in tabs which allow you to edit and debug these files from within the Compiler IDE. The list of#include
files is updated after opening a new main file and after each compilation. This can be turned off in the options.
所以这是无害的 IDE 专用的东西。如果您在命令行上编译,则不会发生这种情况。
如果您仍想禁用该功能,请转至“工具”>“选项”>“杂项”>“自动打开 #include 文件”。
关于inno-setup - 如果包含文件在包含后被删除,则 Inno Setup 在编译后显示 "Failed to open included file"错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75140185/