我有这个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>
这是我们的product.wxs(Installer.msi) 的快捷方式,我在 Bootstrapper 上设置了对它的引用:
<Product Id="*" Name="YOUVI Panel v!(bind.FileVersion.fil33CD3061EBAE985C253BB51BC48FBD3C)" Language="!(loc.LANG)" Version="!(bind.FileVersion.fil33CD3061EBAE985C253BB51BC48FBD3C)" Manufacturer="Company" UpgradeCode="Some GUID">
我的问题是如何从我的bundle.wxs中的product.wxs中获得相同的ProductName或ProductVersion,以始终发布相同的版本和名称?当然,我们不必总是手动更改 Bootstrapper 中的版本号。
在 Bundle 中您可以引用包元数据。在您的情况下,
!(bind.packageVersion.Setup)
将为您提供MsiPackage
的版本。