Using WiX extensions

The WiX extensions can be used both on the command line and within the Visual Studio IDE. When you use WiX extensions in the Visual Studio IDE, you can also enable IntelliSense for each WiX extension.

Using WiX extensions on the command line

To use a WiX extension when calling the WiX tools directly, you need to use the -ext command line parameter available in the Candle, Light and Lit tools and pass in the extension DLL(s) needed for your project. Each extension DLL must be passed in via separate -ext parameters. For example:

light.exe MySetup.wixobj
-ext "c:\Program Files\Windows Installer XML v3\bin\WixUIExtension.dll"
-ext "c:\Program Files\Windows Installer XML v3\bin\WixUtilExtension.dll"
-out MySetup.msi

Using WiX extensions in Visual Studio

To use a WiX extension when building in Visual Studio with the WiX Visual Studio package:

  1. Right-click on the WiX project in the Visual Studio solution explorer and select Add Reference...
  2. In the Add WiX Library Reference dialog, click on the Browse tab and browse to the WiX extension DLL that you want to include.
  3. Click the Add button to add a reference to the chosen extension DLL.
  4. Browse and add other extension DLLs as needed.

Enabling IntelliSense for WiX extensions

To enable IntelliSense for a WiX extension in the Visual Studio IDE, you need to add an XMLNS declaration to the <Wix> element in your .wxs file. For example, if you want to use the NativeImage functionality in the WixNetFxExtension, the <Wix> element would look like the following:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"> 

After adding this, you can add an element named <netfx:NativeImage/> and view IntelliSense for the attributes supported by the NativeImage element.