Wix 工具集 - 相同的 MSI 未重新安装

Wix Toolset - Identical MSI not reinstalling

我正在创建一个带有基本目录安装和单个 post-install 自定义操作的 msi 安装程序。安装程序应该支持重新安装所有版本范围(较新、较旧、相同)。

除了重新安装相同的 msi 之外,几乎一切正常。当执行与当前安装的相同 msi 的 msiexec(但可能是其他 msiexec 命令行属性)时,安装程​​序启动并退出但不执行任何操作并且不在日志中显示错误。

升级和降级工作正常(指定 'AllowDowngrades="yes"' 时)。当我构建一个与当前安装的版本相同的新 msi 时,重新安装也会正确发生。我也尝试设置 AllowSameVersionUpgrades 而不是 AllowDowngrades,但没有成功。

关于如何配置我的 wxs 以允许重新安装相同的 msi 文件的任何提示?目前我的 MajorUpgrade 看起来像这样:

<MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" Disallow="no" DowngradeErrorMessage="Not allowed to downgrade." IgnoreRemoveFailure="yes" MigrateFeatures="yes" />

我在 msiexec 输出中看到的是正常重新安装和相同的 msi 安装失败之间的区别;是安装程序的开始提到 'FindRelatedProducts. Return Value0':

Action 14:12:52: INSTALL. 
Action start 14:12:52: INSTALL.
Action 14:12:52: FindRelatedProducts. Searching for related applications
Action start 14:12:52: FindRelatedProducts.
Action ended 14:12:52: FindRelatedProducts. Return value 0.
Action 14:12:52: AppSearch. Searching for installed applications
Action start 14:12:52: AppSearch.
AppSearch: Property: NETFRAMEWORK45, Signature: NetFramework45
Action ended 14:12:52: AppSearch. Return value 1.
Action 14:12:52: LaunchConditions. Evaluating launch conditions
Action start 14:12:52: LaunchConditions.
Action ended 14:12:52: LaunchConditions. Return value 1.
Action 14:12:52: ValidateProductID. 
Action start 14:12:52: ValidateProductID.
Action ended 14:12:52: ValidateProductID. Return value 1.
Action 14:12:52: CostInitialize. Computing space requirements

虽然成功的 upgrade/downgrade msiexec 日志如下所示:

Action 18:27:21: INSTALL. 
Action start 18:27:21: INSTALL.
Action 18:27:21: FindRelatedProducts. Searching for related applications
Action start 18:27:21: FindRelatedProducts.
FindRelatedProducts: Found application: {014FD491-292B-4BFC-BCFB-87121C11BCE9}
Action ended 18:27:21: FindRelatedProducts. Return value 1.
Action 18:27:21: AppSearch. Searching for installed applications
Action start 18:27:21: AppSearch.
AppSearch: Property: NETFRAMEWORK45, Signature: NetFramework45
Action ended 18:27:21: AppSearch. Return value 1.
Action 18:27:21: LaunchConditions. Evaluating launch conditions
Action start 18:27:21: LaunchConditions.
Action ended 18:27:21: LaunchConditions. Return value 1.
Action 18:27:21: ValidateProductID. 
Action start 18:27:21: ValidateProductID.
Action ended 18:27:21: ValidateProductID. Return value 1.

我是 Wix 的新手,所以非常欢迎任何关于如何解决这个问题或我可以尝试什么的提示。

干杯。

澄清:我不想一次安装多个相同 msi/program 的实例,但是我想在再次执行相同的 msi 时强制完全重新安装,无需先手动执行卸载。这允许通过 msiexec cli 属性和自定义操作重新配置软件。

最可能的原因是您不能多次安装相同的 MSI。该产品由其 ProductCode 标识,如果该产品已安装,则没有 "install it again"。安装的产品将进入维护模式,这通常是修复(在无法添加或删除功能的情况下)。

如果您真的想要(比如说)并排安装 10 个相同的产品,那么它们每个都需要是不同的产品(由 ProductCode 标识)。 Programs&Features中存在多个相同条目的一般问题,可能存在多个相同的快捷方式,对象只能使用一次的问题(例如服务名称),您可能需要考虑如何在同一系统上维护多个产品打补丁、升级等。

如果您的目标是升级已安装的产品(通常这意味着您有更新的文件),那么您需要使用 MajorUpgrade 元素进行重大升级。这将安装较新的版本并自动卸载以前的版本。但是,如果您的主要升级指定 AllowSameVersionUpgrades=yes 并且您更改了 ProductCode 和 PackageCode,则它只能是 "same" MSI,因此实际上没有办法重新安装相同的 MSI - 它可以具有相同的文件和其他内容,但它需要新的产品和包代码值进行重大升级。

我的问题已通过 Daniel Lee 的评论得到解决 - 谢谢! 使用 msiexec 参数/开关 REINSTALL 和 REINSTALLMODE 确实允许完全重新安装相同的 msi 文件,使用 REINSTALL=all 和 REINSTALLMODE=a .

REINSTALL

REINSTALL_MODE