简体   繁体   English

Wix-Wix安装程序的条件GUI对话框

[英]Wix- Conditional GUI Dialog for Wix installer

I have a customize GUI as below: 我有一个自定义的GUI,如下所示:

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

      <!-- This is the welcome dialog you specified-->
      <DialogRef Id="WelcomeDlg" />
      <!-- Hook the new welcome dialog to the next one in the stack-->
      <Dialog Id="DemoDatabaseDlg"  Width="370" Height="270" Title="Configutation settings" NoMinimize="yes">

        <Control Id="QueryServiceLabel" Type="Text" X="45" Y="73" Width="220" Height="15" TabSkip="no" Text="QueryService Value" />
        <Control Id="QueryServiceNameEdit" Type="Edit" X="45" Y="85" Width="220" Height="18" Property="QUERYSERVICEVALUE" Text="{80}" />
        <Control Id="IFinderLabel" Type="Text" X="45" Y="105" Width="100" Height="15" TabSkip="no" Text="&amp;IFinder Value" />
        <Control Id="IFinderEdit" Type="Edit" X="45" Y="117" Width="220" Height="18" Property="IFINDERVALUE" Text="{80}" />
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="Back"></Control>
     <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next"></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>
      </Dialog>

      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="DemoDatabaseDlg">1</Publish>
    <Publish Dialog="DemoDatabaseDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg"><![CDATA[Version < "0.8.0.0"]]></Publish>
    <Publish Dialog="DemoDatabaseDlg" Control="Next" Event="NewDialog" Value="PrepareDlg">1</Publish> -->
      <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>


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

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

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

I am trying to make DemoDatabaseDlg Dialog conditional , so if it is the first time the user is installing the installer then " DemoDatabaseDlg " should be display if not Skip this dialog and jump to the next one. 我正在尝试使DemoDatabaseDlg对话框成为条件 ,因此,如果这是用户首次安装安装程序,则应显示“ DemoDatabaseDlg ”(如果没有),请跳过此对话框并跳至下一个对话框。 I was thinking to make this condition by checking the installer version , so if it is the version 1.0 and above (Version > 1.0) then skip the Dialog. 我当时想通过检查安装程序版本来实现此条件,因此,如果它是1.0及更高版本(版本> 1.0),请跳过该对话框。 Do you think this is a doable idea? 您认为这是一个可行的主意吗? any hints or suggestions are very welcome. 任何提示或建议都非常欢迎。

Wix Control element can have child elements Condition and Publish. Wix Control元素可以具有条件和发布子元素。 Use them to create your logic. 使用它们来创建您的逻辑。 You can also define separate Publish elements to trigger events conditionally, just like in your example. 您也可以定义单独的Publish元素以有条件地触发事件,就像您的示例一样。

Your answer is in the Publish -element Control , Event and Value attributes. 您的答案在Publish -element ControlEventValue属性中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM