Developing WiX Extensions
Common Requirements
In order to understand how each of the classes of extensions work, one should start by looking at the WiX source code. All classes of extensions have the following things in common:
- Implemented using the .NET Framework 2.0. The rest of the WiX toolset currently only depends on the .NET Framework 2.0, so in order to ensure backwards compatibility, it is a best practice to develop new extensions so that they only depend on the .NET Framework 2.0 as well.
- Build a subclass of the appropriate extension object, which gives it an easily distinguishable name.
- Build a schema of the appropriate syntax to provide validation checking where possible.
- Build internal table definitions and register them with the compiler.
- Build overrides for extensible methods and virtual members which will get invoked at the approriate location during the single pass compile.
- Build extension into a DLL.
- Place extension DLL next to WiX EXEs.
- Registered with WiX via a command line argument to the compiler.
Considerations
Before investing in an extension, one should evaluate whether an external tool and the ?include syntax (from the preprocessor) will provide the needed flexibility for your technical needs.
Multiple extensions and extension types are supported, but there is no guarantee of the order in which a particular class of extensions will be processed. As a result, there must not be any sequencing dependencies between extensions within the same extension class.