Cool I guess I didn't quite connect the dots when you suggested this option 
earlier.    I also realized that var.<ReferencedProjectName>.TargetDir is 
essentially going to equal OutDir and OutputPath for all projects in the case 
of a tfs automated msbuild .proj file processing activity.

On a sortof related note anyone know what the intended differences are supposed 
to be between project macros OutputPath and OutDir and why even have them when 
they should essentially be the same as TargetDir?

From: Justin Rockwood [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 09, 2008 6:15 PM
To: Robert O'Brien; Jason Ginchereau; wix-users@lists.sourceforge.net
Subject: RE: [WiX-users] is there a way to access wixproj macro values from 
within wix sources

Those are good scenarios. Just a note that you can accomplish the same thing 
today by defining the variables yourself. You would just change the 
<DefineConstants> in your .wixproj file (either directly or via the property 
pages in the IDE). You can use an MSBuild defined variable, which will do what 
you want. So, your authoring would look like this in your .wxs file:

Source="$(var.OutDir)\..."

In your .wixproj, you'd have the following in a <PropertyGroup>

<DefineConstants>OutDir=$(OutputPath)</DefineConstants>

This will work today without any bug fixes. Note that $(OutputPath) is already 
defined by the project systems in MSBuild.

Justin

From: Robert O'Brien
Sent: Wednesday, April 09, 2008 6:06 PM
To: Justin Rockwood; Jason Ginchereau; 'wix-users@lists.sourceforge.net'
Subject: RE: [WiX-users] is there a way to access wixproj macro values from 
within wix sources

Fyi - I just updated  
http://sourceforge.net/tracker/index.php?func=detail&aid=1934684&group_id=105970&atid=642717
 with the following additional scenario for a solution/project macro variable 
that if it were exposed would enable wix Source= values that has not source 
tree hierarchy dependencies.

One Solution and/or Project macro that would be great to have access to enabled 
if possible is $(var.OutDir) and $(var.OutputPath).   The reason being is that 
in the case of Tfs automated building of msbuild .proj defined build types it 
sets the OutDir macro for all projects being built to the same destination 
which would make it possible to use wix Source="$(var.OutDir)\<referenced 
assembly != var.<projectName>.TargetPath>" and have that work in both IDE and 
Tfs automated build cases.   Also when tfs automated build executes it creates 
this interesting folder in the OutDir destination called "_PublishedWebsites" 
which contains a property structured drop of any web application type build 
output.  Therefore having OutDir macro access would make it possible to do non 
source tree hierarchy specific wix source= references 
Source="$(var.OutDir)_PublishedWebsites\SomeWebApp\web.config" and 
Source="$(var.OutDir)_PublishedWebsites\SomeWebApp\SomeWcfService.svc".

From: Robert O'Brien
Sent: Friday, April 04, 2008 10:57 AM
To: Justin Rockwood; Jason Ginchereau; 'wix-users@lists.sourceforge.net'
Subject: RE: [WiX-users] is there a way to access wixproj macro values from 
within wix sources

Done.  
http://sourceforge.net/tracker/index.php?func=detail&aid=1934684&group_id=105970&atid=642717

From: Justin Rockwood
Sent: Friday, April 04, 2008 10:38 AM
To: Robert O'Brien; Jason Ginchereau; 'wix-users@lists.sourceforge.net'
Subject: RE: [WiX-users] is there a way to access wixproj macro values from 
within wix sources

Sounds like a nice thing to have. Would you mind logging a feature request 
including the text of your message (you explained it very well)? You can do it 
here:
http://sourceforge.net/tracker/?group_id=105970&atid=642717

Thanks,
Justin

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

Having access to the Wix project project-related variables would be very 
helpful.    The way we setup our sources is that we have every .csproj use the 
following project settings, and hopefully now .wixproj given msbuild support in 
the 3.0 work.

<Project ToolsVersion="3.5" DefaultTargets="Build" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
  <Import Condition="'$(OpeningProjectSettings)' == ''" 
Project="..\BuildSupportFiles\anyCpu\OpeningProjectSettings.targets" />
  .
  .
  .
  <Import Condition="'$(ClosingProjectSettings)' == ''" 
Project="..\BuildSupportFiles\anyCpu\ClosingProjectSettings.targets" />
</Project>

The thing we do in OpeningProjectSettings is Set the $(OutputPath) property 
setting for all projects so that dll, exe, msi, other output all gets placed in 
same folder it will get placed in when we setup tfs automated execution of per 
checkin and daily build msbuild .proj files.    The great thing about tfs 
automated execution of per checkin and daily build msbuild .proj files is that 
it automatically sets OutDir to the <build setup enlistment 
root>/Binaries/$(Configuration).     This makes authoring wix30 msi sources 
nice because if we could access wix project related variables we could then set 
the Source attribute for all File entries to use Source="$(var.OurDir)" and not 
have to worry about baking source tree build output hierarchy knowledge into 
our wix sources.   For the cases where the wix project itself has source files 
that need to be referenced, e.g. ReadMe.txt and Other stuff not coming for 
other solution build output, I'd want to be able to use 
Source="$(var.ProjectDir)..." references.

From: Jason Ginchereau
Sent: Friday, April 04, 2008 8:31 AM
To: Robert O'Brien; 'wix-users@lists.sourceforge.net'
Subject: RE: [WiX-users] is there a way to access wixproj macro values from 
within wix sources

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?
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to