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