I'm getting: Access Denied HKEY_LOCAL_MACHINE
What is the wrong with this code?
var key = "SOFTWARE\\Microsoft\\Expression\\Encoder\\4.0";
using (var registryKey = Registry.LocalMachine.OpenSubKey(key))
{
if (registryKey == null)
{
using (var newKey = Registry.LocalMachine.CreateSubKey(key))
{
CheckInstallKey(newKey);
}
}
else
{
CheckInstallKey(registryKey);
}
}
Error: