O'Reilly logo

WiX 3.6: A Developer's Guide to Windows Installer XML by Nick Ramirez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Preprocessor extensions

You can create your own variable prefixes (remember var, env, and sys?) and even call C# methods at compile time by writing a preprocessor extension. You'll need to make a new C# class library. We'll walk through each step and then look at the complete code afterwards.

Understand that a preprocessor extension is only executed during compilation to insert data into your WiX markup. So, the end user of your installer will never see it. Also, a preprocessor extension is different than extensions such as WixUIExtension, which are technically compiler extensions. We'll get to make a compiler extension later in the book.

First, in your new class library, add a reference to Wix.dll from the WiX bin directory, and add a using statement ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required