Hi,
You need to find all installed app from
"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall"
Here is the sample code-
private string FindByDisplayName(RegistryKey parentKey, string name)
{
string[] nameList = parentKey.GetSubKeyNames();
for (int i = 0; i < nameList.Length; i++)
{
RegistryKey regKey = parentKey.OpenSubKey(nameList[i]);
try
{
if (regKey.GetValue("DisplayName").ToString() == name)
{
return regKey.GetValue("InstallLocation").ToString();
}
}
catch { }
}
return "";
}
RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall");
string location = FindByDisplayName(regKey, "MSN");
MessageBox.Show(location);
This example will compare the DisplayName keyvalue to your input name, if it find the value, then return the InstallLocation key value.