gpt4 book ai didi

installation - 如何在WiX中至少需要两个可选组件之一?

转载 作者:行者123 更新时间:2023-12-03 08:15:59 25 4
gpt4 key购买 nike

我正在使用WixUIFeatureTree为用户提供他们想要安装应用程序的哪些组件的选项...我的功能之一具有两个可选功能,其中至少有一个必须安装才能使程序正常工作。我不想强制用户安装任何一个特定的设备,但是我对如何强制他们选择至少一个不知所措。

这是我当前的WXS的相关部分:

    <Feature Id="Main" Title="Product Name" Level="1" Absent="disallow" Display="expand" AllowAdvertise="no"
Description="This is the application, and is a required component"
>
<ComponentRef Id="Baseline" />
<ComponentRef Id="Shortcuts" />
<Feature Id="Option1" Title="Plugin #1" Level="2" Absent="allow" AllowAdvertise="no">
<ComponentRef Id="Plugin1Component" />
</Feature>
<Feature Id="Option2" Title="Plugin #2" Level="3" Absent="allow" AllowAdvertise="no">
<ComponentRef Id="Plugin2Component" />
</Feature>
</Feature>

我猜想我需要在序列的正确位置插入某种“自定义操作”,以确保选择了一个或另一个进行安装,但是不知道如何执行此操作,或者是否正确。所有帮助表示赞赏!

最佳答案

我意识到这是一篇老文章,但这是我使用WIX v3.7和UI FeatureTree解决此问题的方法:

<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">&amp;MyAppClientFeature=3 OR &amp;MyAppPrinterFeature=3</Publish>

完整的FeatureTree覆盖代码:
<UI Id="WixUI_FeatureTreeCustom">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="FeatureTree" />

<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>

<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg">LicenseAccepted = "1"</Publish>

<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish>
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="2">NOT Installed</Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">&amp;MyAppClientFeature=3 OR &amp;MyAppPrinterFeature=3</Publish>

<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>

<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>

<Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
</UI>

<UIRef Id="WixUI_Common" />

我希望这可以帮助某人。

关于installation - 如何在WiX中至少需要两个可选组件之一?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1365477/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com