Browse Source

本机测试创建的注册表项可能会没有打开权限

蓝点lilac 5 years ago
parent
commit
a345305189
1 changed files with 1 additions and 0 deletions
  1. 1 0
      ContextMenuManager/BulePointLilac.Methods/RegistryEx.cs

+ 1 - 0
ContextMenuManager/BulePointLilac.Methods/RegistryEx.cs

@@ -117,6 +117,7 @@ namespace BulePointLilac.Methods
         public static RegistryKey CreateSubKey(this RegistryKey key, string subKeyName, bool writable)
         {
             key.CreateSubKey(subKeyName).Close();
+            RegTrustedInstaller.TakeRegTreeOwnerShip($@"{key.Name}\{subKeyName}");
             return key.OpenSubKey(subKeyName, writable);
         }
     }