Table of Contents

Wix (Windows Installer XML Toolset)

About

Wix (Windows Installer XML Toolset) is:

Jpackage used it to generate their installer on Windows.

The below section are juste note from the tutorial

Advantages / Disadvantage

Advantage:

Disadvantage:

Syntax of the Wsx XML file

Node id

Version

For the Version attribute, use the standard major.minor.build format. Windows Installer will ignore an eventual fourth field, .revision as it provides other means to differentiate revisions.

Component

The component is the atomic unit of things to be installed.

It consists of resources—files, registry keys, shortcuts, or anything else—that should always be installed as a single unit.

A component should only contain items that belong together so strongly that they always need to be installed or removed together.

Generally, most single file will go into one component.

Each component needs:

Heat

Because there is no way to declaratively, adding a directory and its children, Wix comes with the heat tool (tuto)

To create a Fragment

heat dir path\to\your\directory -gg -cg SampleGroup -out SampleGroup.wxs

where:

Add it into your main wsx file

<Feature Id='Complete' Level='1'>
      <ComponentGroupRef  Id='SampleGroup'/>
</Feature>

Directory Node

The directory node describe the hierarchical structure of the target folder structure created and links the target source to the source file.

Target Folder can be by set by name (one of predefined name) in place of a full path such as:

According to established guidelines, installed files go into predetermined locations. For instance, applications should go under \Program Files\Company\Product

Shortcut

Shortcuts can be non-advertised (a simple link pointing to the file in the shortcut's Properties dialog) or advertised (with the link greyed out). This second form lets Windows Installer repair the installation by replacing any missing file the shortcut points to.

Management

Installer generation

candle.exe SampleFirst.wxs.xml
light.exe SampleFirst.wixobj

Testing

Action that you can perform while testing the generated installer.

Log

When testing the installer, you can generate a log

msiexec /i installer.msi /l* installer.log
REM more verbose
msiexec /i installer.msi /l*v installer.log

Removing the application

uninstall

msiexec /x installer.msi

Tools

Documentation / Reference