Click here to Skip to main content
15,917,793 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
this code is to check if the program is installed or not on the system
private void button1_Click(object sender, EventArgs e)
       public static bool IsApplictionInstalled(string p_name)
           string displayName;
           RegistryKey key;
           // search in: CurrentUser
           key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall");
           foreach (String keyName in key.GetSubKeyNames())
               RegistryKey subkey = key.OpenSubKey(keyName);
               displayName = subkey.GetValue("DisplayName") as string;
               if (p_name.Equals(displayName, StringComparison.OrdinalIgnoreCase) == true)
                   return true;

it Displays error type or namespace 'registryKey' could not be found

Share this answer
demouser743 20-Sep-10 10:56am    
Haha nice one dude
Lantei 20-Sep-10 11:53am    
wow! pretty
Try by adding this

uing System.Security.Permissions;
using Microsoft.Win32;
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900