Ravi Hampole
Ravi Hampole

Reputation: 11

WIX installer - Installing Features based on checkbox selection in UI dialog is not working

Even though Checkbox is not selected, the msi installs all features. I have AddLocal and remove when Next is clicked. Here is the UI code:

            <Control Id="SFCheckBox" Type="CheckBox" X="20" Y="80" Width="290" Height="17" Property="SF_FEATURE" CheckBoxValue="0" Integer="yes" Text="iNetSec Smart Finder Sensor Service will be installed." Default="yes" Disabled="yes" />
            <Control Id="group_NDCforFEService" Type="CheckBox" X="20" Y="110" Width="290" Height="17" Property="FE_FEATURE" CheckBoxValue="1" Integer="yes" Text="iNetSec Smart Finder FireEye Integration Service will be installed." />

            <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next">
                <Publish Event="DoAction" Value="CostFinalize">1</Publish>
                <Publish Event="NewDialog" Value="UserInfoDlg" Order="2">SF_FEATURE</Publish>
      <Publish Event="AddLocal" Value="All" Order="3">1</Publish>
      <Publish Event="Remove" Value="IntegrationFeatures" Order="4">NOT FE_FEATURE</Publish>
            </Control>
            <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="Back">
      <Publish Event="AddLocal" Value="All" Order="3">1</Publish>
      <Publish Event="NewDialog" Value="InstallDirDlg" Order="4">1</Publish>
    </Control>
            <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
                <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
            </Control>

            <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="iNetSec Smart Finder Features." />
            <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}iNetSec Smart Finder Features" />
            <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
            <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
            <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
        </Dialog>
</UI> 

The Features in Product is as follows.
I don't know what I am I doing wrong here. Even though I did not select the second checkbox, the "IntegrationFeatures" was installed. When I checked the log file, I see this:

Property(S): ADDLOCAL = IntegrationFeatures,ProductFeature.

Please help. Thanks, Ravi

Upvotes: 1

Views: 1307

Answers (1)

sirdank
sirdank

Reputation: 3571

I do not recommend the AddLocal and Remove approach found here for the reasons I listed in the comments which amount to "Install everything and then removing it based on checkbox selection is silly and complicates silent installs".

What you should be doing is adding conditions to your <Feature> nodes like this:

<Feature Id="FeatureA" Level="0">
  <Condition Level="1">INSTALLFEATUREA</Condition>
  <ComponentGroupRef Id="A_Files" />
</Feature>

Upvotes: 1

Related Questions