O'Reilly logo

WiX: 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

Compile-time variables

WiX lets you specify variables that are evaluated at compile time. You might use this to get environmental variables from the build machine, get the directory where your source files are, or access custom variables you've set up in a separate WiX include file (.wxi).

WiX has three classifications for preprocessor variables: Environment, System, and Custom. We'll discuss each in the following sections.

Environment variables

Environment variables are set in the environment where the build process is running, usually from the command prompt. The following command sets an environment variable called myVar to the value myvalue:

set myVar=myvalue

To pass this to your project, build your .wxs files from the same command window using ...

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