wixwindows-installerburnwix3.11

Displaying MSI version parts at the Wix Burn Bundle level (to display in title / caption)


I've discovered how to access the parts within the MSI/Product tag. But my goal was to set the caption of the burn installer based on the Major/Minor version number.

This code below is the summary of what I tried to do, but this doesn't work (I think because I'm not within the Product tag).

Burn wxs:

<Wix>
<Bundle Version="!(bind.packageVersion.<packageName>)" >

    <Variable Name="ProductVersionMajor" Value="!(bind.property.ProductVersion.Major)"/>
    <Variable Name="ProductVersionMinor" Value="!(bind.property.ProductVersion.Minor)"/>
....

Theme.wxl:

<WixLocalization ...>
  <String Id="Caption">[WixBundleName] [ProductVersionMajor].[ProductVersionMinor] Setup</String>
....

Is there some kind of work around where I can get this information at the bundle level without writing custom code?

This answer here was useful, but not quite what it appears I need; since I'm not within the WIX product tag for the inner MSI.


Solution

  • !(bind.property.ProductVersion.Major) is a bind variable when building an MSI, not a bundle. The available bind variables are documented at https://wixtoolset.org/documentation/manual/v3/overview/light.html. There is an open feature request for MsiPackage property bind variables at https://github.com/wixtoolset/issues/issues/4298. It would likely be additional work to get the ProductVersion.Whatever part working, so if you want that then you should add a comment to that issue.