3

i'm on Visual Studio 2012 and i use wix

I wanted to use a WixVariables or a DefineConstants on Target After build (wixproj) when i unload the project

i used on

<DefineConstants>VersionNodeServer=0.0.1;</DefineConstants>

Or

<WixVariables>VersionNodeServer=0.0.1;</WixVariables>

but when i used this variable 'VersionNodeServer' like that

<Target Name="AfterBuild">
<WebDownload FileName="test.msm" FileUri="$(VersionNodeServer)"/>

the build failed because FileUri is empty.

i saw my variable on the VS console ..

C:\Program Files\WiX Toolset v3.10\bin\candle.exe -dDebug -dVersionNodeServer=0.0.1;[...]

Julien Baldy
  • 397
  • 2
  • 4
  • 14

1 Answers1

3

Neither <DefineConstants> nor <WixVariable> define a variable for MSBUILD. You have to put

 <PropertyGroup>
    <VersionNodeServer>0.1.1</VersionNodeServer>
 </PropertyGroup>

somewhere in your .wixproj file.

Stephen Reindl
  • 5,659
  • 2
  • 34
  • 38
  • 1
    ooo :(, ok i wanted tu use a dynamic variable into msbuild, with candle... thx for this anwser ! – Julien Baldy Sep 15 '16 at 12:05
  • 1
    Dynamic variables / properties together with MSBUILD is not that simple. Properties are created as one of the first steps inside MSBUILD but you might create a task that creates the properties which is a precondition for AfterBuild – Stephen Reindl Sep 15 '16 at 12:08