title: Using Wix to create 32bit and 64bit installers from one .wxs file
body: <p>I would like to keep my top level .wxs DRY while building 32 and 64 bit installers. I am using the -arch argument to candle.exe to control what default installer architecture is getting built.</p>
  
  <p>The wall I am hitting right now is that it appears the ProgramFilesFolder is different between 32 and 64bit (ProgramFiles64Folder) architectures. Here is my first attempt to work around:</p>
  
  <pre><code>&lt;?if $(sys.BUILDARCH)=x64 ?&gt;
  &lt;Directory Id='ProgramFiles64Folder' Name='PFiles'&gt;
  &lt;?else ?&gt;
  &lt;Directory Id='ProgramFilesFolder' Name='PFiles'&gt;
  &lt;?endif ?&gt;
      &lt;Directory Id='the-rest' Name="Company Name"&gt;
  ...
  </code></pre>
  
  <p>I tried this with an error. Apparently the XML validation is fired before the preprocessor is evaluated. When I manually change to use ProgramFiles64Folder my build works. </p>
  
  <p>I tried to go down the DirectoryRef route without success. Any suggestions on getting this to work without doing a sed replace within the .wxs file?</p>
  
  <p>Note: I tried this in Wix 3.5 and 3.6. </p>