title: Check if application is installed in registry
body: <p>Right now I use this to list all the applications listed in the registry for 32bit &amp; 64.
  I have seen the other examples of how to check if an application is installed without any luck.</p>
  
  <pre><code>string registryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
  RegistryKey key = Registry.LocalMachine.OpenSubKey(registryKey);
  if (key != null)
  {
      foreach (String a in key.GetSubKeyNames())
      {
          RegistryKey subkey = key.OpenSubKey(a);
          Console.WriteLine(subkey.GetValue("DisplayName"));
      }
  }
  
  registryKey = @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall";
  key = Registry.LocalMachine.OpenSubKey(registryKey);
  if (key != null)
  {
      foreach (String a in key.GetSubKeyNames())
      {
          RegistryKey subkey = key.OpenSubKey(a);
          Console.WriteLine(subkey.GetValue("DisplayName"));
      }
  }
  </code></pre>
  
  <p>So this snippet lists it all in the console window and what I am trying to do is
  just find one program title out of the list of display names to see if it's installed.</p>
  
  <p>The last thing I tried was</p>
  
  <pre><code>if (subkey.Name.Contains("OpenSSL"))
      Console.Writeline("OpenSSL Found");
  else
      Console.Writeline("OpenSSL Not Found");
  </code></pre>
  
  <p>Anything I tried came back either false or a false positive. Is there anyone that can show me how to just grab a title out of the list?</p>
  
  <p>Please don't post up the well-known private static void IsApplicationInstalled(p_name) function. It does not work for me at all.</p>