Getting the list of installed programs on the local machine

By Roy Osherove In .Net Quotations

Markdown version

Historical article · Originally published September 23, 2003; technical details may be outdated.

Here's a snippet from the win-tech-off-topic list:

Getting the list of installed programs on the local machine:

 static void GetInstalled()
{
      string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
      using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
      {
            foreach (string skName in rk.GetSubKeyNames())
            {
                  using (RegistryKey sk = rk.OpenSubKey(skName))
                  {
                        Console.WriteLine(sk.GetValue("DisplayName"));
                  }
            }
      }
}

More in .Net Quotations

All posts in .Net Quotations