title: Wix ProgramFiles64Folder is still
body: <p>I am having a problem very similar to the one described here:  <a href="https://stackoverflow.com/questions/8568250/programfiles64folder-is-installing-to-program-files-x86-in-wix-installer">ProgramFiles64Folder is installing to \Program Files (x86)\ in WIX Installer</a></p>
  
  <p>However, the solution there does not work for me.  Wix still generates a .msi that installs to C:\Program Files (x86)</p>
  
  <p>I placed the following code in my Product.wxs file:</p>
  
  <pre><code>&lt;?if $(var.Platform) = x64 ?&gt;
    &lt;?define Win64 = "yes" ?&gt;
    &lt;?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?&gt;
    &lt;?define ConfigFolder = "Release" ?&gt;
  &lt;?else ?&gt;
    &lt;?define Win64 = "no" ?&gt;
    &lt;?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?&gt;
    &lt;?define ConfigFolder = "Release_x86" ?&gt;
  &lt;?endif?&gt;
  </code></pre>
  
  <p>Then later I try to specify installation folder as follows:</p>
  
  <pre><code>&lt;Directory Name="SourceDir" Id="TARGETDIR"&gt;
      &lt;Directory Name="$(var.PlatformProgramFilesFolder)" Id="$(var.PlatformProgramFilesFolder)"&gt;
      ...
  </code></pre>
  
  <p>I verified that var.Platform is set properly because it copies source files from the correct ConfigFolder.  However, it seems that both ProgramFiles64Folder and ProgramFilesFolder are set to C:\Program Files (x86)</p>
  
  <p>I verified that candle.exe is invoked with -dPlatform=x64 option.  </p>
  
  <p>I even tried to specify platform in my Package tag</p>
  
  <pre><code>&lt;Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" /&gt;
  </code></pre>
  
  <p>Nothing helps, it still tries to install to C:\Program Files (x86)</p>
  
  <p>Any idea what else I can try?</p>
  
  <p>Thank you.</p>
  
  <p>I am using WiX version 3.9</p>