将合并模块添加到Wix项目会导致升级失败

时间:2013-04-03 17:04:48

标签: installer wix windows-installer wix3.6 merge-module

所以,我有一个使用WiX创作的产品安装程序,一旦合并'Microsoft_VC100_CRT_x86.msm'合并模块,就无法正确升级。安装过程中不会删除旧产品。如果从项目中删除合并模块,则会删除旧版本。

合并模块非常简单地包含在Directory节点下:

<Directory Id="ProgramFilesFolder">
  <Merge Id="VC10_CRT_MergeId1" Language="0" SourceFile="c:\\Program Files (x86)\\Common Files\\Merge Modules\\Microsoft_VC100_CRT_x86.msm" DiskId="1" />
... other stuff
</Directory>

然后在功能中引用:

<Feature Id="MainFeature" Title="Core Files" Level="1">
  <MergeRef Id="VC10_CRT_MergeId1" />
  ... other stuff
</Feature>

我正在增加产品的版本号,但升级失败并且新版本安装在旧版本上但未执行正确升级 - 两个版本都列在“添加或删除程序”中。

旧产品应按如下方式删除:

<InstallExecuteSequence>
  <RemoveExistingProducts After='InstallValidate'/>
</InstallExecuteSequence>

我还根据http://jpassing.com/2007/06/16/where-to-place-removeexistingproducts-in-a-major-msi-upgrade/为RemoveExistingProducts尝试了其他各种职位,结果相同。

在安装程序的详细日志中,可以看到以下内容:

MSI (s) (AC:44) [19:48:22:300]: Doing action: RemoveExistingProducts
MSI (s) (AC:44) [19:48:22:300]: Note: 1: 2205 2:  3: ActionText 
Action start 19:48:22: RemoveExistingProducts.
MSI (s) (AC:44) [19:48:22:300]: Note: 1: 2205 2:  3: Error 
MSI (s) (AC:44) [19:48:22:300]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 22 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2205 2:  3: Error 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 23 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2205 2:  3: Error 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 16 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2205 2:  3: Error 
MSI (s) (AC:44) [19:48:22:301]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 21 
Action ended 19:48:22: RemoveExistingProducts. Return value 1.

在WiX构建日志中,我得到以下内容(但是从内存中这对VC运行时msms来说是正常的吗?):

1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 1 in the table InstallExecuteSequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 1 in the table InstallUISequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 3 in the table AdminExecuteSequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 3 in the table AdminUISequence
1>light.exe(0,0): warning LGHT1076: ICE82: This action SystemFolder_x86_VC.F1DD796A_B984_3DCA_A68D_6B352BDC86F3 has duplicate sequence number 3 in the table AdvtExecuteSequence

msi中的InstallExecuteSequence如下所示:

enter image description here

如果删除了合并模块(由于安装程序中更新的文件需要包含它),则升级将按预期工作。这是合并模块中的一个错误/ WiX / Windows Installer,还是我做错了什么?

2 个答案:

答案 0 :(得分:0)

您在升级时没有收到任何错误消息?它通过,但你留下了两个添加/删除条目和混乱的文件系统?听起来你的两个版本不共享相同的升级代码。

如果您尝试执行minor upgrade,则不会触发RemoveExistingProducts。文件应该更新,但你会保留一个添加/删除条目。

如果您尝试进行主要升级以触发RemoveExistingProducts,但您需要正确设置Upgrade element

另外,作为提示,请勿使用合并模块。由于Windows Installer组件规则的工作方式,在次要升级时,您无法删除合并模块添加的组件。您需要引入一次重大升级。 (或者将旧的合并模块中的所有组件代码手动添加到项目中。不好玩。)根据您的所有内容的设置方式,强制进行重大升级可能会非常麻烦。

如果添加合并模块,稍后需要将其删除,您将遇到此问题。或者如果你想用VS 2012替换说VS 2010模块。 MS甚至打破了一次服务包之间的组件规则。通过在产品安装期间或之前运行vcredist * .exes来安装它们要容易得多。

答案 1 :(得分:0)

你找到了问题吗?检查要添加的合并模块的版本是否早于正在安装的系统上已存在的版本。在这种情况下,MSI将删除VC ++文件,但不会因为它们较旧而将新文件放下。

编辑:我找到了解决问题的方法!! 你应该使用:     RemoveExistingProducts After =“InstallFinalize

参考:http://blogs.msdn.com/b/astebner/archive/2007/02/08/assemblies-may-be-missing-from-the-gac-or-winsxs-cache-after-an-msi-major-upgrade.aspx

我有同样的问题,并修改它修复它。