WiX: Windows Installer XML

WiX provides a declarative approach to creating a Windows installer package (a/k/a a setup program).

Creating a WiX Installer With Visual Studio

After installing WiX there will be a new project type category in Visual Studio’s FileAddNew Project dialog box. Try using this command on one of your existing Visual Studio solutions for which you would like to create a WiX-based installer for. Highlight the WiX project type and then create a project using the template WiX Project. The WiX Project template is analogous to creating an installer project using the standard Visual Studio Setup Project template.

The project you just created will have one file in it named Product.wxs. This is the XML file that describes your solution’s installer steps. The project also has a set of property pages which describe various aspects of the project. The property pages has five tabs:

    • Installer

    • Build

    • Build Events

    • Paths

    • Tool Settings

Modify the Product.wxs File

In the Product element, change the Version attribute to have only the major, minor, and build version numbers (the forth—the revision number—is handled specially by Windows Installer). So you might set this attribute to 1.2.0.

Change the Manufacturer attribute to your company name or whatever you would like to use.

Change the Name attribute to something meaningful for your solution.

I also like to add the following attribute to the Product element so that I can use accented characters in my strings:

Codepage="1252"

See also WixEdit tool for a GUI to edit wxs files.

References

    1. WiX Toolset.

    2. WiX Tutorial—This is a very comprehensive tutorial written by Gábor Deák Jahn of the Hungarian company Tramontána.