title: WiX: Prevent 32-bit installer from running on 64-bit Windows
body: <p>Due to user confusion, our app requires separate installers for 32-bit and 64-bit versions of Windows. While the 32-bit installer runs fine on win64, it has the potential to create support headaches and we would like to prevent this from happening.</p>
  
  <p>I want to prevent the 32-bit MSI installer from running on 64-bit Windows machines. To that end I have the following condition:</p>
  
  <pre><code>&lt;Condition Message="You are attempting to run the 32-bit installer on a 64-bit version of Windows."&gt;
    &lt;![CDATA[Msix64 AND (NOT Win64)]]&gt;
  &lt;/Condition&gt;
  </code></pre>
  
  <p>With the Win64 defined like this:</p>
  
  <pre><code>&lt;?if $(var.Platform) = "x64"?&gt;
  &lt;?define PlatformString = "64-bit"?&gt;
  &lt;?define Win64 ?&gt;
  &lt;?else?&gt;
  &lt;?define PlatformString = "32-bit"?&gt;
  &lt;?endif?&gt;
  </code></pre>
  
  <p>Thing is, I can't get this check to work right. Either it fires all the time, or none of the time. The goal is to check presence of the run-time <code>msix64</code> variable against the compile-time <code>Win64</code> variable and throw an error if these don't line up, but the logic is not working how I intend it to. Has anyone come up with a better solution?</p>