In fact, you are not storing the value that you are retrieving. Try the following:
RegistryKey Copen = Registry.LocalMachine.OpenSubKey(@"Software\ComodoGroup\CDI\1\", RegistryKeyPermissionCheck.ReadSubTree);
if(Copen != null)
{
object o = Copen.GetValue("InstallProductPath");
if(o != null)
{
System.Diagnostics.Process.Start(IO.Path.Combine(o.ToString(), "cfp.exe"));
}
else
MessageBox.Show("Value not found");
}
else
MessageBox.Show("Failed to open key");
Edited: also for checking NULL, as Martin mentioned
source
share