WiX extensions are used to extend and customize what WiX builds and how it builds it.
The first step in creating a WiX extension is to create a class that extends the WixExtension class. This class will be the container for all the extensions you plan on implementing. This can be done by using the following steps:
using Microsoft.Tools.WindowsInstallerXml;
public class SampleWixExtension : WixExtension {}
[assembly: AssemblyDefaultWixExtension(typeof(SampleWixExtension.SampleWixExtension))]
Although this WiX extension will not do anything yet, you can now pass the newly built SampleWixExtension.dll on the command line to the Candle and Light by using the -ext flag like the following:
candle.exe Product.wxs -ext SampleWixExtension.dll light.exe Product.wxs -ext SampleWixExtension.dll
This covers the basics of creating the skeleton of an extension. You can now use this skeleton code to build your own custom action. After you are done, you can author the custom action in the WiX source code by following the Adding a Custom Action topic. You can also build your own extensions to the WiX toolset using this skeleton code. For an example of building an extension, see Creating a Preprocessor Extension.