The project-related variables are only generated for project references. You 
don't get project variables for the WiX project itself. (Hmm... would that be a 
nice feature to have?) So you need to add a reference from your WiX project to 
another application project to get variables for that project. And as the 
documentation says, you need to include the project name in the variable, for 
example: $(var.MyAppProject.TargetPath)

If you examine at the Output window of VS when you build, you can see all the 
available project/solution variables where they are passed on the command-line 
to candle.exe.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert O'Brien
Sent: Friday, April 04, 2008 8:13 AM
To: 'wix-users@lists.sourceforge.net'
Subject: Re: [WiX-users] is there a way to access wixproj macro values from 
within wix sources

I removed the <DefineSolutionProperties>false</DefineSolutionProperties> 
<PropertyGroup> setting from my wixproj file which I had added earlier to 
address the following warning
  "(default target) (1) ->(AddSolutionDefineConstants target) ->  C:\Program 
Files (x86)\MSBuild\Microsoft\WiX\v3.0\Wix.targets : 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."
that was getting generated when I built from the command line using
  "msbuild myservicedeliverable.wixproj"

After making that change I can now leverage $(var.Solution*) macros, e.g. 
Source="$(var.SolutionDir)..." but get still get the compiler error mentioned 
earlier if I try and use wix project macros such as $(var.ProjectDir), 
$(var.OutputPath), $(var.OutDir) and $(var.TargetPath).   So are these ones 
basically n/a but if I reference a non-wix project like a csproj generated dll 
then I should expect that 
$(var.<ReferencedProjectName>.<StandardIssueProjectMacro>) variable references 
will work?

From: Robert O'Brien
Sent: Friday, April 04, 2008 7:41 AM
To: 'wix-users@lists.sourceforge.net'
Subject: RE: is there a way to access wixproj macro values from within wix 
sources

Tried using $(var.ProjectDir) in a File Source attribute field and got a 
"Undefined preprocessor variable '$(var.ProjectDir)'." compiler error.

Tried using the "List of Supported Project References" documented 
$(var.SolutionDir) variable which the documentation suggests is supported and 
got the same compiler error, i.e. "Undefined preprocessor variable 
'$(var.SolutionDir)'." for the following line
<File Id="InstalledUninstallShortcut.txt" Name="InstalledUninstallShortcut.txt" 
DiskId="1" Source="$(var.SolutionDir)Setup\Resources\InstalledComponent.txt" 
KeyPath="yes" />

Have I misinterpreted the "List of Supported Project References" documentation?

From: Robert O'Brien
Sent: Friday, April 04, 2008 6:29 AM
To: 'wix-users@lists.sourceforge.net'
Subject: RE: is there a way to access wixproj macro values from within wix 
sources

. . . according to help doc section entitled "List of Supported Project 
References" it would suggests that using $(var.<SolutionOrProjectMacroName>) 
works for a set of $(Solution*) macro values.

Should one expect using this method to reference in wix soures other standard 
issue project macros not specifically mentioned in that help document to work 
as well, e.g. $(var.Configuration), $(var.OutputPath), $(var.OutDir) and 
$(var.TargetPath)?

From: Robert O'Brien
Sent: Friday, April 04, 2008 5:14 AM
To: 'wix-users@lists.sourceforge.net'
Subject: is there a way to access wixproj macro values from within wix sources

is there a way to access .wixproj macro values from within wix sources?   For 
example in csproj and wixproj settings, such as pre and post build events, one 
can make use of useful project related macro values such as $(Configuration), 
$(SolutionDir), $(ProjectDir), $(OutputPath), $(OutDir), $(TargetDir), 
$(TargetPath).

Is there a way to access these project related macro values at compile time 
within my wix source files?
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to