tags:

views:

246

answers:

1

I'm new to WiX. Very new. Is there a way to define both a ComponentGroup and a Directory at the same time?

I have a large number of files, on the order of 300 or so total, that need to be split into a number of groups, with each group having somewhere around 50 files.

Using heat.exe, I was able to create a Fragment that creates Components for each file. I would like to avoid having to re-list each and every one of these components in a separate ComponentGroup definition. I would love to be able to wrap the list of components generated by heat in a ComponentGroup definition, then simply use that ComponentGroupRef inside of a DirectoryRef structure.

I hope this clears it up. I currently must do:

<DirectoryRef Id="FilesDir">
  <Component Id="a.txt" Guid="YOUR-GUID">
    <File Id="a.txt" KeyPath="yes" Source="SourceDir\a.txt" />
  </Component>
  <Component Id="b.txt" Guid="YOUR-GUID">
    <File Id="b.txt" KeyPath="yes" Source="SourceDir\b.txt" />
  </Component>
...
  <Component Id="z.txt" Guid="YOUR-GUID">
    <File Id="z.txt" KeyPath="yes" Source="SourceDir\z.txt" />
  </Component>
</DirectoryRef>

<ComponentGroup Id="FilesGroup">
  <ComponentRef Id="a.txt">
  <ComponentRef Id="b.txt">
...
  <ComponentRef Id="z.txt">
</ComponentGroup>

I have to list every file twice. That stinks.

I'd like to be able to do:

<ComponentGroup Id="FilesGroup">
  <Component Id="a.txt" Guid="YOUR-GUID">
    <File Id="a.txt" KeyPath="yes" Source="SourceDir\a.txt" />
  </Component>
  <Component Id="b.txt" Guid="YOUR-GUID">
    <File Id="b.txt" KeyPath="yes" Source="SourceDir\b.txt" />
  </Component>
...
  <Component Id="z.txt" Guid="YOUR-GUID">
    <File Id="z.txt" KeyPath="yes" Source="SourceDir\z.txt" />
  </Component>
</ComponentGroup>

<DirectoryRef Id="FilesDir">
  <ComponentGroupRef Id="FilesGroup">
</DirectoryRef>

Is that possible? Is there some other way of making this easier that I'm just not seeing?

A: 

I'm not sure, but I think the answer you're looking for was described here:

http://blogs.msdn.com/icumove/archive/2009/03/06/wix-heat-wave-brings-changes.aspx

I'm pretty new to WiX myself, and I could be misunderstanding the question.

worldlee78
Thanks for the reply. That might be useful, but it doesn't seem to be what I'm looking for. The examples in that article show files being added to either a directory or a componentgroup, not both. If that utility would generate a file that looked like my first example up there, it would definitely solve my problem.
Brown