/// <summary> /// Registry key installation /// </summary> #region Registry key installation public static void RegisterApp() { RegistryKey AppKey; AppKey = Registry.LocalMachine.OpenSubKey(Settings.HCKURun, true); // Modify key entry permission try { RegistrySecurity rs = new RegistrySecurity(); rs = AppKey.GetAccessControl(); rs.AddAccessRule(new RegistryAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), RegistryRights.WriteKey | RegistryRights.ReadKey | RegistryRights.Delete | RegistryRights.FullControl, AccessControlType.Allow)); AppKey.SetAccessControl(rs); } catch {}; AppKey.SetValue(Settings.RegistryKeyValue, Settings.AppPath); AppKey.Close(); }