维克斯3.5的基础上安装复选框功能 [英] Wix 3.5, Install features based on checkboxes

查看:123
本文介绍了维克斯3.5的基础上安装复选框功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让这个当用户选择通过复选框东西,相应的功能将被安装。我知道预建功能树维克斯提供但也有我这样做,不允许我使用这个功能的一些其他的东西。我很好奇,如何将两者联系在一起,这样当用户选择复选框安装功能X,当用户点击安装按钮功能X的安装...任何建议将不胜感激。

I am trying to make it so that when the user selects something via check box, a corresponding feature will be installed. I am aware of the prebuilt feature tree that Wix provides but there are some other things that I am doing that do not allow me to use this function. I am curious as to how to link the two together so that when the user selects the check box "Install Feature X", feature X is installed when the user clicks the install button...any advice would be greatly appreciated.

推荐答案

我发现它是什么,解决了我的问题。为了做到,因为我本来打算我需要创建一个复选框为每个单独的功能如此。

I found what it was that solves my issue. In order to do as I had intended I needed to create a check box for each individual feature as so.

<Control Id="FeatureX" Type="CheckBox" X="191" Y="50" Width="140" Height="17"
     Property="FEATUREX_CHECKED" CheckBoxValue="myValue" Text="Install feature 1" />
<Control Id="FeatureY" Type="CheckBox" X="191" Y="67" Width="140" Height="17"
     Property="FEATUREY_CHECKED" CheckBoxValue="myValue" Text="Install feature 1" />
<Control Id="FeatureZ" Type="CheckBox" X="191" Y="84" Width="140" Height="17"
     Property="FEATUREZ_CHECKED" CheckBoxValue="myValue" Text="Install feature 1" />

现在一旦我这样做,我再添加相应的发布到每一个,并提出,提出条件因此,只有当选择了复选框将该功能被安装。像这样:

Now once I did that I then added a corresponding publish to each, and made a condition that made it so that only if the check box is selected will that feature be installed. Like so:

<Control Id="Next" Type="PushButton" Text="Next" X="254" Y="243" Height="17" Width="56">
   <Publish Event="Remove" Value="ALL" Order="1">1</Publish>
   <Publish Event="AddLocal" Value="FeatureX" Order="2">
      <![CDATA[FEATUREX_CHECKED]]>
   </Publish>
</Control>



注:



删除是用来从安装取消一切(它带给我的注意,一旦UI被调用为时已晚改变功能级别)。

NOTE:

Remove is used to deselect everything from being installed (It was brought to my attention that once the UI is invoked it is too late to change feature levels).

然后每个特征进行检查,以查看是否已经选择了对应复选框,如果是这样它添加到ADDLOCAL性质。 ADDLOCAL应该是这样的,如果一个是看它:

Then each feature is checked to see if the "corresponding check box" has been selected and if so adds it to the "AddLocal" Property. AddLocal would look like this if one was to look at it:

ADDLOCAL=FeatureX,FeatureY,FeatureZ...

我需要做的就是这个工作的最后一件事是检查过我的main.wxs确保与ComponentGroupRefID匹配了相应的复选框使用FeatureID的使用:

The Final thing I needed to do to get this to work was too check in my main.wxs to make sure that the FeatureID used in the check boxes matched up with the ComponentGroupRefID used:

 <ComponentGroupRef Id="FeatureX"/>



所以它是...我再次感谢大家的这方面的帮助。如果有人读这是由什么困惑,请随时给我行,我会尽我所能解释的东西远一点。

So there it is... I again thank everyone for their help with this. If anyone reading this is confused by anything please feel free to drop me a line and I will do my best to explain things a little bit further.

这篇关于维克斯3.5的基础上安装复选框功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆