1

Using WiX-Toolset there's the requirement to be able to install a service optionally, but by default it will not be installed.

A dialog was created, which is called after the Lincense Agreement.

In this dialog.wxs there is the following code

<UI>
  <?define OutlookSyncTitle="title" ?>
  <?define OutlookSyncDescription="description" ?>

  <Property Id="OUTLOOKSYNC_CHECKED" Secure="yes"/>

  <Dialog Id="OutlookSyncDlg_HK" Width="370" Height="270" Title="$(var.OutlookSyncTitle)">
    <Control Id="OutlookSync" Type="CheckBox" X="20" Y="45" Width="330" Height="18"
             CheckBoxValue="1" Property="OUTLOOKSYNC_CHECKED" Text="$(var.OutlookSyncDescription)">
    </Control>
    <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
    <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
      <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
    </Control>
</Dialog>
</UI>

In the product.wxs there is the following feature

<Feature Id="OutlookSync" Title="TestServiceInstaller" Level="0">
  <Condition Level="1"><![CDATA[OUTLOOKSYNC_CHECKED = "1"]]></Condition>
  <ComponentGroupRef  Id="ServiceComponent" />
</Feature>

The service never gets installed. When I set a default value for OUTLOOKSYNC_CHECKED = 1, it will always get installed.

What am I missing?

phhbr
  • 2,699
  • 1
  • 14
  • 25
  • Possible duplicate of [Wix 3.5, Install features based on checkboxes](https://stackoverflow.com/questions/9367670/wix-3-5-install-features-based-on-checkboxes) – Michael Urman Jun 09 '17 at 12:36
  • See also [Wix - Conditional install of features based on radio buttons](https://stackoverflow.com/questions/9328619/wix-conditional-install-of-features-based-on-radio-buttons) – Michael Urman Jun 09 '17 at 12:37
  • Try checking if your property exists, instead of its value. See this answer: https://stackoverflow.com/a/2807498/1247172 – BBR Jun 12 '17 at 16:29

0 Answers0