Windows Installer Tutorial (1/2)
Microsoft Windows Installer is a component of the Windows operating system. It provides a standard foundation for installing and uninstalling software. Open-source and commercial tools to create Windows Installer packages are available. One of the tools is the WiX Toolset  for which we provide a tutorial.
It would be unusual to create a Windows Installer package without the help of one of the higher-level tools so this tutorial focuses on what you need to know about the Windows Installer to understand what is going on under the hood. Hopefully this will help using the tools more efficiently and help troubleshoot installation packages.
Microsoft provides a tool to look at the contents of package: Orca . We will make use of this tool throughout the tutorial.
Orca is available as part of the Windows SDK that you can download from http://www.microsoft.com/en-us/download/details.aspx?id=8279. However if you are only interested in Orca you can also follow the following procedure  to get the Orca installation package:
- Using for instance 7-zip , extract the files from
- In the extracted files locate the
Setup\WinSDKTools\cab1.cabfile and extract its contents.
- In the newly extracted files locate the
WinSDK_Orca_Msi_5E20C107_DAA3_4D49_AFAE_7FB2594F0CDC_x86file and add a
.msiextension to it. This is the Orca installation package and you can now install it as any other package.
After installation Orca is available in the Start menu.
A Windows Installer package is actually a file containing a relational database. The framework expects a series of predefined tables to be present in that database.
To show the tables in the database we will use the simple example we created in this WiX tutorial, SingleFileInstallation1, which simply installs a single file. You don't need to build the example, you can simply download the MSI file from here (make sure you save the file rather than execute it).
We can open the
SingleFileInstallation1.msi with Orca. The result in Orca is shown on Figure 1.
|Figure 1: SingleFileInstallation1.msi in Orca|
On the left-hand side you can see the list of tables that are present in
Windows Installer groups files to be installed together in
features. Simple packages will contain a single feature
but more complex packages can contain more and let the user choose which one they want to install. Features are further
subdivided into components. These components then contain the files to be installed. The
WiX tutorial shows a concrete example of this hierarchy.
SingleFileInstallation1.msi with Orca (see Figure 1 above), we can see the 4 tables that implement this organization:
Feature, FeatureComponents, Component, and File. In the
SingleFileInstallation1.msi case there is one feature, MainProduct, containing
one component, HelloWorldComponent, which in turn contains one file, HelloWorld.
The Feature table
The Feature table  contains one feature: MainProduct. Figure 2 shows this table in Orca.
|Figure 2: The Feature Table|
The FeatureComponents table
The FeatureComponents table  associates features with their components. In Figure 3 you can see how the MainProduct feature and the HelloWorldComponent component are associated together.
|Figure 3: The FeatureComponents Table|
The Component table
The Component table  lists the various component. It doesn't list the contents of these components, the File table does that. It does however indicate in which directory the component should be installed. In Figure 4 you can see the HelloWorldComponent.
|Figure 4: The Component Table|
The File table
The File table  lists the files to be installed and the components they belong to. Figure 5 shows the HelloWorld file and how it is associated with the HelloWorldComponent component.
|Figure 5: The File Table|
- WiX Toolset
- MSDN: Orca.exe
- How to install Orca.exe from the Windows Installer Development Tools
- MSDN: Feature Table
- MSDN: FeatureComponents Table
- MSDN: Component Table
- MSDN: File Table
blog comments powered by Disqus