wix bundle only install changed msi

1.7k Views Asked by At

I have a wix bundle which has say 4 MSIs - all with version 1.0.0 and Bundle version as 1.0.0. I install this on a windows machine and in the ARP I see the WiX bundle as 1.0.0.

Now I make some changes to only one of the MSIs, say B, and change the Bundle version to 1.1.0 and the changed MSI (B) version to 1.1.0. The rest of the MSIs (A, C, D) are still at 1.0.0.

Now when I run the bundle again, I expect that installation for A, C and D would be skipped and only B would be upgraded and the bundle will also be updated with version 1.1.0 in the ARP. But what I observe is that installation for all the packages (A,B,C,D) take place and not just B.

So is my expectation wrong or am I doing something wrong?

This is what I have in my bundle code

<Chain>

 <MsiPackage Id=“A"

              Cache="no” 

      Vital=“yes"

              EnableFeatureSelection="no"

              Permanent="no" Visible="no"

              ForcePerMachine=“yes” 

             SourceFile = “<>”/>

   <MsiPackage Id=“B"

              Cache="no” 

      Vital=“yes"

              EnableFeatureSelection="no"

              Permanent="no" Visible="no"

              ForcePerMachine=“yes” 

             SourceFile = “<>”/>

</Chain>

And this is what I have in my wxs for the individual MSIs. I change the version to 1.1.0 only for MSI B and keep the UpgradeCode same.

<Product Id="*" UpgradeCode="<GUID which is same across installations>"
         Version="1.0.0" />
<MajorUpgrade DowngradeErrorMessage="New version is present."

I looked up many threads but generally they talk about upgrading all the MSIs, just not 1 MSI. Let me know if something is unclear and thanks in advance for your help.

2

There are 2 best solutions below

2
On

Part of the majorUpgrade Element there is a AllowSameVersionUpgrades attribute, with default value no.

Meaning "When set to no (the default), installing a product with the same version and upgrade code (but different product code) is allowed and treated by MSI as two products. When set to yes, WiX sets the msidbUpgradeAttributesVersionMaxInclusive attribute, which tells MSI to treat a product with the same version as a major upgrade."

Check this attribute and see if it helps with your issue. The best practice is to change the version to all msis and the bundle, this is done automatically part of the CI/CD pipeline of releasing the product.

2
On

Burn won't install a package if it's already installed. But if you rebuild a package with Product/@Id="*", the package identity changed (both product code and package code). So Burn installs what looks like a new package. If you want Burn to skip such a package, don't rebuild it.