title: Getting list of installed programs on 64-bit Windows
body: <p>I am using this code to make a list of all the installed programs:</p>
  
  <pre><code>object line;
  string registry_key = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
  using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registry_key))
  {
      foreach (string subkey_name in key.GetSubKeyNames())
      {
          using (RegistryKey subkey = key.OpenSubKey(subkey_name))
          {
              line = subkey.GetValue("DisplayName");
              if (line != null)
              {
                  listBox1.Items.Add(line);
              }
          }
      }
  }
  </code></pre>
  
  <p>On a 64-bit windows, this redirects to <strong>Wow6432Node</strong> \Microsoft\Windows\CurrentVersion\Uninstall. But some program entries are still located in the original path and the list is incomplete. How can I avoid redirection and read the values from both paths on a 64-bit Windows installation (and only the first one on a 32-bit windows)?</p>