inno-setup - Inno Setup - 保留单个现有文件,但将所有其他文件安装在目录树中

标签 inno-setup

我有一个处于 Beta 测试阶段的应用程序。它有应用程序文件和一个数据库 (.db) 文件,我想保留而不是替换它。

假设我向我的客户提供了 1.0 版,他们安装了它。现在我的 1.1 版在应用程序文件中有一些更改,但在数据库中没有。

我如何指示 Inno Setup 保留该文件,而对其余文件进行替换?

[Files]
Source: "D:\nw\testfile.db"; DestDir: "{app}"; Flags: uninsneveruninstall   onlyifdoesntexist
Source: "D:\nw\*"; Excludes: "\node_modules\"; DestDir: "{app}"; Flags:  recursesubdirs createallsubdirs;

有了这个脚本文件,testfile.db 总是被新版本覆盖。

我的目标是在新安装期间保留 testfile.db

2016-06-06 13:36:21.630 -- File entry --
2016-06-06 13:36:21.630 Dest filename: C:\Complexity tool\testfile.txt
2016-06-06 13:36:21.631 Time stamp of our file: 2016-06-06 09:41:08.000
2016-06-06 13:36:21.631 Dest file exists.
2016-06-06 13:36:21.631 Time stamp of existing file: 2016-06-06 09:41:08.000
2016-06-06 13:36:21.631 Version of our file: (none)
2016-06-06 13:36:21.631 Version of existing file: (none)
2016-06-06 13:36:21.631 Installing the file.
2016-06-06 13:36:21.632 Successfully installed the file.

谢谢

最佳答案

问题是,虽然第一个条目 D:\nw\testfile.db 可能没有安装该文件,但第二个通配符条目 D:\nw\*

您甚至必须将 onlyifdoesntexist 添加到通配符条目中。或者,如果您需要覆盖所有其他文件,即使它们存在,请从通配符条目中显式排除 testfile.db 文件:

Source: "D:\nw\testfile.db"; DestDir: "{app}"; Flags: uninsneveruninstall onlyifdoesntexist
Source: "D:\nw\*"; Excludes: "\node_modules\,\testfile.db"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs

关于inno-setup - Inno Setup - 保留单个现有文件,但将所有其他文件安装在目录树中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37651852/

相关文章:

registry - 从 Inno Setup AppId 中删除 "_is1"后缀

installation - Inno Setup 查找子文件夹

logging - 如何记录 Inno Setup 安装?

configuration - Inno Setup Service 登录身份

windows - 如何从 Batch 脚本上的 Exec 调用获取 ResultCode?

inno-setup - Inno 安装程序 : rich tooltips in component list

windows - 避免 Inno Setup 中的 "Failed to expand shell folder constant userdocs"错误

inno-setup - 安装开始前 Inno Setup : Download setup . bin 切片文件

windows - Windows 中是否存在非提升用户具有写入权限的共享文件夹?

inno-setup - Inno-Setup ISS 脚本可以包含外部ISS 脚本文件吗?