inno-setup - 如果包含文件在包含后被删除,则 Inno Setup 在编译后显示 "Failed to open included file"错误消息

标签 inno-setup inno-setup-v6

我需要(相信我)使用一个工具来生成安装程序中包含的文件列表。

包含生成的文件列表的文件将在包含后立即删除。 编译脚本时,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/

相关文章:

inno-setup - 为什么在 Inno Setup 6 中编译的安装程序比 Inno Setup 5 大 1 MB

inno-setup - 在 Inno Setup 中的一个漂亮的任务对话框窗口中显示有关下载文件的错误哈希的信息

dll - Inno Setup 6 不能使用带字符串参数的 DLL 函数,但它在 Inno Setup 5 中有效

installation - 将字符串转换为字节数组将不起作用

inno-setup - Inno Setup - 如何在 32 和 64 架构之间执行 MSI

node.js - Inno Setup - 在从安装程序执行的批处理文件中无法识别由子安装程序添加到 PATH 的 npm 程序

electron - 编写定制的Electron-Forge Maker

command-line - 如何将带有值的命令行参数传递给 Inno Setup Compiler,以便我可以在我的代码中使用它们?

inno-setup - 为所有用户安装应用程序和数据库