我有一个处于 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/