WIX安装程序 - 根据UI对话框中的复选框选择安装功能不起作用

时间:2015-07-25 00:58:03

标签: wix

即使没有选中Checkbox,msi也会安装所有功能。我有 AddLocal ,并在点击下一步时删除。这是UI代码:                                             

            <Control Id="SFCheckBox" Type="CheckBox" X="20" Y="80" Width="290" Height="17" Property="SF_FEATURE" CheckBoxValue="0" Integer="yes" Text="iNetSec Smart Finder Sensor Service will be installed." Default="yes" Disabled="yes" />
            <Control Id="group_NDCforFEService" Type="CheckBox" X="20" Y="110" Width="290" Height="17" Property="FE_FEATURE" CheckBoxValue="1" Integer="yes" Text="iNetSec Smart Finder FireEye Integration Service will be installed." />

            <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next">
                <Publish Event="DoAction" Value="CostFinalize">1</Publish>
                <Publish Event="NewDialog" Value="UserInfoDlg" Order="2">SF_FEATURE</Publish>
      <Publish Event="AddLocal" Value="All" Order="3">1</Publish>
      <Publish Event="Remove" Value="IntegrationFeatures" Order="4">NOT FE_FEATURE</Publish>
            </Control>
            <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="Back">
      <Publish Event="AddLocal" Value="All" Order="3">1</Publish>
      <Publish Event="NewDialog" Value="InstallDirDlg" Order="4">1</Publish>
    </Control>
            <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
                <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
            </Control>

            <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="iNetSec Smart Finder Features." />
            <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}iNetSec Smart Finder Features" />
            <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
            <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
            <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
        </Dialog>
</UI> 

产品中的功能如下。                                                                                                                                                             
                       我不知道我在这里做错了什么。即使我没有选择第二个复选框,也安装了“IntegrationFeatures”。当我检查日志文件时,我看到了:

  

属性(S):ADDLOCAL = IntegrationFeatures,ProductFeature。

请帮忙。 谢谢, 拉维

1 个答案:

答案 0 :(得分:1)

我不推荐发现here的AddLocal和Remove方法,因为我在评论中列出的原因是&#34;安装所有内容然后根据复选框选择删除它是愚蠢的并且使静默安装变得复杂&# 34。

您应该做的是向<Feature>节点添加条件,如下所示:

<Feature Id="FeatureA" Level="0">
  <Condition Level="1">INSTALLFEATUREA</Condition>
  <ComponentGroupRef Id="A_Files" />
</Feature>