Contact Us

Contact Us

How To Check If Program Is Installed?

💻 Quick Summary

Checking for installed software in Windows requires accessing the System Registry. This method is more reliable than checking file paths because it accounts for custom installation directories.

  • Namespace: Microsoft.Win32
  • Registry Path: CurrentVersion\Uninstall
  • Platform Support: Handles Wow6432Node for 32-bit apps on 64-bit OS.

To check if a program is installed using C#, you must query the Windows Registry at SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. By iterating through the subkeys and comparing the DisplayName property to your target software, you can programmatically confirm installation for both 32-bit (x86) and 64-bit (x64) architectures.

C# Program Installation Check Logic: Registry Path Navigation Flow (x86 and x64).
Visualizing the step-by-step logic for programmatically querying the Windows Registry to verify installed software.

C# Code Snippet – How To Check if a Program Is Installed?


In this article, we will discuss how to verify whether the program is installed. We will elaborate on this process using C # (.NET)
This function searches the registry for the specified program display name and returns true if the program is installed.
See the name of the program in the Add/Remove Programs list.

public static bool IsProgramInstalled(string displayName, bool x86Platform)
{
string uninstallKey = string.Empty;
 
if (x86Platform)
{
uninstallKey = @”SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall”;
}
 
else
{
uninstallKey = @”SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall”;
}
 
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
{
 
foreach (string skName in rk.GetSubKeyNames())
{
using (RegistryKey sk = rk.OpenSubKey(skName))
{
if (sk.GetValue(“DisplayName”) != null && sk.GetValue(“DisplayName”).ToString().ToUpper().Equals(displayName.ToUpper()))
{
return true; //exists
}
 
}
}
}
 
return false;
}                 public static bool Contains(string inputString, string strToSearch)
{
return Regex.IsMatch(inputString, strToSearch);
}

So, this was all the process you had to follow to check if the program was installed. I hope you have found the information you were looking for.

Common Troubleshooting & FAQs

How do I check if an application is installed in C# without using the Registry?

While the Registry is the most reliable method, you can also use WMI (Windows Management Instrumentation) by querying the Win32_Product class. However, be aware that WMI queries are significantly slower than Registry lookups and can sometimes trigger a consistency check (self-repair) of the installed MSI packages.

Does Registry.LocalMachine work for both 32-bit and 64-bit applications?

Yes, but you must check two different paths. 64-bit applications are listed underSOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, while 32-bit applications on a 64-bit OS are redirected to SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall. The C# snippet provided in this blog handles both by toggling the x86Platform boolean.

Can I check for a program’s installation using its Product Code (GUID)?

Yes. If you have the MSI Product Code, you can look for a registry subkey that matches that specific GUID. This is often more accurate than matching a “Display Name,” as the name can change between software versions, but the Product Code usually remains unique to that specific release.

Need More Than Just a Snippet?

Building custom Windows utilities or complex enterprise integrations requires more than just registry checks—it requires precision engineering. Our C# / .NET experts specialize in building secure, high-performance system tools and healthcare software.

Healthcare software development, HL7 Interface, EMR/EHR integration, mHealth, HIPAA compliant