WIX - 添加自定义对话框,后退/下一步按钮有问题

时间:2012-09-24 19:22:53

标签: wix

我正在创建一个自定义的WixUi配置,这是我到目前为止所做的:

将WixUI_Minimal.wxs文件复制到我的项目中,并将Id更改为:WixUI_CustomMinimal 将WelcomeEulaDlg.wxs文件复制到我的项目中并将Id更改为:CustomWelcomeEulaDlg 将WelcomeDlg.wxs文件复制到我的项目中,并将Id更改为:CustomWelcomeDlg 将InstallTypeDlg.wxs添加到我的项目

修改CustomWelcomeEulaDlg以将“安装”按钮更改为下一个按钮。 修改WixUI_CustomMinimal以使WelcomeEulaDlg上的Next / NextNoShield按钮打开InstallTypeDlg对话框

将InstallTypeDlg对话框添加到InstallUiSequence。

所以现在问题是:我正在尝试在InstallTypeDlg上设置一个后退按钮,这是有效的,但是在按下后退按钮然后按下CustomWelcomeEulaDlg上的下一个按钮时,将跳过InstallTypeDlg并直接进行安装。

以下是我的文件:

WixUI_CustomMinimal

<?xml version="1.0" encoding="UTF-8"?>
<!--
  <copyright file="WixUI_Minimal.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>
-->

<!--
First-time install dialog sequence:
 - WixUI_WelcomeEulaDlg

Maintenance dialog sequence:
 WixUI_MaintenanceWelcomeDlg
 - WixUI_MaintenanceTypeDlg
 - WixUI_VerifyReadyDlg

Patch dialog sequence:
 - WixUI_WelcomeDlg
 - WixUI_VerifyReadyDlg
-->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI Id="WixUI_CustomMinimal">
          <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="Minimal" />

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


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

            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>

            <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">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>

            <Publish Dialog="CustomWelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeDlg" Order="2">Installed AND PATCH</Publish>

            <Publish Dialog="CustomWelcomeEulaDlg" Control="Next" Event="NewDialog" Value="InstallTypeDlg">Installed AND PATCH</Publish>
            <Publish Dialog="CustomWelcomeEulaDlg" Control="NextNoShield" Event="NewDialog" Value="InstallTypeDlg">Installed AND PATCH</Publish>

            <Publish Dialog="InstallTypeDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeEulaDlg" Order="2">Installed AND PATCH</Publish>

            <InstallUISequence>
                <Show Dialog="CustomWelcomeDlg" Before="CustomWelcomeEulaDlg">Installed AND PATCH</Show>
                <Show Dialog="CustomWelcomeEulaDlg" Before="InstallTypeDlg">NOT Installed</Show>
                <Show Dialog="InstallTypeDlg" Before="ProgressDlg">NOT Installed</Show>
            </InstallUISequence>

            <Property Id="ARPNOMODIFY" Value="1" />
        </UI>

        <UIRef Id="WixUI_Common" />
    </Fragment>
</Wix>

CustomWelcomeEulaDlg

<?xml version="1.0" encoding="UTF-8"?>
<!--
  <copyright file="WelcomeEulaDlg.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="CustomWelcomeEulaDlg" Width="370" Height="270" Title="!(loc.WelcomeEulaDlg_Title)">
                <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeEulaDlgBitmap)" />
                <Control Id="Title" Type="Text" X="130" Y="6" Width="225" Height="30" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeEulaDlgTitle)" />
                <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
                <Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="130" Y="207" Width="226" Height="18" CheckBoxValue="1" Property="LicenseAccepted" Text="!(loc.WelcomeEulaDlgLicenseAcceptedCheckBox)" />
                <Control Id="Print" Type="PushButton" X="88" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
                    <Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
                </Control>
                <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
                <Control Id="Next" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Next" Hidden="yes">
                    <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
                    <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
                    <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
                    <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                    <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                    <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>

                    <Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition>
                    <Condition Action="enable">LicenseAccepted = "1"</Condition>
                    <Condition Action="show">ALLUSERS</Condition>
                </Control>
                <Control Id="NextNoShield" Type="PushButton" ElevationShield="no" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Next" Hidden="yes">
                    <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
                    <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
                    <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
                    <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                    <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                    <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>

                    <Condition Action="disable"><![CDATA[LicenseAccepted <> "1"]]></Condition>
                    <Condition Action="enable">LicenseAccepted = "1"</Condition>
                    <Condition Action="show">NOT ALLUSERS</Condition>
                </Control>
                <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
                    <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
                </Control>
                <Control Id="LicenseText" Type="ScrollableText" X="130" Y="36" Width="226" Height="162" Sunken="yes" TabSkip="no">
                    <Text SourceFile="!(wix.WixUILicenseRtf)" />
                </Control>
            </Dialog>
        </UI>

        <InstallUISequence>
            <Show Dialog="CustomWelcomeEulaDlg" Before="ProgressDlg" Overridable="yes">NOT Installed</Show>
        </InstallUISequence>
    </Fragment>
</Wix>

InstallTypeDlg

<?xml version="1.0" encoding="UTF-8"?>
<!--
  <copyright file="WelcomeEulaDlg.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>
          <Property Id="INSTALLTYPE" Value="Null"/>
            <Dialog Id="InstallTypeDlg" Width="370" Height="270" Title="!(loc.WelcomeEulaDlg_Title)">

                <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeEulaDlgBitmap)" />
                <Control Id="Title" Type="Text" X="130" Y="6" Width="225" Height="30" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeEulaDlgTitle)" />
                <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
                <Control Id="Print" Type="PushButton" X="88" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
                    <Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
                </Control>
                <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
                <Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Install" Hidden="yes">
                    <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
                    <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
                    <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
                    <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                    <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                    <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
                    <Publish Event="AddLocal" Value="ServiceFeature"><![CDATA[INSTALLTYPE = "SERVICE"]]></Publish>
                    <Publish Event="Remove" Value="ServiceFeature"><![CDATA[INSTALLTYPE <> "SERVICE"]]></Publish>
                    <Condition Action="disable">INSTALLTYPE = "Null"</Condition>
                    <Condition Action="enable"><![CDATA[INSTALLTYPE <> "Null"]]></Condition>
                    <Condition Action="show">ALLUSERS</Condition>
                </Control>
                <Control Id="InstallNoShield" Type="PushButton" ElevationShield="no" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Install" Hidden="yes">
                    <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
                    <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
                    <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
                    <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                    <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
                    <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
                    <Publish Event="AddLocal" Value="ServiceFeature"><![CDATA[INSTALLTYPE = "SERVICE"]]></Publish>
                    <Publish Event="Remove" Value="ServiceFeature"><![CDATA[INSTALLTYPE <> "SERVICE"]]></Publish> 
                    <Condition Action="disable">INSTALLTYPE = "Null"</Condition>
                    <Condition Action="enable"><![CDATA[INSTALLTYPE <> "Null"]]></Condition>
                    <Condition Action="show">NOT ALLUSERS</Condition>
                </Control>
                <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
                    <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
                </Control>
                <Control Id="FeatureGroup" Property="INSTALLTYPE" Type="RadioButtonGroup" Default="no" X="130" Y="36" Width="226" Height="162">
                  <RadioButtonGroup Property="INSTALLTYPE">
                    <RadioButton Text="Console" Height="17" Value="CONSOLE" Width="150" X="20" Y="0" />
                    <RadioButton Text="Windows Service" Height="17" Value="SERVICE" Width="150" X="20" Y="25" />
                    <RadioButton Value="Null" X="0" Y="0" Width="0" Height="0" Text="Null" />
                  </RadioButtonGroup>
                </Control>
            </Dialog>
        </UI>

        <InstallUISequence>
            <Show Dialog="InstallTypeDlg" Before="ProgressDlg" Overridable="yes">NOT Installed</Show>
        </InstallUISequence>
    </Fragment>
</Wix>

1 个答案:

答案 0 :(得分:3)

第一个问题出在InstallUISequence。你应该使用:

<Show Dialog="CustomWelcomeDlg" Before="CustomWelcomeEulaDlg">
    Installed AND PATCH
</Show>
<Show Dialog="CustomWelcomeEulaDlg" Before="ProgressDlg">
    NOT Installed
</Show>

在CustomWelcomeEulaDlg中,后退和下一步按钮应如下所示:

<Control Id="Back" Type="PushButton" X="156" Y="243"
         Width="56" Height="17" Disabled="yes" Text="Back" />

<Control Id="Next" Type="PushButton" ElevationShield="yes"
         X="212" Y="243" Width="80" Height="17" Default="yes"
         Text="Next" Hidden="yes">
    <Publish Event="NewDialog" Value="InstallTypeDlg">1</Publish>
</Control>

在InstallTypeDlg中,后退和安装按钮应与此类似:

<Control Id="Back" Type="PushButton" X="156" Y="243" Width="56"
         Height="17" Disabled="yes" Text="Back">
    <Publish Event="NewDialog" Value="CustomWelcomeEulaDlg">1</Publish>
</Control>

<Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243"
         Width="80" Height="17" Default="yes" Text="Install" Hidden="yes">
    <Publish Event="EndDialog" Value="Return" />
</Control>