Automatic account creation is now enabled. Captcha authentication required for account creation and editing unless you are trusted here.

Introduction to WiX

From WiX Wiki at MindCapers

Jump to: navigation, search

Contents

History of Installers

XCopy

Cheap and cheerful, simple and fast with universal support.

Once upon a DOS prompt, xcopy deployment was the norm. Along came Windows, and application developers were encouraged to delegate management and storage of application settings to the Registry. Support files and version dependencies proliferated. Application deployment became a complex and tricky procedure.

This trend has reversed, to a great extent. The .NET framework solves the problem of conflicting support file version requirements by allowing cohabitation even at runtime, by dint of separate virtual machines. The .NET use of config files that reside in the application folder has obviated the need for registry settings.

So why do we need setup kits then, if xcopy is wonderful and possible?

  • Users need prompting
  • Some components may be optional
  • Prerequisites may need installation
  • Transactional installation
  • Xcopy can't connect to a database server and run creation or update scripts
  • Xcopy can't create menu or desktop shortcuts
  • Some registry entries are still used, eg HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

InstallShield

Not so cheap, and only cheerful when your project fits the mould. Has an embedded script engine making it possible to use scripts for custom actions without interference from antivirus software or hostile system configurations.

If we get excited and try to do anything that can't be expressed in script we end up using C++ to write a custom action. Once that happens we face exactly the same issues irrespective of which tool we use. So these expensive tools only shine in scenarios of novice to intermediate difficulty.

Wise

Exactly the same story as Installshield, on a slightly different timeline.

Bootstrappers

The applications and services delivered by an installation package may depend on other applications, services, COM objects, DLLs etc. These are known as prerequisites.

A bootstrapper is a native Windows application that checks whether these prerequisites are present on the target system in the required versions. The bootstrapper installs any prerequisites not already present, if necessary rebooting the computer before automatically resuming the setup process.

Once all prerequisites are met, the installation package is launched. (Note: Typically prerequisites should also be verified in the MSI file itself, since an advanced user may attempt to install the MSI file directly.)

Because requirements vary, it is useful to be able to select from a list of possible prerequisites and build a custom bootstrapper.

Windows Installer

An operating system is a life-support system for applications software. The domain of services regarded as basic has expanded steadily over the past few decades. Orderly management of the installation and removal of applications is one of the more recent additions to the services and resources that Windows now coordinates.

This is manifest in the form of the Windows Installer, which is essentially a script engine that runs MSI files defining transactional changes to the file system and registry.

From MSDN:

Beginning with Windows Installer 3.0, multiple patches can be installed with a single transaction that integrates installation progress, rollback, and reboots. The installer can apply patches in a constant order regardless of the order that the patches are provided to the system.

Patches installed with Windows Installer 3.0 or later can be uninstalled in any order to leave the state of the product the same as if the patch was never installed. Patching using Windows Installer 3.0 only updates files affected by the patch and can be significantly faster than earlier installer versions.

Accounts with administrator privileges can use Windows Installer 3.0 functions to query and inventory product, feature, component, and patch information; and to read, edit, and replace Installer source lists for network, URL, and media sources. Administrators can enumerate across user and install contexts, and manage source lists from an external process.

Installation packages and patches that are created for Windows Installer 2.0 can be installed by using Windows Installer 3.0.

Installation Packages

An installation package contains all of the information that the Windows Installer requires to install or uninstall an application or product, to produce the setup user interface and to validate user input.

Each installation package is expressed as an MSI file. This contains an installation database, a summary information stream, and data streams for various parts of the installation. It may also contain transforms, internal source files, and external source files or cabinet files.

Windows Installer installer organizes installations around the concept of components and features. All this information is stored inside an MSI file in what is essentially a relational database.

Merge modules

Package installation is transactional; if it aborts for any reason, all of the changes are reversed, leaving the system unchanged. You don't have to do anything special to achieve this, merely use the Windows Installer. Arguably, this is the whole point of using it.

The thing is that because transacations cannot be overlapped, you cannot nest the execution of installation packages. You might find this alarming, since the first thing any sensible person would do with a large and complex installation with optional parts is break it into a group of small simple installations that don't have optional parts.

You can't do it at run-time but you can do it at compile-time. Another kind of package is required, a merge module (MSM). Merge modules are basically simplified MSI files that cannot be installed alone. They are intended for linking (merging) into an installation package, using a merge tool such as Mergemod.dll.

Wix can both create and use merge modules.

Windows Installer XML

Windows Installer XML, also known as WiX, is an open source tool for creating .msi and .msm files for installation.

Personal tools