Wix - Use WixVariables on .wixproj

丶灬走出姿态 提交于 2020-01-15 01:52:52

问题


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:


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.



来源:https://stackoverflow.com/questions/39508002/wix-use-wixvariables-on-wixproj

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!