我有一个自定义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="&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>
我正在尝试将 DemoDatabaseDlg 对话条件,所以如果这是用户第一次安装安装程序,那么“ DemoDatabaseDlg ”应显示如果没有跳过此对话框并跳转到下一个对话框。 我想通过检查安装程序版本来创建此条件,因此如果它是版本1.0及更高版本(版本&gt; 1.0),则跳过对话框。 你认为这是一个可行的想法吗?任何提示或建议都非常受欢迎。
答案 0 :(得分:1)
Wix Control element可以包含子元素条件和发布。用它们来创建你的逻辑。您还可以定义单独的Publish元素以有条件地触发事件,就像在您的示例中一样。
您的答案位于Publish
- 元素Control
,Event
和Value
属性中。