Doc
Doc

Reputation: 708

Preprocessor variables in VS2017

I'm trying to create a new WiX project with Visual Studio 2017 and I'm having a hard time creating a preprocessor variable $(var.buildSrc). In VS 2015 I just went into the project properties and selected the Build tab and created it under "Define preprocessor variables:".

In VS 2017 when I go to properties from my WiX solution all I have available are Project File and Project Folder.

I tried manually adding this into the text of the .wixproj file, but when I try to build the project it still says it can't find my variable. Undefined preprocessor variable '$(var.buildSrc)

The relevant WiX code looks like

<File Id=someUniqueID KeyPath=Yes Source="$(var.buildSrc)\somefilename.exe" Guid=someGuid>

I'm using WiX 3.11.0.1528 and Rob's WiX tool extension for VS2017.

Upvotes: 1

Views: 1447

Answers (1)

Robert Wagenaar
Robert Wagenaar

Reputation: 179

you can just add it to your main .wxs file, just add the definition of the variable right below the <wix> tag:

  <?define buildSrc= "c:\mydir?" ?>

Upvotes: 1

Related Questions