title: How to install on System 32 folder using an x86 compilation with Wix
body: <p>I'm building an x86 compilation of a <a href="http://wixtoolset.org/" rel="nofollow">Wix</a> project. </p>
  
  <p>For some technical reasons, I need to copy some .dlls in system 32 folder. To do so, I wrote the following lines:</p>
  
  <pre><code>// In an external .wxs file
  &lt;?define System32Dir= "C:\Windows\System32" /&gt;
  
  &lt;Component Id="cmp32bits"  Directory="System32Dir" Guid="*"&gt;
      &lt;Condition&gt;NOT VersionNT64&lt;/Condition&gt;
      &lt;File Id="file32bits" KeyPath="yes" Source="mypathtothefile" /&gt;
  &lt;/Component&gt;
  
  &lt;Component Id="cmp64bits"  Directory="System32Dir" Guid="*"&gt;
      &lt;Condition&gt;VersionNT64&lt;/Condition&gt;
      &lt;File Id="file32bits" KeyPath="yes" Source="mypathtothefile" /&gt;
  &lt;/Component&gt;
  </code></pre>
  
  <p>But then it fails as System32Dir contains slashes, points... </p>
  
  <p>Following <a href="http://www.advancedinstaller.com/user-guide/folder-paths.html" rel="nofollow">this</a> guide, if I use the <code>SystemFolder</code> for x86 systems and the <code>System32Folder</code> for x64 systems, when I install the product, for 64 bits machines the .dlls are installed in <code>SysWOW64</code>. I understand that, if I compile the Wix project in x86, the <code>System32Folder</code> will be translated the same for 64 bits systems.</p>
  
  <p>That's the reason why I came to hand write the "C:\Windows\System32", but it's not working yet.</p>
  
  <p>The question and important point is, <strong>how to copy anything in C:\Windows\System32</strong> directory if I'm installing an x86 project into a 64 bits machine?</p>
  
  <p>Thanks a lot.</p>
  
  <p><strong>EDIT:</strong> Added a <code>CustomAction</code> but could not make it work.</p>
  
  <pre><code> &lt;CustomAction Id="CopyToSystem32" ExeCommand="[INSTALLFOLDER]copy.bat" Directory="INSTALLFOLDER" Execute="deferred" Return="asyncWait" /&gt;
  
  &lt;InstallExecuteSequence&gt;
    &lt;Custom Action="CopyToSystem32" After="InstallFiles" &gt;NOT Installed&lt;/Custom&gt;
  &lt;/InstallExecuteSequence&gt;
  </code></pre>
  
  <p>Where the <code>.bat</code> file looks like this:</p>
  
  <pre><code>copy 64bits.txt C:\Windows\System32
  </code></pre>
  
  <p>But actually, I can't make the <code>CustomAction</code> work...</p>