Petronius
Petronius

Reputation: 454

WIX - Is it possible to create a language neutral patch for multiple MSI?

We have the multiple MSI's for the different languages, so each MSI has its own ProductCode and UpgradeCode. Using English MSI's, we created a patch using Aaron's approach in http://blogs.msdn.com/astebner/archive/2007/10/26/5700191.aspx, e.g. candle / light / torch / pyro with the following Patch.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'>
... 

However, when we apply this patch on the machine where non-English MSI was installed, we get the following error: "The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch."

So my question is, is it possible to create a patch (MSP) that can be used on any language? If so, what needs to be done?

Upvotes: 1

Views: 582

Answers (2)

Petronius
Petronius

Reputation: 454

Thanks Yan for giving me a right direction. I played with "Validate" element and "torch" command quite a few hours, but I got the same error. Then my co-worker showed me "TargetProductCode" element. After a few trials, I finally made it work although the solution isn't purely language-neutral. The answer I found is a combination of "Validate" element and "TargetProductCode" element. I am posting my own answer so that someone may get benefit out of it.

<?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>
...

Upvotes: 1

Yan Sklyarenko
Yan Sklyarenko

Reputation: 32260

I think you should experiment with the Validate element, which is a child of PatchBaseline, and the validation flags of torch.exe command line. The right combination of bits will let you install your patch.

Upvotes: 1

Related Questions