Not sure. Looks to me like it should work. Which build of the toolset are you using?
Another option that may work is DefineConstants (drop the "-d" prefix): <DefineConstants>AdapterFolder=E:\projects\Adapter</DefineConstants> -----Original Message----- From: Chris Buchanan [mailto:bucktro...@googlemail.com] Sent: Friday, October 02, 2009 8:34 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] Building wixproj with MSBuild, preprocessor variable undefined Hi there, I'm having some problems trying to build a WIX project from another application using Microsoft.Build.BuildEngine.Project. The WIX project builds fine from within Visual Studio and produces my msi. If I look into my .wixproj file, I can see the CompilerAdditionalOptions and the preprocessor variables I've defined: <CompilerAdditionalOptions>-dAdapterFolder=E:\projects\Adapter</CompilerAddi tionalOptions > However the build fails with: "Undefined preprocessor variable $(var.AdapterFolder)". If I look at the call to Candle in my build log, the AdapterFolder variable isn't being passed: C:\Program Files\Windows Installer XML v3\bin\candle.exe -d"DevEnvDir=*Undefined if not building from within Visual Studio*" -dSolutionDir=E:\Projects\Installer\ -dSolutionExt=.sln -dSolutionFileName=Installer.sln -dSolutionName=Installer -dSolutionPath=E:\Projects\Installer\Installer.sln -dConfiguration=Release -dOutDir=bin\Release\ -dPlatform=x86 -dProjectDir=E:\Projects\Installer\ -dProjectExt=.wixproj -dProjectFileName=Installer.wixproj -dProjectName=Installer -dProjectPath=E:\Projects\Installer\Installer.wixproj -dTargetDir=E:\Projects\Installer\bin\Release\ -dTargetExt=.msi -d"TargetFileName=Product v2.0.msi" -d"TargetName=Product v2.0" -d"TargetPath=E:\Projects\Installer\bin\Release\Product v2.0.msi" -out obj\Release\Adapter.wixobj -arch x86 -ext "C:\Program Files\Windows Installer XML v3\bin\WixNetFxExtension.dll" -ext "C:\Program Files\Windows Installer XML v3\bin\WixUtilExtension.dll" -ext "C:\Program Files\Windows Installer XML v3\bin\WixUIExtension.dll" -ext "C:\Program Files\Windows Installer XML v3\bin\WixIIsExtension.dll" Adapter.wxs Does anyone know how to pass the compiler additional options to Candle? Or have I missed something else? Thanks, Chris. ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users