You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将Burn安装程序UI中复选框状态传递至MSI安装包

How to Pass Burn Checkbox State to an MSI

Great question! To pass the checked/unchecked state of your InstallXfemilyCheckbox to your MSI, you'll need to link the checkbox to a Burn variable, then map that variable to an MSI property using <MsiProperty>. Here's a step-by-step breakdown:

1. Add a Variable to Your Checkbox Control

First, update your Checkbox definition in the Install page to include a Variable attribute (this tells Burn to store the checkbox's state in a named variable). You can also set a DefaultValue to ensure the variable has a predictable value even when the checkbox is unchecked:

<Checkbox Name="InstallXfemilyCheckbox" 
          X="150" Y="-70" Width="246" Height="17" 
          TabStop="yes" FontId="3" HideWhenDisabled="yes"
          Variable="INSTALL_XFAMILY" 
          DefaultValue="0">
  Veraltete Programme auch installieren
</Checkbox>
  • Variable="INSTALL_XFAMILY": This Burn-side variable holds the checkbox state (value is 1 when checked, 0 when unchecked, thanks to the DefaultValue).
  • DefaultValue="0": Ensures the variable defaults to "0" if the user doesn't interact with the checkbox, avoiding empty/unset values that could break MSI logic.

2. Map the Burn Variable to an MSI Property

Next, in your Bundle's <MsiPackage> element, use <MsiProperty> to pass the Burn variable's value to a corresponding property in your MSI. The Name is the property name you'll define in your MSI, and the Value uses Burn's variable syntax ([VariableName]) to reference the checkbox state:

<MsiPackage SourceFile="YourApplication.msi" Id="YourMsiPackageId">
  <!-- Map Burn variable to MSI property -->
  <MsiProperty Name="INSTALL_XFAMILY" Value="[INSTALL_XFAMILY]" />
</MsiPackage>

Here, NAME-IN-MSI becomes INSTALL_XFAMILY (the property name in your MSI), and Value-Seen-In-MSI is [INSTALL_XFAMILY] (the Burn variable linked to the checkbox).

3. Prepare the MSI to Receive the Property

Finally, make sure your MSI is set up to accept this property:

  • Define a Public Property: In your MSI's Property table, add a property named INSTALL_XFAMILY with a default value of 0.
  • Secure the Property (if needed): If your installer requires UAC elevation, add INSTALL_XFAMILY to the SecureCustomProperties list in the Property table. This prevents the property from being filtered out during elevation.

Once set up, when the user checks the checkbox, the MSI will receive INSTALL_XFAMILY=1; if unchecked, it will receive INSTALL_XFAMILY=0. You can then use this property in your MSI's logic (e.g., conditional component installation, custom actions) to control whether the legacy programs are installed.

内容的提问来源于stack exchange,提问作者Thomas Woelfer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:40:27