[wix-users] Wix Msbuild issue

Hoover, Jacob Jacob.Hoover at greenheck.com
Wed Mar 1 08:39:44 PST 2017


My preference would be to use BSBuild properties, and then modify the wixproj to include them if defined in the DefineConstants.

Ex:
Msbuild foo.wixproj /p:ServiceSourcePath="X:\" /p:SourcePath="Y:\"


And then in the wixproj.

  <PropertyGroup>
    <ServiceSourcePath Condition=" '$(ServiceSourcePath)' == '' ">C:\Some\Path\For\Developers\</ServiceSourcePath>
    <SourcePath Condition=" '$(SourcePath)' == '' ">D:\Another\Path</SourcePath >
    <DefineConstants>
      $(DefineConstants);
      ServiceSourcePath=$(ServiceSourcePath);
      SourcePath=$(SourcePath);
    </DefineConstants>
  </PropertyGroup>


This allows you to provide logical defaults for your developers, while overriding the properties for your build server.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Phill Hogland
Sent: Wednesday, March 01, 2017 8:34 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>; Laique Abbas <laiqueabbas_is at yahoo.com>
Subject: Re: [wix-users] Wix Msbuild issue

I do not typically use DefineConstants name=value pairs, but maybe this link will help you.


http://stackoverflow.com/questions/506687/passing-multiple-values-to-wix-defineconstants-property-with-msbuild


The approach that I take is in my .wixproj file I have a PropertyGroup which defines a MSBuild property


<MyPath>SomeDefaultPath</MyPath>


Then later in the .wixproj file, after the configuration blocks, implement:

    <CompilerAdditionalOptions>
      $(CompilerAdditionalOptions)
      -dMyPathBldProp="$(MyPath)"
    </CompilerAdditionalOptions>

And in the projects .wxs files use this 'preprocessor' variable, as if you had defined it in your authoring, but you can set it using the MSBuild command line. /property:MyPath=someOtherPath

$(var.MyPathBldProp)


Sorry I do not have a direct answer to your question.





________________________________
From: Laique Abbas <laiqueabbas_is at yahoo.com>
Sent: Wednesday, March 1, 2017 8:04:28 AM
To: Phill Hogland; WiX Toolset Users Mailing List
Subject: Re: [wix-users] Wix Msbuild issue

Thanks.  Can you confirm me on how to write more than one constants in msbuild script ?
 "/property:DefineConstants=`"ServiceSourcePath="abc";SourcePath="xyz"`""

Regards,
Laique


On Wednesday, March 1, 2017 6:42 PM, Phill Hogland <phill.hogland at rimage.com> wrote:


I would add MSBuild logging and then evaluate the 'binding' paths in the call to light.exe, just before the error

/v:diagnostic /fl /flp:logfile=<path><name>.log;append;verbosity=diagnostic

/v:normal will give you less noise and still show the binding paths to let you see where the problem is.
________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Laique Abbas <laiqueabbas_is at yahoo.com>
Sent: Wednesday, March 1, 2017 7:00:20 AM
To: WiX Toolset Users Mailing List
Subject: [wix-users] Wix Msbuild issue

I am getting an error stated below :
light.exe : error LGHT0103: The system cannot find the file '{Filename}' with type ''.
Though this {Filename} exists on physical path.
Is there a problem with my Define constant property as I have provided 2 variables in it ?
I am using msbuild.exe. I am providing 2 define constants variable in the below line : I am breaking my msbuild line for clarity purposes for this email :
 & C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /property:configuration="Debug" /property:Platform="Any CPU" /property:OutputPath=$outputPath /property:Version=$version "/property:DefineConstants=`"ServiceSourcePath="abc";SourcePath="xyz"`"" $solution /m /target:build Can any one help me figure out whats the issue ?
Regards,Laique


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



More information about the wix-users mailing list