Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created the dialog in wix which has 3 checkbox. user can select either one or all at a time. depending upon the selection of check box the feature needs to be selected and installed.

Suppose I have 3 application (ABC, DEF, GHI) and these are defined in the feature with condition statement:
C#
<Control Id="ABC" Type="CheckBox" X="190" Y="110" Width="50" Height="17" Property="PQR" CheckBoxValue="1" Text="ABC">
similarly for other 2 application also I have the checkbox control.

Now I have 3 features like below:
C#
<Feature Id="abc" Title="ABC" Level="0">
  <Condition Level="1"><![CDATA[PQR="1"]]></Condition>
  <ComponentRef Id="InstallABC"/>
</Feature>
I don't want to add the PQR as property in product.wxs because I don' want the checkbox to be selected by default.

Is it possible to do it using custom action.

I will be grateful for any answer or suggestions.

What I have tried:

By creating Properties in custom action and in product.wxs

Evaluation of the property value is not being considered while feature selection(making feature label = 1 on condition)
Posted
Updated 28-Nov-18 23:25pm
v2

1 solution

You need to publish the feature as AddLocal and explicitly you need to call Remove All before adding AddLocal. On Next button you need to write these code.

<Control Id="Next" Type="PushButton" X="248" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
          <Publish Event="Remove" Value="ALL" Order="1">1</Publish>
          <Publish Event="AddLocal" Value="Feature1">CheckBox1="1"</Publish>
          <Publish Event="AddLocal" Value="Feature2">CheckBox2="1"</Publish>
</Control>

Next the feature will look like this.

<Feature Id="Feature1" Title="ABC">
  <ComponentRef Id="InstallABC"/>
</Feature>

    Note:- Feature should not have the Level Element, Also Don't add any Property for your CheckBox explicitly anywhere like Product.wxs.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900