I am a student developer and I have built several installers for the company I am working with now. So I am fairly familiar with WIX. We recently decided to have a Build server
The reason it's not working for you is that you are setting msbuild properties on the command line, which are not getting passed through as wix variables. MSBuild properties and wix variables are two different concepts.
One way to fix this is to ignore the concept of msbuild properties and use environment variables to pass values directly to candle.exe
. You can use environment variables in your wxs file like this:
$(env.SpecialPath)
You can then launch your setup build from a batch file which prepares the necessary environment variables like this:
@echo off
setlocal
set SpecialPath=foo
set Configuration=Release
set msbuild=C:\windows\Microsoft.NET\Framework\v3.5\MSBuild.exe
%msbuild% test.wixproj /t:Build || goto ERROR
exit /b 0
:ERROR
echo Failed to build setup!
exit /b 1
Alternatively, if you prefer to pass parameters via msbuild properties, you should first take a look at the msbuild candle task documentation. It shows you can set values in your wixproj file like this:
Variable1=value1;Variable2=value2
This still requires you to hardcode values in the wixproj file though. If you want to pass the values as msbuild properties on the command line, then you should probably do something like this:
Variable1=$(value1);Variable2=$(value2)
and then pass /p:value1=foo /p:value2=bar
on the command line, or define these msbuild properties elsewhere.