Windows安装程序 - 使用WIX的InstallDir UI扩展时在两个退出对话框之间进行条件选择



我希望根据VersionMsi属性的版本有两个不同的退出对话框,以便为退出对话框使用超链接控件。点击此处了解更多信息。

我在安装过程中使用WIX的InstallDir_UI扩展的自定义版本。由于我希望可选地支持超链接控件(如果可用),我创建了两个不同的对话框:

<Dialog Id="NonHyperlinkExit" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">
    <Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" />
    ...
    <Control Id="HowToLink" Type="Text" X="135" Y="175" Width="220" Height="10" Transparent="yes" NoPrefix="yes" Text="!(loc.InfoUrl)" />
    ...
</Dialog>
<Dialog Id="HyperlinkExit" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">
    <Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" />
    ...
    <Control Id="HowToHyperLink" Type="Hyperlink" X="135" Y="175" Width="220" Height="10" Text="!(loc.InfoLink)" />
    ...
</Dialog>

然后,我修改了UI发布语句,以支持这些对话框,如下所示:

<Publish Dialog="NonHyperlinkExit" Control="Finish" Event="EndDialog" Value="Return" Order="998"><![CDATA[VersionMsi < "5.0"]]></Publish>
<Publish Dialog="HyperlinkExit" Control="Finish" Event="EndDialog" Value="Return" Order="999"><![CDATA[VersionMsi >= "5.0"]]></Publish>

当运行这个时,我得到以下错误:

error LGHT0204: ICE20: Exit dialog/action not found in 'AdminUISequence' Sequence Table. 
error LGHT0204: ICE82: This action HyperlinkExit has duplicate sequence number -1 in the table InstallUISequence

因此,我尝试修改InstallUISequence,但收效甚微。尝试过:

<InstallUISequence>
    ...
    <Show Dialog="NonHyperlinkExit" Before="HyperlinkExit"><![CDATA[VersionMsi < "5.0"]]></Show>
    <Show Dialog="HyperlinkExit" OnExit="success"><![CDATA[VersionMsi >= "5.0"]]></Show>
</InstallUISequence>

但这只会给我以下错误:

error LGHT0177: The InstallUISequence table contains an action 'NonHyperlinkExit' that is scheduled to come before or after action 'HyperlinkExit', 
which is a special action which only occurs when the installer terminates.  
These special actions can be identified by their negative sequence numbers.  
Please schedule the action 'NonHyperlinkExit' to come before or after a different action.

任何关于如何创建条件退出对话框的想法都将不胜感激。

MSI每个状态只支持一个退出对话框(例如,成功)。您可以使用显示相应对话框的自定义操作。

您还可以使用自定义操作,仅在支持时才将控件动态注入对话框。参见:

动态Windows安装程序UI

相关内容

  • 没有找到相关文章

最新更新