如何在wix中只选择一项功能?
Posted
技术标签:
【中文标题】如何在wix中只选择一项功能?【英文标题】:How to choose just one feature in wix? 【发布时间】:2013-10-15 07:56:02 【问题描述】:我有一些应该是互斥的功能,但这些期货只有在安装了某些特定软件时才会显示。现在我想允许用户从这些功能中选择一个来安装.. 有任何想法吗?我不能使用单选按钮,因为功能取决于条件(如果安装了某些软件,我们不能只禁用一些单选按钮......) 我也试图在futuretree选择中做到这一点......我知道如何允许用户只选择一个特性,(只是在特性选择树的每次更改后调用costfinalize操作)但是如果用户按下下一步然后返回......所有功能被禁用...
<Feature Id='FM10' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 10 files" Description="Frame Maker 10 files.">
<ComponentRef Id='FAMSMainFM10DLL_component' />
<Condition Level="0">NOT FM10HOME AND NOT REMOVE</Condition>
<Condition Level="5000"><![CDATA[(&FM72 = 3 OR &FM72 = 4 OR &FM71 = 3 OR &FM71 = 4 OR &FM70 = 3 OR &FM70 = 4 OR &FM8 = 3 OR &FM8 = 4) AND FM10HOME]]></Condition>
</Feature>
<Feature Id='FM8' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 8 files" Description="Frame Maker 8 files.">
<ComponentRef Id='FAMSMainFM8DLL_component' />
<Condition Level="0">NOT FM80HOME AND NOT REMOVE</Condition>
<Condition Level="5001"><![CDATA[(&FM72 = 3 OR &FM72 = 4 OR &FM71 = 3 OR &FM71 = 4 OR &FM70 = 3 OR &FM70 = 4 OR &FM10 = 3 OR &FM10 = 4) AND FM80HOME]]></Condition>
</Feature>
<Feature Id='FM70' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 7 files" Description="Frame Maker 7.0 files.">
<ComponentRef Id='FAMSMainFM7DLL_component' />
<Condition Level="0">NOT FM70HOME AND NOT FM71HOME AND NOT FM72HOME AND NOT REMOVE</Condition>
<Condition Level="5001"><![CDATA[(&FM71 = 3 OR &FM71 = 4 OR &FM72 = 3 OR &FM72 = 4 OR &FM10 = 3 OR &FM10 = 4 OR &FM8 = 3 OR &FM8 = 4) AND FM70HOME]]></Condition>
</Feature>
<Feature Id='FM71' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 7 files" Description="Frame Maker 7.1 files.">
<ComponentRef Id='FAMSMainFM7DLL_component' />
<Condition Level="0">NOT FM70HOME AND NOT FM71HOME AND NOT FM72HOME AND NOT REMOVE</Condition>
<Condition Level="5001"><![CDATA[(&FM10 = 3 OR &FM10 = 4 OR &FM8 = 3 OR &FM8 = 4) AND FM71HOME]]></Condition>
</Feature>
<Feature Id='FM72' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 7 files" Description="Frame Maker 7.2 files.">
<ComponentRef Id='FAMSMainFM7DLL_component' />
<Condition Level="0">NOT FM70HOME AND NOT FM71HOME AND NOT FM72HOME AND NOT REMOVE</Condition>
<Condition Level="5001"><![CDATA[(&FM70 = 3 OR &FM70 = 4 OR &FM71 = 3 OR &FM71 = 4 OR &FM10 = 3 OR &FM10 = 4 OR &FM8 = 3 OR &FM8 = 4) AND FM72HOME]]></Condition>
</Feature>
【问题讨论】:
【参考方案1】:终于解决了:
<Feature Id='FM10' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 10 files" Description="Frame Maker 10 files.">
<ComponentRef Id='FAMSMainFM10DLL_component' />
<Condition Level="5000">FM10T = "LOCKED" AND FM10HOME</Condition>
<Condition Level="1">FM10T = "UNLOCKED" AND FM10HOME</Condition>
<Condition Level="0">NOT FM10HOME AND NOT REMOVE</Condition>
</Feature>
<Feature Id='FM8' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 8 files" Description="Frame Maker 8 files.">
<ComponentRef Id='FAMSMainFM8DLL_component' />
<Condition Level="5001">FM8T = "LOCKED" AND FM80HOME</Condition>
<Condition Level="1">FM8T = "UNLOCKED" AND FM80HOME</Condition>
<Condition Level="0">NOT FM80HOME AND NOT REMOVE</Condition>
</Feature>
<Feature Id='FM70' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 7.0 files" Description="Frame Maker 7.0 files.">
<ComponentRef Id='FAMSMainFM7DLL_component' />
<Condition Level="5001">FM7T = "LOCKED" AND FM70HOME</Condition>
<Condition Level="1">FM70T = "UNLOCKED" AND FM70HOME</Condition>
<Condition Level="0">NOT FM70HOME AND NOT REMOVE</Condition>
</Feature>
<Feature Id='FM71' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 7.1 files" Description="Frame Maker 7.1 files.">
<ComponentRef Id='FAMSMainFM7DLL_component' />
<Condition Level="5001">FM71T = "LOCKED" AND FM71HOME</Condition>
<Condition Level="1">FM71T = "UNLOCKED" AND FM71HOME</Condition>
<Condition Level="0">NOT FM71HOME AND NOT REMOVE</Condition>
</Feature>
<Feature Id='FM72' AllowAdvertise="no" TypicalDefault="install" ConfigurableDirectory="INSTALLDIR" Level='5000' Title="Frame Maker 7.2 files" Description="Frame Maker 7.2 files.">
<ComponentRef Id='FAMSMainFM7DLL_component' />
<Condition Level="5001">FM72T = "LOCKED" AND FM72HOME</Condition>
<Condition Level="1">FM72T = "UNLOCKED" AND FM72HOME</Condition>
<Condition Level="0">NOT FM72HOME AND NOT REMOVE</Condition>
</Feature>
和:
<Control Id="Tree" Type="SelectionTree" X="25" Y="85" Width="175" Height="115" Property="_BrowseProperty" Sunken="yes" TabSkip="no" Text="!(loc.CustomizeDlgTree)" >
<Publish Property="FM70T" Value="UNLOCKED">MsiSelectionTreeSelectedFeature = "FM70" AND (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Property="FM71T" Value="UNLOCKED">MsiSelectionTreeSelectedFeature = "FM71" AND (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Property="FM72T" Value="UNLOCKED">MsiSelectionTreeSelectedFeature = "FM72" AND (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Property="FM8T" Value="UNLOCKED">MsiSelectionTreeSelectedFeature = "FM8" AND (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Property="FM10T" Value="UNLOCKED">MsiSelectionTreeSelectedFeature = "FM10" AND (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Property="FM70T" Value="LOCKED">NOT MsiSelectionTreeSelectedFeature = "FM70" AND NOT (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Property="FM71T" Value="LOCKED">NOT MsiSelectionTreeSelectedFeature = "FM71" AND NOT (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Property="FM72T" Value="LOCKED">NOT MsiSelectionTreeSelectedFeature = "FM72" AND NOT (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Property="FM8T" Value="LOCKED">NOT MsiSelectionTreeSelectedFeature = "FM8" AND NOT (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Property="FM10T" Value="LOCKED">NOT MsiSelectionTreeSelectedFeature = "FM10" AND NOT (MsiSelectionTreeSelectedAction = 3 OR MsiSelectionTreeSelectedAction = 4)</Publish>
<Publish Event="DoAction" Value="CostFinalize">1</Publish>
</Control>
【讨论】:
以上是关于如何在wix中只选择一项功能?的主要内容,如果未能解决你的问题,请参考以下文章