title: WiX - Copy compiled web.config based on environment to website root
body: <p>As a part of my WiX installation, I am copying all the transformed/compiled web.config files to the install directory. The names of the compiled web.config are in format web.{ENV}.config. In my install UI I created a Custom Dialog where I parse the ENV and populate a combobox so that the user can select the environment to which we deploy to. This comboBox sets a Property ENV. </p>
  
  <p>I need to understand how i could use this property to copy the installed config files to the website root.</p>
  
  <p>Update: @Rob_Mensching - your solution works, however, on compilation WiX forces me to have a GUID created for each such component. Is there a way I could avoid it? The thing is i am going to generate this piece of code by running XSLT on my wxs file which gets generated using heat; and there is no way I could generate a GUID using XSLT (or can I?)</p>
  
  <p>This is how my code looks now:</p>
  
  <pre><code>&lt;ComponentGroup Id='web.config' Directory='CONFIGLOCATION'&gt;
    &lt;Component Id='CopyWebConfigForDev1' Guid='{F207C26A-5D9C-4F19-96A3-D818BB226EFC}' &gt;
      &lt;Condition&gt;ENV="Dev1"&lt;/Condition&gt;
      &lt;CopyFile Id='CopyDev1Config' FileId='fil9C4CFE42035F1A63180142352CF441BC' DestinationDirectory='CONFIGLOCATION' DestinationName='web.config'/&gt;
    &lt;/Component&gt;
    &lt;Component Id='CopyWebConfigForQA1' Guid='{F207C26A-5D9C-4F19-96A3-D818BB226EFC}' &gt;
      &lt;Condition&gt;ENV="QA1"&lt;/Condition&gt;
      &lt;CopyFile Id='CopyQA1Config' FileId='fil12F8B50F03F1BD91A579F6B6CE7195DF' DestinationDirectory='CONFIGLOCATION' DestinationName='web.config'/&gt;
    &lt;/Component&gt;
  &lt;/ComponentGroup&gt;
  </code></pre>