因此,我有一个使用 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 如下所示:
如果删除了合并模块(由于安装程序中的文件更新,需要将其包含在内),则升级将按预期进行。这是合并模块的东西/WiX/Windows 安装程序中的错误,还是我做错了什么?