wix 主要升级未安装所有文件 [英] wix major upgrade not installing all files

查看:24
本文介绍了wix 主要升级未安装所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的 WiX 项目(版本 3.7),它安装了一些文件(一个 .NET 程序版本 6.0.0.0).我已准备好使用 WiX 中的 MajorUpgrade 功能发布新版本 6.0.1.0.

I have a very simple WiX project (version 3.7) that installs somes files (a .NET program version 6.0.0.0). I'm ready to release a new version 6.0.1.0 using the MajorUpgrade functionality in WiX.

我在 Product 元素中保持 UpgradeCode 相同,并将版本从 6.0.0.0 更改为 6.0.1.0

I'm keeping the UpgradeCode the same in the Product element and I change the Version from 6.0.0.0 to 6.0.1.0

<Product Id="*" Name="MyApp" Version="6.0.1.0" Manufacturer="Me" 
       UpgradeCode="$(var.TheUpgradeCodeGUID)">

在安装了 6.0.0.0 的机器上,我运行新的安装程序.

On a machine with 6.0.0.0 installed, I run the new installer.

旧版本 6.0.0.0 的删除运行正常(正在删除所有已安装的文件),但是当安装程序继续安装新版本时,缺少 2 个文件:第 3 方 DLL 和第 3 方 EXE(即未更改)未重新安装.

The removal of the old version 6.0.0.0 runs ok (all installed files are being removed), but when the installer continues to install the new version, 2 files are missing: a 3rd party DLL and a 3rd party EXE (that haven't been changed) are not being reinstalled.

<Component Id="AutomaticUpdaterWPF.dll" Guid="*">
        <File Id="AutomaticUpdaterWPF.dll" Source="AutomaticUpdaterWPF.dll" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="wyUpdaterProgram" Guid="*">
        <File Id="wyUpdaterProgram" Source="wyUpdate.exe" KeyPath="yes" Checksum="yes" />
</Component>

< 中的所有其他文件ComponentGroup >(一些已修改,一些未修改,包括其他 3rd 方 DLL)在主要升级期间被正确安装.

All other files in the < ComponentGroup > (some modified, some unmodified incl. other 3rd party DLLs) are being installed correctly during the major upgrade.

如果我在重大升级后单击修复",则丢失的 2 个文件会重新出现.另外,如果我是第一次安装 6.0.1.0 版本(不升级,而是在干净的机器上首次安装),那么这两个文件是直接正常安装的.(在多台 Windows 机器(XP、7 和 8)上测试过

If I click on "repair" after the major upgrade, the 2 missing files re-appear. Also, if I install version 6.0.1.0 for the first time (no upgrade, but first installation on a clean machine), then those 2 files are installed directly and normally. (tested on several Windows machine (XP, 7 and 8)

任何人有任何建议什么是错的以及如何解决它?

Anybody any suggestion what is wrong and how to fix it?

推荐答案

提供的日志文件显示机器上已经有几个文件的较新版本:

The log file provided shows that newer versions of a few files already on the machine:

MSI (s) (0C:5C) [16:13:25:890]: Disallowing installation of component: {015A4DC1-56F4-562B-96B5-B3BE0D45FA5F} since the same component with higher versioned keyfile exists
MSI (s) (0C:5C) [16:13:25:890]: Disallowing installation of component: {4B6A1404-3892-5BEF-AB47-8FE3149211A4} since the same component with higher versioned keyfile exists

我过去曾看到此更新程序存在此问题.克里斯托弗是对的.更新程序更新了它的文件,但没有告诉 MSI(它没有更新 MSI,这是不正确的做法).新的 MSI 认为机器上有更新的东西,选择不安装它的文件,但在升级过程中旧包删除了文件(它没有注意到版本更新).由于新安装程序选择不安装文件,您最终什么都没有……直到修复.

I've seen this problem with this updater in the past. Christopher is correct. The updater updated its files but didn't tell the MSI (it doesn't update the MSI which is not the correct thing to do). The new MSI thinks newer stuff is on the machine, chooses not to install its files, but during the upgrade the old package removes the files (it doesn't notice that the versions are newer). Since the new installer chose not to install the files you end up with nothing... until the repair.

要解决此问题,您需要稍后移动 RemoveExistingProducts 操作.如果您使用的是 MajorUpgrade 元素,那么 Schedule='afterInstallExecute'Schedule='afterInstallFinalize' 应该可以解决问题.您需要更加小心组件规则.

To work around the problem, you need to move your RemoveExistingProducts action later. If you're using the MajorUpgrade element then Schedule='afterInstallExecute' or Schedule='afterInstallFinalize' should do the trick. You'll need to be more careful with the Component Rules.

另外,恕我直言,第 3 方供应商不应更新 MSI 之外的文件.他们的决定是迫使您的产品采用特定的升级方式.

Also, IMHO, the 3rd party vendor should not be updating files outside of the MSI. Their decision is forcing your product into a particular way of upgrading.

这篇关于wix 主要升级未安装所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆