BHOInternetExplorer拡張機能の登録に使用している[ComRegisterFunction]があります。64ビットWindows7マシンでの登録中に、subKey.SetValue( "NoExplorer"、1)の呼び出しでUnauthorizedAccessExceptionがスローされます。
レジストリにはBHOが@\HKLM \ SOFTWARE \ Wow6432Node \ Microsoft \ Windows \ CurrentVersion \ explorer \ Browser Helper Objectsにあるように見えますが、そこに登録しようとすると同じ例外が発生します。どんな助けでもいただければ幸いです。
[ComRegisterFunction]
public static void RegisterBho(Type type) {
string BhoKeyName= "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper Objects";
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(BhoKeyName, true) ??
Registry.LocalMachine.CreateSubKey(BhoKeyName);
if(registryKey == null) throw new ApplicationException("Unable to register Bho");
registryKey.Flush();
string guid = type.GUID.ToString("B");
RegistryKey subKey = registryKey.OpenSubKey(guid) ?? registryKey.CreateSubKey(guid);
if (subKey == null) throw new ApplicationException("Unable to register Bho");
subKey.SetValue("NoExplorer", 1);
registryKey.Close();
subKey.Close();
}