From 51a7a58ba8aaee25bc93a22860d440d77ea21652 Mon Sep 17 00:00:00 2001 From: Belim Date: Sun, 20 Sep 2020 19:25:21 +0200 Subject: [PATCH] Delete BlockMajorUpdates.cs --- .../Settings/Updates/BlockMajorUpdates.cs | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 src/Privatezilla/Privatezilla/Settings/Updates/BlockMajorUpdates.cs diff --git a/src/Privatezilla/Privatezilla/Settings/Updates/BlockMajorUpdates.cs b/src/Privatezilla/Privatezilla/Settings/Updates/BlockMajorUpdates.cs deleted file mode 100644 index 063fa98..0000000 --- a/src/Privatezilla/Privatezilla/Settings/Updates/BlockMajorUpdates.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Microsoft.Win32; - -namespace Privatezilla.Setting.Updates -{ - internal class BlockMajorUpdates : SettingBase - { - private const string TargetReleaseVersion = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate"; - private const string TargetReleaseVersionInfo = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate"; - private const int DesiredValue = 1; - - public override string ID() - { - return Properties.Resources.settingsUpdatesBlockMajorUpdates; - } - - public override string Info() - { - return Properties.Resources.settingsUpdatesBlockMajorUpdatesInfo.Replace("\\n", "\n"); - } - - public override bool CheckSetting() - { - return !( - RegistryHelper.IntEquals(TargetReleaseVersion, "TargetReleaseVersion", DesiredValue) && - RegistryHelper.StringEquals(TargetReleaseVersionInfo, "TargetReleaseVersionInfo", WindowsHelper.GetOS()) - ); - } - - public override bool DoSetting() - { - try - { - Registry.SetValue(TargetReleaseVersion, "TargetReleaseVersion", DesiredValue, RegistryValueKind.DWord); - Registry.SetValue(TargetReleaseVersionInfo, "TargetReleaseVersionInfo", WindowsHelper.GetOS(), RegistryValueKind.String); - return true; - } - catch - { } - - return false; - } - - public override bool UndoSetting() - { - try - { - var RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\Windows\WindowsUpdate", true); - RegKey.DeleteValue("TargetReleaseVersion"); - RegKey.DeleteValue("TargetReleaseVersionInfo"); - return true; - } - catch - { } - - return false; - } - - } -} \ No newline at end of file