2012-09-24 23 views
2

我上创建一个自定义WixUi配置工作,这里是我迄今所做的:WIX - 添加背部/下一个按键的自定义对话框有麻烦

复制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> 

回答

4

第一个问题是在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>