title: Right way to detect cpu architecture?
body: <p>I'm attempting to detect the right cpu architecture for installing either a x86 msi or x64 msi file. </p>
  
  <p>If I'm right, for the msi I need the os cpu architecture</p>
  
  <p>I'm not totally sure if my way is right because I can't test it. 
  What do you think?</p>
  
  <pre><code>private static string GetOSArchitecture()
      {
          string arch = System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
          string archWOW = System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432");
          if(archWOW != null &amp;&amp; archWOW != "" &amp;&amp; archWOW.Contains("64"))
              return "x64";
          if(arch.Contains("86"))
              return "x86";
          if (arch.Contains("64"))
              return "x64";
          return "";
      }
  </code></pre>