Based on CheckBox value, WIX dialog is displayed

I have an instakllation, I have to show a dialog based on the checkbox value. I set the checkbox property to true initially.

<Property Id="CHECKBOX_1_PROP" Value="TRUE" />

      

And show a dialog based on checkbox values. If it is true I need to show Newdoalog_1, if it is false I need to show the installation dialog

<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="[ButtonText_Next]" TabSkip="no" Default="yes">
<Publish Event="SetTargetPath" Value="APPDIR">INSTALL</Publish>
<Publish Event="NewDialog" Value="NewDialog_1">INSTALL AND CHECKBOX_1_PROP="TRUE"</Publish>
<Publish Event="NewDialog" Value="SetupTypeDlg">INSTALL</Publish>
</Control>

<Control Id="CheckBox_1" Type="CheckBox" X="25" Y="164" Width="211" Height="26" Property="CHECKBOX_1_PROP" Text="Do you want to install the Samples" CheckBoxValue="CheckBox" TabSkip="no" Hidden="yes">
<Condition Action="show">INSTALL</Condition>
</Control>  

      

My problem is always showing the setup dialog which is false.

Help us with this.

+2


a source to share


2 answers


I'm guessing your checkbox doesn't set the string literal "TRUE"

, checkboxes completely remove the property when unchecked. Setting this property to any value ("0", "true", "false", "-1") will cause it to be checked. So ignore the value, just check if the property exists or not.



<Publish Dialog="MyDlg" Control="Next" Event="NewDialog" Value="CustomDlg1">PROP1</Publish>
<Publish Dialog="MyDlg" Control="Next" Event="NewDialog" Value="CustomDlg2">Not PROP1</Publish>

      

+2


a source


To force SetupTypeDlg to only display when CHECKBOX_1_PROP <> "TRUE", the code should look something like this:



    <Publish Event="NewDialog" Value="SetupTypeDlg"><![CDATA[INSTALL AND CHECKBOX_1_PROP<>"TRUE"]]></Publish>

      

+1


a source







All Articles