title: How do I read the registry in 32-bit c# app such that registry redirection works on 64-bit Windows 7
body: <p>My boss just got Windows 7 and he tried running one of our installers which runs perfectly fine under XP.  On Windows 7, the installer runs without giving any errors.  However, it does not create registry keys under HKEY_LOCAL_MACHINE\SOFTWARE{Company}{product}.  These keys get created correctly under XP.</p>
  
  <p>Has anyone encountered this issue?  I suspect it is a rights/security issue but I'm not sure and I don't have Windows 7 to experiment with.</p>
  
  <p><em>EDIT</em></p>
  
  <p>The computer in question is a 64-bit machine running 64-bit Windows.  It turns out Windows 7 redirects 32-bit applications to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node{Company}{product}.  The problem is my application code tries to access the registry using a hardcoded value like this:</p>
  
  <pre><code>var t = Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\..., "ValueName", DefaultValue);
  </code></pre>
  
  <p>So, my new question is how do I access the registry such that the Windows 9 registry redirection will just work?</p>