使用wix安装程序中的复选框,根据用户选择安装的功能 [英] Feature to be installed depending upon user selection using checkbox in wix installer
问题描述
我在wix中创建了一个有3个复选框的对话框。用户可以一次选择一个或全部。根据复选框的选择,需要选择和安装功能。
假设我有3个应用程序(ABC,DEF,GHI),这些是在条件声明的功能:
< Control Id = ABC类型= CheckBox X = 190 Y = 110宽度= 50高度= 17 Property = PQR CheckBoxValue = 1 Text = ABC >
同样对于其他2个应用程序我也有复选框控件。 我不想在产品.wxs中添加PQR作为属性,因为我不想在默认情况下选中该复选框。
现在我有3个功能如下:
< pre lang =c#>< Feature Id = abc Title = ABC Level = 0 >
<条件级别= < span class =code-string> 1><![CDATA [PQR = 1]] > < / 条件 >
< ComponentRef Id = InstallABC跨度> />
< / 功能 >
是否可以使用自定义操作。
我将不胜感激任何答案或建议。
我尝试过:
通过在自定义操作和product.wxs中创建属性
特征选择时不考虑属性值的评估(条件上使特征标签= 1)
您需要将该功能发布为AddLocal,并明确需要在添加AddLocal之前调用Remove All。在下一步按钮上,您需要编写这些代码。
< Control Id =NextType =PushButtonX =248Y =243Width =56Height =17Default =yesText =! (loc.WixUINext)>
< Publish Event =RemoveValue =ALLOrder =1> 1< / Publish>
< Publish Event =AddLocalValue =Feature1> CheckBox1 =1< / Publish>
< Publish Event =AddLocalValue =Feature2> CheckBox2 =1< / Publish>
< / Control>
接下来,该功能将如下所示。
< Feature Id =Feature1Title =ABC>
< ComponentRef Id =InstallABC/>
< / Feature>
注意: - 功能不应该包含Level元素,也不要在Product.wxs之类的任何地方显式添加CheckBox的任何属性。
>
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:
<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:
<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)
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.
这篇关于使用wix安装程序中的复选框,根据用户选择安装的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!