How to get the applications installed in the system using c# code?
Press Windows key + I to open Settings and click Apps > Apps & features. Doing so will list all programs installed on your computer, along with the Windows Store apps that came pre-installed.
When it comes to viewing all installed apps on your Windows 10 PC, there are two options. You can use the Start menu or navigate to Settings > System > Apps & features section to view all installed apps as well as classic desktop programs.
Iterating through the registry key "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" seems to give a comprehensive list of installed applications.
Aside from the example below, you can find a similar version to what I've done here.
This is a rough example, you'll probaby want to do something to strip out blank rows like in the 2nd link provided.
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")); } } }
Alternatively, you can use WMI as has been mentioned:
ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_Product"); foreach(ManagementObject mo in mos.Get()) { Console.WriteLine(mo["Name"]); }
But this is rather slower to execute, and I've heard it may only list programs installed under "ALLUSERS", though that may be incorrect. It also ignores the Windows components & updates, which may be handy for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With