How to make the WiX Bundle version the same as my application's version

noelicus picture noelicus · Aug 16, 2013 · Viewed 8.5k times · Source

The "Version" attribute in a WiX Bundle is displayed in Programs and Features. Therefore this ought to be the same as my actual application's version number, right?

On the assumption they should be the same it doesn't seem immediately obvious how to have this update automatically. I've got the MSI doing it as per this question, but not the Bundle/Bootstrapper bit. How can I make the Bootstrapper Bundle do the same thing and read the MSI version number?

Answer

Isaiah4110 picture Isaiah4110 · Aug 16, 2013

To answer your first question, there are no hard and fast rules for this. So it is not a must to update your WIX bundle version and match that with your MSI version.

As for the second question, am not really sure. But you can try this binder variable:

!(bind.packageVersion.PackageID) 

EDIT replace PackageID with the element "ID" attribute of the program that you are installing. Something like: Version="!(bind.packageVersion.MyAppName)"

<MsiPackage SourceFile="SomePath\MyAppName.msi" Id="MyAppName"/>

as mentioned in this POST. Also check the WIX documentation for more binder variables.

EDIT 5/11/2017 - looks like there was confusion around what the packageID should be and I have edited the answer based on Bob Lutz answer below.