【问题标题】:Conditional choose between two exit dialog when using WIX's InstallDir UI extension使用 WIX 的 InstallDir UI 扩展时在两个退出对话框之间进行条件选择
【发布时间】:2012-10-16 22:21:22
【问题描述】:

我希望有两个基于 VersionMsi 属性版本的不同退出对话框,以便将超链接控件用于退出对话框。更多信息here

我正在为我的安装过程使用 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.

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

【问题讨论】:

    标签: wix windows-installer conditional wix3.5 wix-extension


    【解决方案1】:

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

    【讨论】:

    • 或者您可以根据VersionMsi 属性有条件地在对话框中显示或隐藏控件。
    • 可以展示一些示例 WiX 代码以了解如何执行此操作吗?
    • 您将如何处理“退出状态”?代表最终状态的自定义操作?其他方式?
    • 自定义操作将检查 MSI 版本并使用 MsiDoAction 显示 =5.0 的另一个对话框。 Alexey 的技术值得一试,但我记得,如果 MSI 遇到未知的控件类型,无论它们是否可见/启用,都会引发错误。
    • 我很想看到这样的例子。
    【解决方案2】:

    您还可以使用自定义操作将控件动态注入到对话框中,前提是该对话框受支持。见:

    Dynamic Windows Installer UI

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-16
      • 2013-09-22
      • 2021-12-06
      相关资源
      最近更新 更多