Command line WiX引导程序:如何从命令行设置burn变量?

Command line WiX引导程序:如何从命令行设置burn变量?,command-line,wix,bootstrapper,Command Line,Wix,Bootstrapper,使用WIX3.7和.NET4.0。 从命令行运行WiX bootstrapper EXE时,如何设置刻录变量?首先,需要将要设置的刻录变量设置为可覆盖的。为此,必须在WXS中包含以下名称空间:xmlns:bal=”http://schemas.microsoft.com/wix/BalExtension“如果您像我一样使用Visual Studio,则需要在项目引用中包含WixBalExtension.dll。接下来,您需要将以下属性添加到所有要通过命令行设置的burn变量中:bal:Ove

使用WIX3.7和.NET4.0。


从命令行运行WiX bootstrapper EXE时,如何设置刻录变量?

首先,需要将要设置的刻录变量设置为可覆盖的。为此,必须在WXS中包含以下名称空间:
xmlns:bal=”http://schemas.microsoft.com/wix/BalExtension“
如果您像我一样使用Visual Studio,则需要在项目引用中包含
WixBalExtension.dll
。接下来,您需要将以下属性添加到所有要通过命令行设置的burn变量中:
bal:Overridable=“yes”


现在,您可以通过命令行以以下方式设置变量:

BootstrapperSetup.exe /i /passive MyBurnVariable1=1 MyBurnVariable2=2

以下是满足上述所有条件的WXS文件示例:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
         xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">

  <Bundle Name="MyProduct" Version="1.0.0" Manufacturer="MyManufacturer" UpgradeCode="PUT-UPGRADE-CODE-HERE">

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
      <bal:WixStandardBootstrapperApplication LicenseUrl="MyLicense.htm" ThemeFile="MyThemeFile.xml" LocalizationFile="MyLocFile.wxl" />
    </BootstrapperApplicationRef>

    <Variable Name="MyBurnVariable1" bal:Overridable="yes" Type="numeric" Value="0" />
    <Variable Name="MyBurnVariable2" bal:Overridable="yes" Type="numeric" Value="0" />

    <Chain>
      <MsiPackage Id="MyFirstMsiPackage"
                  SourceFile="first.msi"
                  InstallCondition="MyBurnVariable1 = 1" />

      <MsiPackage Id="MySecondMsiPackage"
                  SourceFile="second.msi">
        <MsiProperty Name="MY_PROPERTY" Value="[MyBurnVariable2]" />
      </MsiPackage>
    </Chain>
  </Bundle>
</Wix> 

这适用于托管引导程序应用程序,但不适用于托管引导程序应用程序。因此,奇怪的是,从cmdline解析和重写变量的逻辑不在burn内核中。