32

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?

Community
  • 1
  • 1
noelicus
  • 14,468
  • 3
  • 92
  • 111

2 Answers2

40

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.

Isaiah4110
  • 9,855
  • 1
  • 40
  • 56
  • 5
    for people visiting, replace `PackageID` with the *name* of the program that you are installing. It should look something like `Version="!(bind.packageVersion.MyAwesomeApp)"` (at least worked for me..) – default Sep 11 '14 at 14:23
  • Actually it's not the name of the app, but its id. See Bob's answer to this same question: http://stackoverflow.com/a/25828610/118878 – DenNukem May 11 '17 at 15:43
  • `!(bind.packageVersion.PackageID)` gets the package version number of the msi file represented by `PackageID`. To make that number the same as your application version number you also need `Version="!(bind.FileVersion.MyAppID)"` in your *msi configuration file* (attribute of the `Product` element). – Ian Goldby Aug 09 '17 at 13:37
19

To supplement Isaiah4110's answer (I can't comment yet and my edit was rejected):

The PackageID comes from the Id value for one of the package types (eg MsiPackage, ExePackage...) in your Chain. So to reference the version number of <MsiPackage SourceFile="SomePath\MyMsi.msi" Id="MyMsi"/> you would use !(bind.packageVersion.MyMsi).

If you don't have an Id (like myself), you'll need to define one.

Bob Lutz
  • 311
  • 2
  • 7