Hi Matt,

I've doublechecked Binares and Content output groups but without success. I run 
heat from command line:
"%WIX%\bin\heat" project "..\..\src\Configurator.csproj" -pog:Binaries 
-pog:Content -out heat.wxs
The only reference I have in outputs is compiled assembly. Heat completely 
ignores other files in project's output directory (referenced assemblies - they 
are there, I've checked it. I've also checked that the Copy Local property for 
every of them is set to True).
May be the problem is because I use WiX 3.0?
Or I miss some special command line parameter?

> Hi Ilya,

> In your source project, make sure you have the build action set
> appropriately for each file.  It should be Compile for .cs files
> that make their way into assemblies, Content for files you want
> harvested by heat, and None for files you want heat to ignore.  Then
> when setting your references, or using heat from the commandline,
> specify project output groups Binares and Content.   I know this
> works, because I am using it for a web project, which has .aspx and
> .config files as content, and they get harvested just fine.


> Matt Johnson MCPD, MCTS, MCSD, MCDBA
> Director of Application Development
> Time America, Inc.
> ma...@timeamerica.com | www.timeamerica.com

> -----Original Message-----
> From: Илья Сербис [mailto:iser...@shtrih-m.ru] 
> Sent: Friday, May 14, 2010 6:15 AM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Adding reference to WiX project doesn't
> lead to copy referenced project's files


> Matt,

> First of all thanks for your response.

> msbuild's HarvestProject task isn't appropriate for my goals for
> some reasons. The main is that heat doesn't create list of all files
> from project's output directory but instead add reference only to
> the project assembly. This is almost useless because assembly
> usually need some files for its work (referenced assemblies,
> configuration files) and has some artifacts (like readme files).

> Another issue I've faced with is that only files with specific
> extensions (or with specific names) should be put into .msi. Other
> files should be filtered out. Because heat has no options to control
> this I have only two ways to achieve the goal. First - remove
> unwanted files before the heat goes through the directory. Second -
> remove unwanted Components from generated wxs file by applying xsl
> transformation. I prefer the first solution (because del command is
> much more simpler than xslt language).

> So before building .msi file my pre-build process should execute steps like 
> this:
> 1.      Copy files from output directory of C# project to the temporary 
> directory
> 2.      Delete unwanted files from the directory
> 3.      Run heat to generate list of files in this directory

> My question was about step 1. It would be nice if Votive be able to
> copy content of referenced project to its own output directory. This
> would allow me not to write relative paths to output directories of
> referenced projects manually. But everything looks like it's not possible.

> Also note that I'm not be able to use Votive variables like
> $(var.ProjectName.foo) at the heat command prompt. I have to provide
> heat by the full path to the directory with files.

> Ilya Serbis



>> Hi,

>> That is not entirely correct.  When you reference one project to
>> another, msbuild doesn't copy anything.  It simply makes the
>> reference project available to the target project. It is up to the
>> target project itself to decide what it's going to do with that
>> reference.  In the case of a c# project, it decides to copy files
>> according to the "Copy Local" property of the reference, and the
>> "Build Action" and "Copy to Output Directory" properties of each file.

>> Votive, (the Wix Visual Studio plugin), does other things with
>> project reference. First, it makes the project available through
>> variables such as $(var.ProjectName.Whatever) (see the wix docs on
>> "project references"). Second, if you are using Wix 3.5 with VS2010,
>> you get options for "Harvest" (true/false) and "ProjectOutputGroups" that go 
>> along with Harvest=True.

>> Those two harvesting properties will control how Heat builds .wxs
>> files from your project.  Those end up in the obj subdirectory, and
>> then passed in to Candle during the build process.

>> Whether files from your c# project make their way to your final
>> output directory in Wix depends on a whole lot of things. For
>> example, you may be using a compressed package where all your files
>> go inside cabinets and those get embedded in the msi. There may be
>> different Media elements defined in your package, or you may be
>> using those files in some other way inside your wix project.

>> Hopefully you now understand why you don't get files in your output
>> directory just from making the project reference.  That would go
>> against all of the reasons that you build a wix project in the first place.


>> Now - if what you really want to know is how to get files from your
>> referenced c# package into your output directory without them being
>> embedded in an msi, it's fairly simple:
>> 1) Set Compressed="no" on your package
>> 2) Reference your project and use the harvesting properties.

>> The only downside to this is that ALL your harvested files will end
>> up outside of the msi.  To work around that, you'll need
>> Compressed="yes" on the files that you want inside your msi. The
>> problem now is that there's no opportunity to modify the .wxs
>> generated by the harvesting on the project reference, to get that
>> attribute on the files harvested there.  IMHO, this is a major
>> oversight in Votive.  We need the ability to provide transforms on the 
>> project reference.

>> There is a workaround for this problem - You have to turn OFF
>> harvesting on your reference and do it the old wix 3.0 way. 
>> Basically, open up your wixproj file and add an item group like such:

>> <ItemGroup>
>>   <HarvestProject Include="..\MyWebApp.csproj">
>>     <ProjectOutputGroups>Content;Binaries</ProjectOutputGroups>
>>     <Transforms>MyWebTransform.xslt</Transforms>
>>     <Link>MyWebApp.csproj</Link>
>>   </HarvestProject>
>> </ItemGroup>

>> Don't delete the reference though, it is still useful for the
>> $(var.ProjectName.Whatever) variables. Just set Harvest=False.

>> Now you can create an xslt for heat to use to add the
>> Compressed="yes" attribute to your File elements in the generated wxs.

>> I know this is an ugly workaround.  I hope someone that works on
>> Votive is listening.  This is a great example of why we need to be
>> able to specify transforms as a property on the project reference.



>> Matt Johnson MCPD, MCTS, MCSD, MCDBA
>> Director of Application Development
>> Time America, Inc.
>> ma...@timeamerica.com | www.timeamerica.com

>> -----Original Message-----
>> From: Илья Сербис [mailto:iser...@shtrih-m.ru] 
>> Sent: Thursday, May 13, 2010 8:08 AM
>> To: wix-users@lists.sourceforge.net
>> Subject: [WiX-users] Adding reference to WiX project doesn't lead
>> to copy referenced project's files


>> Hello!

>> I have WiX project included into Visual Studio solution along with
>> other projects written on C#. In order to automate build process I
>> need to get output files from some of C# projects, and add them to
>> msi file.

>> Usually when you add reference from one C# project to another,
>> msbuild copy files from output dir of referenced project to the
>> referrer's folder. But this rule is not applicable to WiX projects.

>> I've made reference from WiX project to one of C# projects but haven't
>> got any files from C# project in WiX output directory. Is it possible
>> to make standard references (which allow files to be copied)?

>> After getting all of the files in WiX output dir I'm going to filter
>> out some of them (in pre-build event) and then automatically generate
>> the list by the heat utility (also in pre-build event). It's simpler
>> than filter out Components through the xsl transformation from wxs
>> file generated by the heat.

>> Another issue I faced with: usually when I add file to C# project as a
>> link I can set "Copy if newer" option for this file in it's properties
>> window. But in case of WiX projects there is no such option. May be I
>> missed something?



>> ------------------------------------------------------------------------------

>> _______________________________________________
>> WiX-users mailing list
>> WiX-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wix-users

>> ------------------------------------------------------------------------------

>> _______________________________________________
>> WiX-users mailing list
>> WiX-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wix-users

>> 



> ------------------------------------------------------------------------------

> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users

> ------------------------------------------------------------------------------

> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users

> !DSPAM:3680870,4bed59bd710862011019437!



------------------------------------------------------------------------------

_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to