Customising the WiX Burn theme with additional inputs

后端 未结 1 1528
滥情空心
滥情空心 2021-01-02 00:20

I\'m looking at using Burn as a bootstrapper for an installer and I need to pass in a couple of arguments into the MSI.

I know that the way to do this is to use

相关标签:
1条回答
  • 2021-01-02 00:54

    I cant find any documentation on this anywhere, but a little bit of experimentation + reading through the source code reveals that this is fairly straightforward - just set the Name of the control (e.g. Checkbox) to the name of a Burn variable (not a WiX variable - they are different), like so (see Burn UI Customisations for more info on where to put this)

    <Checkbox Name="MyCheckBox" ...>Hello, checkbox</Checkbox>
    

    If you like you can define a burn variable beneath your bundle to initialise it to some value (use 1 for "ticked" and 0 for "unticked" with checkboxes)

    <Variable Name="MyCheckBox" Value="1" />
    

    However its not required - the variable will be created automatically for you anyway. Note that it needs to be a Variable, not a WixVariable - these are different.

    Finally to set an MSI property based on this variable add a MsiProperty element as a child of your MsiPackage element, like so

    <MsiPackage Name="MyMsi.msi" ...>
        <MsiProperty Name="SOMEPROPERTY" Value="[MyCheckBox]" />
    </MsiPackage>
    

    The value of the MSI property "SOMEPROPERTY" will then be set to 0 or 1 based on the checked state of your checkbox.

    0 讨论(0)
提交回复
热议问题