发布博文
随想
读书
音乐
其他
我想爱,想吃,还想在一瞬间变成天上半明半暗的云。
我想爱,想吃,还想在一瞬间变成天上半明半暗的云。
我想爱,想吃,还想在一瞬间变成天上半明半暗的云。
我想爱,想吃,还想在一瞬间变成天上半明半暗的云。

WiX Toolset - User interface and custom dialog

385
高光翔
2024-09-24 14:58

How to setup User Interface in WiX:

Add code below into <Product> node.

<Product>
   <UIRef Id="WixUI_FeatureTree" />
   <UIRef Id="WixUI_ErrorProgressText" />
</Product>

WixUI_FeatureTree is one of five different flavors in Wix, the other four are: "WixUI_Mondo", "WixUI_InstallDir", "WixUI_Minimal", "WixUI_Advanced", can see the differences here: UI Wizardry .

If you want to add custom dialog, can add code show as below:

<UIRef Id="MyInstallerUI" />
<Product>
   <UIRef Id="MyInstallerUI" />
</Product>
<Fragment>
   <UI Id="MyInstallerUI">
	<UIRef Id="WixUI_FeatureTree" />
	<UIRef Id="WixUI_ErrorProgressTe
	xt" />
        <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" 
        Value="LicenceServerSettingDlg"></Publish>	
   </UI>
</Fragment>
<Fragment>
   <UI>
	<Dialog Id="LicenceServerSettingDlg" Width="370" Height="270" 
	Title="[ProductName] Setup" NoMinimize="yes">
	
	   <Control Id="LicenceServerLabel" Type="Text" X="45" Y="73" 
	   Width="100" Height="15" TabSkip="no" Text="Licence Server Address:" />
           <Control Id="LicenceServerEdit" Type="Edit" X="45" Y="90" Width="220" 
           Height="18" Property="LICENCE_SERVER" ></Control>
        
	    <!-- Back button -->
	    <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" 
	    Height="17" Text="&amp;Back">
	       <Publish Event="NewDialog" Value="CustomizeDlg">1</Publish>
	    </Control>
	    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" 
	    Height="17" Default="yes" Text="&amp;Next">
	    	<Publish Event="NewDialog" Value="IisSetupDlg" Order="1">1</Publish>
	    </Control>
	    <Control Id="Cancel" Type="PushButton" X="304" Y="243" 
	    Width="56" Height="17" Cancel="yes" Text="Cancel">
	    	<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
	    </Control>
	</Dialog>
    </UI>
</Fragment>

Here is a custom dialog named "LicenceServerSettingDlg", "CustomizeDlg" is one of predefined dialogs of WiX, in the "CustomizeDlg", when click "Next" button, it will open my custom dialog "LicenceServerSettingDlg".

Items (1).png


Tip: How to know the built-in dialogs defined in WixUI dialog library.

Can check here: WixUI Dialogs 
If want to know more details about Wix UI, can download Wix3.6Toolset source code .


Insert title here Insert title here
打  赏