Search code examples
wixwindows-installerburn

How to use an option set in the burn UI in the install package (msi)


I am using the standard (EulaHyperlink) Burn installer, but added an option the the "Install" page like this:

 <Page Name="Install">
<Text X="150" Y="15" Width="-11" Height="100" FontId="2" DisablePrefix="yes">#(loc.WillInstall)</Text>
<Hypertext Name="EulaHyperlink" X="150" Y="-60" Width="-11" Height="17" TabStop="no" FontId="3" HideWhenDisabled="yes">#(loc.InstallLicenseLinkText)</Hypertext>

  <Checkbox Name="InstallXfemilyCheckbox" X="150" Y="-70" Width="246" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">Veraltete Programme auch installieren</Checkbox>

  <Button Name="InstallButton" X="-101" Y="-11" Width="85" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
<Button Name="WelcomeCancelButton" X="-11" Y="-11" Width="85" Height="23" TabStop="yes" FontId="0">#(loc.InstallCloseButton)</Button>

How do i pass the"checked" or "Not checked" property of that checkbox to the msi?

I do know i can pass properties like this (from the bundle):

    <MsiProperty Name="NAME-IN-MSI" Value="Value-Seen-In-MSI"/>

But what is "Value-Seen-In-MSI" in this case? How do i reference the value of the checkbox?


Solution

  • Basically, it goes like this:

    The checkbox need to be on the options page. Wix will create a variable with the name of the checkbox. You can refer to it using brackets and define an MSI property. This property can be used like any other.

    So, Checkbox like this:

      <Page Name="Options">
          <Checkbox Name="OptionsBox" X="110" Y="143" Width="200" Height="21" TabStop="yes" FontId="3"  />
    
          <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.OptionsOkButton)</Button>
          <Button Name="OptionsCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.OptionsCancelButton)</Button>
      </Page>
    

    Using it in the bundle like this:

        <MsiPackage SourceFile="PathToMSI-File.msi">
            <MsiProperty Name="OPTIONSVALUE" Value="[OptionsBox]"/>
        </MsiPackage>
    

    After that, it is a standard property you can use like any other.