With Votive 3.0.4318.0 and VS2005 (SP1), I am unable to specify the output directory of the *.msi file through the project property tabs. As a work-around, I added the following "Post-build Event Command Line":
copy /y $(TargetPath) $(SolutionDir)
Now when I press the "Build Solution" button in VS2005, the output window reports the following (see the "copy" command line):
C:\Program Files\WIXv3\bin\candle.exe -dDebug -d"DevEnvDir=Undefined if not building from within Visual Studio" -d"SolutionDir=Undefined if not building a solution or within Visual Studio" -d"SolutionExt=Undefined if not building a solution or within Visual Studio" -d"SolutionFileName=Undefined if not building a solution or within Visual Studio" -d"SolutionName=Undefined if not building a solution or within Visual Studio" -d"SolutionPath=Undefined if not building a solution or within Visual Studio" -dConfiguration=Debug -dOutDir=bin\Debug\ -dPlatform=x86 -dProjectDir=C:\IPDS\Dev\DI3_Installer\ -dProjectExt=.wixproj -dProjectFileName=IPDS_Installer.wixproj -dProjectName=IPDS_Installer -dProjectPath=C:\IPDS Dev\DI3_Installer\IPDS_Installer.wixproj -dTargetDir=C:\IPDS\Dev\DI3_Installer\bin\Debug\ -dTargetExt=.msi -dTargetFileName=IPDS_Installer.msi -dTargetName=IPDS_Installer -dTargetPath=C:\IPDS Dev\DI3_Installer\bin\Debug\IPDS_Installer.msi -out obj\Debug\Product.wixobj -arch x86 -ext "C:\Program Files\WIXv3\bin\WixNetFxExtension.dll" -ext "C:\Program Files\WIXv3\bin\WixUtilExtension.dll" Product.wxs
C:\Program Files\WIXv3\bin\Light.exe -ext "C:\Program Files\WIXv3\bin\WixNetFxExtension.dll" -ext "C:\Program Files\WIXv3\bin\WixUtilExtension.dll" -out C:\IPDS\Dev\DI3_Installer\bin\Debug\IPDS_Installer.msi -pdbout C:\IPDS\Dev\DI3_Installer\bin\Debug IPDS_Installer.wixpdb obj\Debug\Product.wixobj
copy /y C:\IPDS\Dev\DI3_Installer\bin\Debug IPDS_Installer.msi Undefined if not building a solution or within Visual Studio
The syntax of the command is incorrect.
C:\Program Files\MSBuild\Microsoft\WiX\v3.0\Wix.targets(1859,5)Error MSB3073: Done building project "IPDS_Installer.wixproj" -- FAILED.
Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
Why are so many of the macros defined as "Undefined if not building [a solution or] from within Visual Studio" when I am building a solution from within the VS2005 IDE ?
I initially suspected incorrect setup, but Votive is listed in the "Product details" section of the WiX entry of the VS2005's "Help / About MS VS ..." pop-up dialog that lists "Installed products". Here's the snippet I see ...
Windows Installer XML Version 3.0
Votive - Windows Installer XML (WiX) Toolset, Version 3.0.4318.0
Copyright (c) Microsoft Corporation. All rights reserved.
Justin Rockwood's response (Thu 20/11/08 14:31) to my wix-users posting indicated this is pobably a Votive bug ... hence this bug entry.
Please try the latest weekly release from http://wix.sourceforge.net/releases/. Several Votive bugs have been fixed since 4318 was released.
I have installed the latest weekly build (3.0.4714.0) and am getting the same error symptoms. However, a new initial warning is reported:
------ Build started: Project: IPDS_Installer, Configuration: Debug x86 ------
C:\Program Files\MSBuild\Microsoft\WiX\v3.0\Wix.targets(0,0): warning : Solution properties are only available during IDE builds or when building the solution file from the command line. To turn off this warning set <definesolutionproperties>false</definesolutionproperties> in your .wixproj file.
C:\Program Files\Windows Installer XML v3.0.4714.0\bin\candle.exe -dDebug -d"DevEnvDir=Undefined if not building from within Visual Studio" -d"SolutionDir=Undefined if not building a solution or within Visual Studio" -d"SolutionExt=Undefined if not building a solution or within Visual Studio" -d"SolutionFileName=Undefined if not building a solution or within Visual Studio" -d"SolutionName=Undefined if not building a solution or within Visual Studio" -d"SolutionPath=Undefined if not building a solution or within Visual Studio" -dConfiguration=Debug -dOutDir=bin\Debug\ -dPlatform=x86 -dProjectDir=C:\IPDS\Dev\DI3_Installer\ -dProjectExt=.wixproj -dProjectFileName=IPDS_Installer.wixproj -dProjectName=IPDS_Installer -dProjectPath=C:\IPDS\Dev\DI3_Installer\IPDS_Installer.wixproj -dTargetDir=C:\IPDS\Dev\DI3_Installer\bin\Debug\ -dTargetExt=.msi -dTargetFileName=IPDS_Installer.msi -dTargetName=IPDS_Installer -dTargetPath=C:\IPDS\Dev\DI3_Installer\bin\Debug\IPDS_Installer.msi -out obj\Debug\Product.wixobj -arch x86 -ext "C:\Program Files\Windows Installer XML v3.0.4714.0\bin\WixUIExtension.dll" -ext "C:\Program Files\Windows Installer XML v3.0.4714.0\bin\WixNetFxExtension.dll" -ext "C:\Program Files\Windows Installer XML v3.0.4714.0\bin\WixUtilExtension.dll" Product.wxs
C:\Program Files\Windows Installer XML v3.0.4714.0\bin\Light.exe -ext "C:\Program Files\Windows Installer XML v3.0.4714.0\bin\WixUIExtension.dll" -ext "C:\Program Files\Windows Installer XML v3.0.4714.0\bin\WixNetFxExtension.dll" -ext "C:\Program Files\Windows Installer XML v3.0.4714.0\bin\WixUtilExtension.dll" -out C:\IPDS\Dev\DI3_Installer\bin\Debug\IPDS_Installer.msi -pdbout C:\IPDS\Dev\DI3_Installer\bin\Debug\IPDS_Installer.wixpdb obj\Debug\Product.wixobj
copy /y C:\IPDS\Dev\DI3_Installer\bin\Debug\IPDS_Installer.msi Undefined if not building a solution or within Visual Studio
The syntax of the command is incorrect.
C:\Program Files\MSBuild\Microsoft\WiX\v3.0\Wix.targets(1962,5): error MSB3073: The command "copy /y C:\IPDS\Dev\DI3_Installer\bin\Debug\IPDS_Installer.msi Undefined if not building a solution or within Visual Studio" exited with code 1.
Done building project "IPDS_Installer.wixproj" -- FAILED.
Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
I have installed the latest weekly build (3.0.4813.0) and am getting the
same "Undefined if not building a solution or within Visual Studio" message
while building a solution within Visual Studio. Can you please check this?
Looks like a showstopper with my company build process: all is relative to
$(SolutionDir).
This is still a problem in 3.0.4327. The problem seems to be that "BuildingInsideVisualStudio" is not being set if you build with Visual Studio 2005.
My last comment should have said it is still a problem in 3.0.4827.
This is still an inssue in the latest weekly build (3.0.4930.0)
This happens in every WiX project I create through the "(right click Solution) -> Add -> New Project..." dialog in VS2005.
I have noticed that when you first create the project all the "solution variables" appear on the command line. If I exit VS2005 and reload the solution the "solution variables" now become undefined as reported in the other posts.
I also get the message "C:\Program Files\MSBuild\Microsoft\WiX\v3.0\Wix.targets(0,0): warning : Solution properties are only available during IDE builds or when building the solution file from the command line. To turn off this warning set <definesolutionproperties>false</definesolutionproperties> in your .wixproj file." when building from within VS2005.
I also think I have another issue related to this problem. If I add a reference to one of the C++ projects in my solution to the WiX project I get the message "C:\Program Files\MSBuild\Microsoft\WiX\v3.0\Wix.targets(929,5): error : MSBuild cannot resolve the reference to the Visual C++ project '..\MultiBulldog\MultiBulldog.vcproj' when building a stand-alone MSBuild project. To correctly resolve this reference, please build the solution file containing these projects." when building the solution or the WiX project.
All the issues seem to be with the WiX project assuming that it is being built outside of VS2005.
Hope these observations will assist in descovering the issue as I need to start using these preprocessor variables in my project.
I have made a discovery about this issue by editing the "C:\Program Files\MSBuild\Microsoft\WiX\v3.0\wix.target" file.
I added
<propertygroup>
<buildinginsidevisualstudio>true</buildinginsidevisualstudio>
<buildingsolutionfile>true</buildingsolutionfile>
</propertygroup>
at near start of the file, but this did not trick the system in building the project correcty, but the hack tricks the build into doing the "Built Inside Visual Studio" routine and fixes two problems. The referenced project no longer causes an error and the "C:\Program
Files\MSBuild\Microsoft\WiX\v3.0\Wix.targets(0,0): warning : Solution
properties are only available during IDE builds or when building the
solution file from the command line. To turn off this warning set
<definesolutionproperties>false</definesolutionproperties> in your .wixproj
file." message no longer appears.
The remaining problems are command line still has undefined solution variables, and the build does not add the referenced project's variables to the command line for candle.exe.
It looks like it is not just the "BuildingInsideVisualStudio" that is not being set, it is a whole load of other variables. The following section of the wix.target file shows a few.
<propertygroup>
<devenvdir condition=" '$(DevEnvDir)' == '' ">Undefined if not building from within Visual Studio</devenvdir></propertygroup>
Votive is obviously passing some of the variables correctly as they do appear on the command line, but not all of them.
Is this problem restricted to VS2005? Would upgrading to VS2008 fix the issues I am having?
Any ideas of a hack/workaround that could get it working? It all seems very close to working the way it should.
This is still a problem in 3.0.5027.0
Very easy to reproduce:
I have a similar problem to this - happens in VS2005 and VS2008 and the problem only manifested a month ago.
I have the following property in a wix project in my solution;
<project defaulttargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<propertygroup>
<jemstargetspath>$(SolutionDir)Jems.Common.Targets</jemstargetspath>
</propertygroup></project>
When I first modified this project file it had no problem resolving the solution directory when opening the solution however now it incorrectly resolves the SolutionDir. If the solution folder is supposed to be;
D:\Proj\SomeCustomer\Main\
then the folder being used is the project folder;
D:\Proj\SomeCustomer\Main\Wix\MySetup\
Worse still, if I try to correct this by adding ....\ to the reference to my custom target looks like this;
The target folder actually used becomes;
D:\Proj\
Which means that if I add the relative path segments the solution directory macro is CORRECT and if I remove the relative path segments then the macro is INCORRECT!
Very weird and a little frustrating!
This is still a problem in 3.0.5210.0
I agree - still a problem in 3.0.5210.0 and this problem occurs in VS2008 as well.
If I customise a wixproj project file such that I include a targets file that is located in the solution (and hence needs to be referenced with an import statement that uses the $(SolutionDir) macro - then project loading fails once modifications are made. So this is an issue that is independent of building (either inside or outside the IDE)
Finally using solution relative references should work with wixproj projects (IMHO) because it works for csproj projects :-)
The problem was that we were not defining solution properties in VS 2005. This was a regression from when we combined the MPF classes for VS 2005 and VS 2008. We #ifdef'd a piece of code that was responsible for defining these solution properties.
Seems fixed in 3.0.5224.0 : no more warnings and variables are set correctly.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 21 days (the time period specified by
the administrator of this Tracker).