是否有可能为多个MSI创建一个语言中立的补丁?



我们有不同语言的多个MSI,所以每个MSI都有自己的ProductCode和UpgradeCode。使用英语MSI,我们使用Aaron的方法在http://blogs.msdn.com/astebner/archive/2007/10/26/5700191.aspx中创建了一个补丁,例如蜡烛/光/火炬/pyro使用以下补丁。wxs:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Patch 
        AllowRemoval="yes" 
        Manufacturer="xxx" 
        MoreInfoURL="xxx" 
        DisplayName="MyProduct First Patch" 
        Description="My Product First Patch" 
        Classification="Update Rollup" 
   >
      <Media Id="5000" Cabinet="RTM.cab" >
         <PatchBaseline Id="RTM"/>
      </Media>
      <PatchFamilyRef Id="PatchFamilyRollup"/>
   </Patch>
   <Fragment>    
      <PatchFamily Id='PatchFamilyRollup' Version='1.1.1.1' Supersede='yes'>
... 

然而,当我们在安装了非英文MSI的机器上应用这个补丁时,我们得到以下错误:" Windows安装程序服务无法安装升级补丁,因为要升级的程序可能缺失,或者升级补丁可能更新的是不同版本的程序。验证要升级的程序在您的计算机上是否存在,并且您有正确的升级补丁。

我的问题是,是否有可能创建一个可以在任何语言上使用的补丁(MSP) ?如果是这样,需要做些什么?

我认为你应该尝试Validate元素,它是PatchBaseline的子元素,以及torch.exe命令行的验证标志。正确的比特组合可以让你安装补丁。

谢谢Yan给了我正确的方向。我玩了"Validate"元素和"torch"命令好几个小时,但我得到了同样的错误。然后我的同事向我展示了"TargetProductCode"元素。经过几次尝试,我终于让它工作了,尽管解决方案并不是完全语言中立的。我找到的答案是"Validate"元素和"TargetProductCode"元素的组合。我把我自己的答案贴出来,以便有人可以从中受益。

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Patch 
        AllowRemoval="yes" 
        Manufacturer="xxx" 
        MoreInfoURL="xxx" 
        DisplayName="MyProduct First Patch" 
        Description="My Product First Patch" 
        Classification="Update Rollup" 
   >
      <Media Id="5000" Cabinet="RTM.cab">
         <PatchBaseline Id="RTM" >
            <Validate ProductId='no' ProductLanguage='no' ProductVersionOperator='LesserOrEqual' UpgradeCode='no' />
         </PatchBaseline>
      </Media>
      <TargetProductCodes Replace='yes'>
         <!-- list all language specific ProductCode here. -->
         <TargetProductCode Id='{xxxxx}' /> <!-- ProductCode for English -->
         <TargetProductCode Id='{yyyyy}' /> <!-- ProductCode for French -->
      </TargetProductCodes>
      <PatchFamilyRef Id="PatchFamilyRollup"/>
   </Patch>
...

最新更新