Wix Installation Deployment Tutorial (iii) Customizing the Installation Interface and behavior

Source: Internet
Author: User

Next to a custom installation interface, this article continues to explore, first of all, WiX defines five styles for us, each with a certain order of UI. We can change the installation order or fully customize a dialog insert. For example, the order of Wix_mondo style is as follows, but not necessarily every dialog will be displayed at the time of installation.

View Code

V. Changing the installation order of the UI interface

To do this step, we need to use the source of WiX, source download: Http://wix.codeplex.com/SourceControl/latest. Here I choose the interface style is Wixui_mondo, the source does not have to open all, direct search Wixui_mondo.wxs, find after directly throw to the VS can. We try to skip this step of the display license, which takes three steps:

1) Copy all the contents of fragment in the source code to a UI and a UIREF element in the product element

2) Delete Two Licenseagreementdlg related publish elements, Pubulish element defines the page up the previous step, the next steps. Event= "NewDialog" means open a dialog box, and value indicates the dialog ID that needs to be opened.

3) Then similarly change the Welcomedlg and the next step and Setuptypedlg the previous steps to point each other in value.

4) At this time two id= "Wixui_mondo, the <uiref id=" Wixui_mondo "/> In the previous UI are commented out.

Install again and the license page will no longer appear.

All of the code below, we can also note that the source text in the publish element is actually a conditional expression, 1 is executed, and OR. Not a installed and not patch means there is no installation or patching. Wait a minute

View Code

VI. Custom dialog

Custom interface, need to use the source code, this section, you can also refer to Sangam's blog http://blog.csdn.net/duanzilin/article/details/5956727

Find Wixui_mondo.wxs in the source folder, find a name with the Dlg Wxs file, throw in VS can see a dlg is what kind of structure. For example, Licenseagreementdlg.wxs source code is as follows

View Code

Control is a major element, equivalent to a control in vs.  But here is a general term, through type also decide whether this is a lable or a text (edit) type has Billboard, Bitmap, CheckBox, ComboBox, Directorycombo, Directorylist, Edit, GroupBox, Hyperlink, Icon, line, ListBox, ListView, MaskedEdit, Pathedit, ProgressBar, pushbutton, Ra Diobuttongroup, Scrollabletext, Selectiontree, text, volumecostlist, Volumeselectcombo, need to define type, position, size, text.

It takes two steps to customize a page to insert it in.

1. Create a new Wxs file, right-click to add New item and select Installer. The name of SPECIALDLG revision changed to

<?xml version= "1.0" encoding= "UTF-8"? ><wix xmlns= "Http://schemas.microsoft.com/wix/2006/wi" > < fragment> <UI> <dialog id= "Specialdlg" width= "370" height= "" title= "This is a special Dialog made B Y Rjstone "> <control id=" bannerbitmap "type=" Bitmap "x=" 0 "y=" 0 "width=" 370 "height=" "tabskip=" no "text=" ! (Loc.  Licenseagreementdlgbannerbitmap) "/> <control id=" bannerline "type=" line "x=" 0 "y=" "width=" 370 "Height=" 0 " /> <control id= "bottomline" type= "line" x= "0" y= "234" width= "370" height= "0"/> <control id= "De Scription "type=" Text "x=" "y=" "width=" 340 "height=" "transparent=" yes "noprefix=" yes "text="! (Loc. licenseagreementdlgdescription) "/> <control id=" Title "type=" Text "x=" "y=" 6 "width=" $ "height=" "Tran" Sparent= "yes" noprefix= "yes" text= "! (Loc. Licenseagreementdlgtitle) "/> <control id=" MyLabel "width=" + "height=" + "type=" Text "x=" "y=" and "text=" so GA "/> id= "Back" type= "pushbutton" x= "<control" y= "243" width= "" "height=" "text="! (Loc. Wixuiback) "/> <control id=" Next "type=" pushbutton "x=" 236 "y=" 243 "width=" "" height= "+" default= "yes" Text ="! (Loc. Wixuinext) "/> </Dialog> </UI> </Fragment> </Wix>

This is a simple dialog box, because unlike HTML or WPF, it does look a little "image" and the build looks like this. We can see where the line text title corresponds to each other.

Do not miss the following two buttons, or install to this is dumbfounded. This is just a simple page, but how do we add it to the installation directory, which requires a second step

2. Insert into the installation order, we will first restore the previous UI order, the Licenseagreementdlg restored to Welcomedlg, and then between the two insert the above Specialdlg. Modifying the Publish element in product

      <publish dialog= "Welcomedlg" control= "Next" event= "NewDialog" value= "Specialdlg" >not installed and not PATCH< /publish>      <publish dialog= "Welcomedlg" control= "Next" event= "NewDialog" value= "Verifyreadydlg" > Installed and patch</publish>       <publish dialog= "Specialdlg" control= "Back" event= "NewDialog" Value= " Welcomedlg ">1</Publish>      <publish dialog=" Specialdlg "control=" Next "event=" NewDialog "value=" Licenseagreementdlg ">1</Publish>      <publish dialog=" Licenseagreementdlg "control=" Back "event=" NewDialog "value=" Specialdlg ">1</Publish>      <publish dialog=" Licenseagreementdlg "control=" Next " Event= "NewDialog" value= "Setuptypedlg" order= "2" >licenseaccepted = "1" </Publish>

Of course, the need for a complex interface, but also the need to add custom behavior, such as let the user input re-detection, and call the DLL method, this write WiX can do.

Today on the custom interface is here, tomorrow continue.

Wix Installation Deployment Tutorial (iii) Customizing the Installation Interface and behavior

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.