成功安装后不要在 wix 中显示 ExitDlg

本文关键字:wix 显示 ExitDlg 安装 成功 | 更新日期: 2023-09-27 18:31:54

我使用 WIX 开发了安装程序,并创建了引导程序项目以包含其他依赖项。应用程序正在安装,没有问题。安装后,它显示成功对话框,用户单击Close后对话框关闭。我想在应用程序安装后删除或隐藏该对话框。我已经获取了 wix 的源代码并将ExitDialog.wxs添加到我的项目中。

ExitDialog.wxs

<?xml version="1.0" encoding="UTF-8"?>
<!--
  <copyright file="ExitDialog.wxs" company="Outercurve Foundation">
    Copyright (c) 2004, Outercurve Foundation.
    This software is released under Microsoft Reciprocal License (MS-RL).
    The license and further copyright text can be found in the file
    LICENSE.TXT at the root directory of the distribution.
  </copyright>
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI>
            <Dialog Id="ExitDialog" 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="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUICancel)" />
                <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.ExitDialogBitmap)" />
                <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
                <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
                <Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="40" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogDescription)" />
                <Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogTitle)" />
                <Control Id="OptionalText" Type="Text" X="135" Y="110" Width="220" Height="80" Transparent="yes" NoPrefix="yes" Hidden="yes" Text="[WIXUI_EXITDIALOGOPTIONALTEXT]">
                    <Condition Action="show">WIXUI_EXITDIALOGOPTIONALTEXT AND NOT Installed</Condition>
                </Control>
                <Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="190" Width="220" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]">
                    <Condition Action="show">WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed</Condition>
                </Control>
            </Dialog>
            <InstallUISequence>
                <Show Dialog="ExitDialog" OnExit="success" Overridable="yes" />
            </InstallUISequence>
            <AdminUISequence>
                <Show Dialog="ExitDialog" OnExit="success" Overridable="yes" />
            </AdminUISequence>
        </UI>
    </Fragment>
</Wix>

我应该更改哪些值ExitDialog.wxs以隐藏ExitDlg对话框。需要帮助来解决这个问题。

成功安装后不要在 wix 中显示 ExitDlg

添加以下代码来禁止退出对话框就足够了。您无需复制对话框。

        <InstallUISequence>
            <Show Dialog="ExitDialog" OnExit="success">0</Show>
        </InstallUISequence>
        <AdminUISequence>
            <Show Dialog="ExitDialog" OnExit="success">0</Show>
        </AdminUISequence>

这样,您就可以覆盖从原始设计中发布的代码段中的相同声明,条件永远不会满足 (0)。