Good day everyone!
I just want to ask, how do you create a registry key in this location
Software\Microsoft\Windows\CurrentVersion\Uninstall
I tried the code below (I stole this somewhere :( , credit who ever coded it) and it is obviously adding a subkey in Software Key
RegistryKey key = Registry.LocalMachine.OpenSubKey("Software",true);
key.CreateSubKey("AppName");
key = key.OpenSubKey("AppName", true);
key.CreateSubKey("AppVersion");
key = key.OpenSubKey("AppVersion", true);
key.SetValue("yourkey", "yourvalue");
So, I tried it by changing the
RegistryKey key = Registry.LocalMachine.OpenSubKey("Software",true);
to
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall");
and it is now giving me an exception which is
'System.UnauthorizedAccessException' occurred in mscorlib.dll
Thank you for the help everyone!