Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX Burn Theme checkbox - making it checked by default

Tags:

checkbox

wix

I've added a checkbox to the pre-existing WixBootstrapper theme in the options page:

<Checkbox Name="MyCheckbox" X="11" Y="217" Width="17" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes" />

In my bundle I pass the value of this checkbox through to the MSI:

<MsiPackage DisplayInternalUI="no" SourceFile="..\WixInstaller\bin\$(var.Configuration)\myinstaller.msi" Id="MainPackage">
<MsiProperty Name="INSTALLDIR" Value="[InstallFolder]" />
<MsiProperty Name="CHECKED" Value="[MyCheckbox]" />

This works fine, except I want the Checkbox to be checked by default.

I've seen solutions where you define:

<Property Id="myprop" Value="1" />

and change the Checkbox to have a Property="myprop" attribute.

Adding any <Property> element to the burn theme seems to break it (.exe won't run after building).

like image 874
RickySpanish Avatar asked Aug 22 '17 13:08

RickySpanish


1 Answers

I finally found the answer here.

You set a variable in your Bundle with the same name as your checkbox:

<Bundle ...>
    <Variable Name="MyCheckbox" Type="numeric" Value="1" />

I've never been so happy to see a checkbox checked!

like image 154
RickySpanish Avatar answered Nov 15 '22 11:11

RickySpanish