Search code examples
c#xmlwixburn

How to get the msi version number on Wix burn Bootstrapper


I have this bundle.wxs:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
 xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">

<?define ProductName="YOUVI Panel v5.0.9.0" ?>

<Bundle Name="$(var.ProductName)" Version="5.0.9.0" Manufacturer="Company" UpgradeCode="Some GUID" IconSourceFile ="Resources/youvi_panel.ico">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
        <bal:WixStandardBootstrapperApplication
        LicenseFile="Resources/license_en.rtf"
        LogoFile="Resources/dialog.jpeg"
        ThemeFile="Resources/CustomTheme.xml"
        LocalizationFile="Resources/CustomTheme.wxl"/>
    </BootstrapperApplicationRef>
    
    <Chain>
        <MsiPackage
        Id ="Setup"
        DisplayName ="YOUVI.PanelService.Installer"
        DisplayInternalUI ="no"
        SourceFile="$(var.YOUVI.PanelService.Installer.TargetPath)"
        Compressed="yes"
        Vital="yes"
        Permanent="no"/>
    </Chain>
</Bundle>

and this is an shortcut from our product.wxs(Installer.msi) where I set an reference to on the Bootstrapper:

<Product Id="*" Name="YOUVI Panel v!(bind.FileVersion.fil33CD3061EBAE985C253BB51BC48FBD3C)" Language="!(loc.LANG)" Version="!(bind.FileVersion.fil33CD3061EBAE985C253BB51BC48FBD3C)" Manufacturer="Company" UpgradeCode="Some GUID">

My question is how can I get the same ProductName or the ProductVersion like from our product.wxs in my bundle.wxs to publish always the same version and name? And of course that we don't must change always the version number from the Bootstrapper by hand.


Solution

  • In a Bundle you can reference package metadata. In your case, !(bind.packageVersion.Setup) would give you the version of the MsiPackage.