title: Setting directory of ComponentGroupRef in Wix?
body: <p>I have used the Heat tool to generate a wxs file based on a folder whose contents I want to install. This gives me a large file like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
      &lt;Fragment&gt;
          &lt;DirectoryRef Id="TARGETDIR"&gt;
              &lt;Directory Id="dir1FC8A0605F7DF8B33E3EECB0A1270FA2" Name="DirectoryName" /&gt;
          &lt;/DirectoryRef&gt;
      &lt;/Fragment&gt;
      &lt;Fragment&gt;
          &lt;ComponentGroup Id="ComponentGroupId"&gt;
              &lt;Component Id="cmp1FB67A60B41F3170889B7E5739A23560" Directory="dir1FC8A0605F7DF8B33E3EECB0A1270FA2" Guid="{2DC3B790-D29C-4090-B4CF-5C27687C6ABE}"&gt;
                  &lt;File Id="filF1E1262E52254B1846C7CB2393126A6F" KeyPath="yes" Source="PathToFile" /&gt;
              &lt;/Component&gt;
          &lt;/ComponentGroup&gt;
      &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>
  
  <p>In my main Wix file, Product.wxs, I have a feature that references the above ComponentGroup that was created by Heat. The feature looks something like this:</p>
  
  <pre><code>&lt;Feature Id="FeatureId" Title="FeatureTitle" Level="1" AllowAdvertise="no" Absent="disallow" Description="Feature description."&gt;
      &lt;ComponentGroupRef Id="ComponentGroupId" /&gt;
  &lt;/Feature&gt;
  </code></pre>
  
  <p>This is working but when I run my installer, the files within the component group are placed in the root of the C drive (i.e. C:\DirectoryName) but I would like them to go into Program Files (e.g. C:\Program Files\DirectoryName).</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks,
  Alan</p>