开发者

Based on CheckBox value show the WIX Dialog

I have instakllation i have to show the Dialog based on the checkbox value. I have set the checkbox property as true initially.

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

And show the dialog based on the check box values. If it is true i have to show the Newdoalog_1 if it is false i have to show the Setup 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="C开发者_如何学GoheckBox" TabSkip="no" Hidden="yes">
<Condition Action="show">INSTALL</Condition>
</Control>  

My Problem is always show the Setup Dialog that is False condition.

Pls help on this.


I'm guessing your checkbox isn't setting the string literal "TRUE", check-boxes completely delete the property when unchecked. Setting that property to any value ("0", "true", "false", "-1") would 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>


To get the SetupTypeDlg to only show 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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜