Using WIX I cannot seem to get my variables to work - any ideas?
I'm using: WIX version 3.5 and Visual Studio 2010
Here is the error I am getting ( This is the output from visual studio ):
------ Build started: Project: InstallProject, Configuration: Debug x86 ------ "C:\Program Files\Windows Installer XML v3.5\bin\heat.exe" dir "c:\publish\ems" -cg EMSPublishedFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var env.EMS_PUBLISHDIR -out "C:\Projects\ems\Trunk\Code\Installer\InstallProject\Fragments\FilesFragment.wxs" Microsoft (R) Windows Installer Xml Toolset Harvester version 3.5.2519.0 Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files\Windows Installer XML v3.5\bin\candle.exe -dEMS_PUBLISHDIR=c:\publish\ems -dDebug -d"DevEnvDir=C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\" -dSolutionDir=C:\Projects\ems\Trunk\Code\Installer\ -dSolutionExt=.sln -dSolutionFileName=InstallProject.sln -dSolutionName=InstallProject -dSolutionPath=C:\Projects\ems\Trunk\Code\Installer\InstallProject.sln -dConfiguration=Debug -dOutDir=Packages\ -dPlatform=x86 -dProjectDir=C:\Projects\ems\Trunk\Code\Installer\InstallProject\ -dProjectExt=.wixproj -dProjectFileName=InstallProject.wixproj -dProjectName=InstallProject -dProjectPath=C:\Projects\ems\Trunk\Code\Installer\InstallProject\InstallProject.wixproj -dTargetDir=C:\Projects\ems\Trunk\Code\Installer\InstallProject\Packages\ -dTargetExt=.msi -dTargetFileName=EMSSetup.msi -dTargetName=EMSSetup -dTargetPath=C:\Projects\ems\Trunk\Code\Installer\InstallProject\Packages\EMSSetup.msi -out obj\Debug\Fragments\ -arch x86 -ext "C:\Program Files\Windows Installer XML v3.5\bin\WixUtilExtension.dll" -ext "C:\Program Files\Windows Installer XML v3.5\bin\WixUIExtension.dll" -ext "C:\Program Files\Windows Installer XML v3.5\bin\WixSqlExtension.dll" -ext "C:\Program Files\Windows Installer XML v3.5\bin\WixIIsExtension.dll" Fragments\FilesFragment.wxs
C:\Projects\ems\Trunk\Code\Installer\InstallProject\Fragments\FilesFragment.wxs(6,0): error CNDL0150: Undefined preprocessor variable '$(env.EMS_PUBLISHDIR)'.
Its also worth noting that even though I have defined variables in Visual studios project properties : Proceessor variables ( EMS_PUBLISHDIR=c:\publish\ems; ) if I put the variable name in the project prebuild event $(EMS_PUBLISHDIR) I get an empty string. I checked the project file directory using notepad and the declations for debug / release etc all look ok.
Any ideas?