Yes, you first need to pass the MSBuild property to the compiler's preprocessor. In your .wixproj use the DefineConstants
property to tunnel the property through. The default .wixproj provided by Votive does this by default for Configuration
but for other properties it'd look like this:
<PropertyGroup>
<DefineConstants>$(DefineConstants);MyNewVariable=$(MSBuildPropertyName)</DefineConstants>
</PropertyGroup>
Now that the MSBuild Property is a preprocessor variable you can do the following:
<?if $(var.Configuration)="Release" ?>
Stuff to conditionally compile out
<?endif?>
Basically, your example above is correct except you're missing the var.
part of the preprocessor variable name. More details on the preprocessor syntax in the documentation.