title: Get Installed software list
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5909589/get-installed-software-list">Get Installed software list</a>  </p>
  </blockquote>
  
  
  
  <p>How to get installed application software list using C? I have a solution in C#. This is the C# code:</p>
  
  <pre><code>System Microsoft.Win32 
  private string Getinstalledsoftware() {
      string Software = null; 
      string SoftwareKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"; 
      using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(SoftwareKey)) { 
          foreach (string skName in rk.GetSubKeyNames()) { 
              using (RegistryKey sk = rk.OpenSubKey(skName)) { 
                  try { 
                      if (!(sk.GetValue("DisplayName") == null)) { 
                          if (sk.GetValue("InstallLocation") == null) 
                              Software += sk.GetValue("DisplayName") + " - Install path not known\n";
                          else 
                              Software += sk.GetValue("DisplayName") + " - " + sk.GetValue("InstallLocation") + "\n"; 
                      } 
                  } 
                  catch (Exception ex) { 
                  }
              }
          } 
      } 
      return Software; 
  }
  </code></pre>
  
  <p>How can I convert the C# code into C code?</p>