gpt4 book ai didi

Wix 安装程序 - 根据自定义对话框输入有条件地在 ExitDialog 上显示 "Launch application"

转载 作者:行者123 更新时间:2023-12-02 09:39:16 25 4
gpt4 key购买 nike

我是 Windows Installer 和 Wix 的新手,所以请原谅新手问题。

我正在使用 WixUI_InstallDir 并添加了一个自定义对话框,该对话框在 LicenseAgreementDlg 之后和 InstallDirDlg 之前显示 3 个复选框。有没有办法仅当第一个复选框被选中并且安装程序第一次执行时才在 ExitDialog 上有条件地显示“启动已安装的应用程序”复选框?

在我的 wxs 文件中,我有

<!-- Property for each checkbox value (first checkbox checked by default) -->
<Property Id="Checkbox1" Value="1"/>
<Property Id="Checkbox2"/>
<Property Id="Checkbox3"/>

<!-- Custom action to set exit dialog checkbox -->
<CustomAction Id="CA_Set_WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch application."/>

<InstallUISequence>
<Custom Action="CA_Set_WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" After="FindRelatedProducts">Checkbox1 = 1 and NOT Installed</Custom>
</InstallUISequence>

<!-- User Interface -->
<UI>
<UIRef Id="WixUI_InstallDir"/>
<UIRef Id="WixUI_ErrorProgressText"/>
<DialogRef Id="MyCheckboxesDlg"/>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="MyCheckboxesDlg" Order="3">LicenseAccepted = "1"</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="MyCheckboxesDlg">1</Publish>
</UI>

我的问题是,如果取消选中第一个复选框,则在 InstallUISequence 结束后 Checkbox1 属性值将设置为 0,因此退出对话框中的启动应用程序仍会显示。

我应该在 UISequence 或 ExecuteSequence 中的哪里设置该属性?

最佳答案

我想我明白了...只是在按下自定义对话框中的“下一步”按钮时调用 CA_Set_WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT 自定义操作,而不是在 InstallUISequence 中调用它。

<!-- NO LONGER NEEDED
<InstallUISequence>
<Custom Action="CA_Set_WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" After="FindRelatedProducts">Checkbox1 = 1 and NOT Installed</Custom>
</InstallUISequence>
-->

<Fragment>
<UI>
<Dialog Id="MyCheckboxesDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="ChkBox1" Type="CheckBox" X="25" Y="75" Width="200" Height="17" Property='Checkbox1' CheckBoxValue='1' >
<Text>First checkbox</Text>
</Control>
<Control Id="ChkBox2" Type="CheckBox" X="25" Y="95" Width="200" Height="17" Property='Checkbox2' CheckBoxValue='1'>
<Text>Second checkbox</Text>
</Control>
<Control Id="ChkBox3" Type="CheckBox" X="25" Y="115" Width="200" Height="17" Property='Checkbox3' CheckBoxValue='1'>
<Text>Third checkbox</Text>
</Control>

<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next">
<Publish Event="DoAction" Value="CA_Set_WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Order="1">Checkbox1= 1</Publish>
<Publish Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
</Control>

<!-- Other UI controls... -->

</Dialog>
</UI>
</Fragment>

关于Wix 安装程序 - 根据自定义对话框输入有条件地在 ExitDialog 上显示 "Launch application",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4284731/

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