Get list of applications installed on the computer

0

I would like to get a list of all the programs that are installed on the computer and display in a DataGridView with (C # Windows Forms Application).

    
asked by anonymous 24.07.2015 / 14:21

1 answer

2

You can get the list of installed programs by reading the Windows SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall registry entries, as follows:

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))
        {
            Console.WriteLine(subkey.GetValue("DisplayName"));
        }
    }
}

Adapted from StackOverflow's link .

    
24.07.2015 / 18:31