WiX Tutorial (3/7)

Standard Dialog Sets

The installer we produced on page 1 didn't have a UI. Most Windows Installers display a nice UI during installation. WiX comes with a series of templates for UIs that can be used as-is in or customized. On this page we will show what each template does out of the box.

The following templates are available:

The Minimal UI: WixUI_Minimal

We will modify the SingleFileInstallation1 example to include a minimal UI. The minimal UI presents a dialog for the user to accept the license, a progress dialog and an "installation complete" dialog. The full example is available from our Codeplex repository at WiX/Basics/SingleFileInstallation2.

File: SingleFileInstallation2.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

    <Product Id="7A6EF4AB-07A6-4D56-9B60-B73C26735333" Name="SingleFileInstallation2" Language="1033" 
        Version="1.0.0.0" Manufacturer="Needful Software" UpgradeCode="70C3B1CE-0830-4834-BE8A-2660CE1B4CEA">

        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
        <MediaTemplate EmbedCab="yes" />

        <Feature Id="MainProduct" Title="Single File Installation 2" Level="1">
            <ComponentRef Id="HelloWorldComponent" />
        </Feature>

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="NeedfulSoftwareDir" Name="Needful Software">
                    <Directory Id="SingleFileInstallation2Dir" Name="Single File Installation 2">

                        <Component Id="HelloWorldComponent" Guid="16E22FA4-5E7D-4B54-BB3C-E27FA39AA7B0">
                            <File Id="HelloWorldFile" Source="HelloWorld.txt" KeyPath="yes" />
                        </Component>

                    </Directory>
                </Directory>
            </Directory>
        </Directory>

        <UIRef Id="WixUI_Minimal" />
        <WixVariable Id="WixUILicenseRtf" Value="mit.rtf" />
  
    </Product>

</Wix>
Command line
C:\WiX\Examples\SingleFileInstallation2>candle.exe SingleFileInstallation2.wxs
Windows Installer XML Toolset Compiler version 3.8.1128.0
Copyright (c) Outercurve Foundation. All rights reserved.

SingleFileInstallation2.wxs

C:\WiX\Examples\SingleFileInstallation2>light.exe SingleFileInstallation2.wixobj -ext WixUIExtension
Windows Installer XML Toolset Linker version 3.8.1128.0
Copyright (c) Outercurve Foundation. All rights reserved.


C:\WiX\Examples\SingleFileInstallation2>
There is a known bug related to the display of the license file. If the RTF file was generated by Microsoft Word and the license dialog content appears blank try saving the license file using Wordpad. Strangely enough this bug also only seems to occur when the license dialog is the first one to be displayed.

blog comments powered by Disqus

Copyright(c) 2006-2015 Xavier Leclercq | Privacy policy

Home
Contact Us
Search