Wix - Use WixVariables on .wixproj

2019-07-10 15:57发布

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;[...]

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-07-10 16:41

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.

查看更多
登录 后发表回答