Menu

#1417 Votive does not set VS2005 variables correctly

v3.0
closed
votive (347)
2015-01-23
2008-11-20
No

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):

------ Build started: Project: IPDS_Installer, Configuration: Debug x86

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.

Discussion

  • Bob Arnson

    Bob Arnson - 2008-11-21

    Please try the latest weekly release from http://wix.sourceforge.net/releases/. Several Votive bugs have been fixed since 4318 was released.

     
  • Anonymous

    Anonymous - 2008-11-21

    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 ==========

     
  • Grigory Petrov

    Grigory Petrov - 2008-12-25

    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).

     
  • Anonymous

    Anonymous - 2008-12-29

    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.

     
  • Anonymous

    Anonymous - 2008-12-30

    My last comment should have said it is still a problem in 3.0.4827.

     
  • Simon Alford

    Simon Alford - 2009-02-04

    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.

     
  • Simon Alford

    Simon Alford - 2009-02-04

    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>

    <!-- Example, MySolution -->
    <SolutionName Condition=" '$(SolutionName)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionName>
    
    <!-- Example, MySolution.sln -->
    <SolutionFileName Condition=" '$(SolutionFileName)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionFileName>
    
    <!-- Example, C:\MySolutions\MySolution\MySolution.sln -->
    <SolutionPath Condition=" '$(SolutionPath)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionPath>
    
    <!-- Example, C:\MySolutions\MySolution\ -->
    <SolutionDir Condition=" '$(SolutionDir)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionDir>
    
    <!-- Example, .sln -->
    <SolutionExt Condition=" '$(SolutionExt)' == '' ">*Undefined if not building a solution or within Visual Studio*</SolutionExt>
    

    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.

     
  • Grigory Petrov

    Grigory Petrov - 2009-03-02

    This is still a problem in 3.0.5027.0

    Very easy to reproduce:

    1. Install Visual Studio 2005 Professional
    2. Install ProjectAggregator2.msi
    3. Install Wix3.msi
    4. Start Visual Studio, select File->New->Project->Wix->Wix Project, enter project name and click 'Ok'
    5. Build project. "warning : Solution properties are only available during IDE builds or when building the solution file from the command line" warning will be displayed, and log will show that candle.exe is called with all VS solution properties undefined, ex '-d"DevEnvDir=Undefined if not building from within Visual Studio"'
     
  • Adrian Lewis

    Adrian Lewis - 2009-03-03

    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>

        .... snip ...
    

    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;

        <JemsTargetsPath>$(SolutionDir)..\..\Jems.Common.Targets</JemsTargetsPath>
    

    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!

     
  • Grigory Petrov

    Grigory Petrov - 2009-04-14

    This is still a problem in 3.0.5210.0

     
  • Adrian Lewis

    Adrian Lewis - 2009-04-17

    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 :-)

     
  • Justin Rockwood

    Justin Rockwood - 2009-04-17

    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.

     
  • Grigory Petrov

    Grigory Petrov - 2009-04-29

    Seems fixed in 3.0.5224.0 : no more warnings and variables are set correctly.

     
  • SourceForge Robot

    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).

     
MongoDB Logo MongoDB