From ca72007781bfe8e493232fd6932492c8a47fbc53 Mon Sep 17 00:00:00 2001 From: Belim Date: Sun, 20 Sep 2020 19:25:15 +0200 Subject: [PATCH] Delete DisableUpdates.cs --- .../Settings/Updates/DisableUpdates.cs | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 src/Privatezilla/Privatezilla/Settings/Updates/DisableUpdates.cs diff --git a/src/Privatezilla/Privatezilla/Settings/Updates/DisableUpdates.cs b/src/Privatezilla/Privatezilla/Settings/Updates/DisableUpdates.cs deleted file mode 100644 index 5358ce2..0000000 --- a/src/Privatezilla/Privatezilla/Settings/Updates/DisableUpdates.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Microsoft.Win32; - -namespace Privatezilla.Setting.Updates -{ - internal class DisableUpdates : SettingBase - { - private const string NoAutoUpdate = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU"; - private const string AUOptions = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU"; - private const string ScheduledInstallDay = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU"; - private const string ScheduledInstallTime = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU"; - - public override string ID() - { - return Properties.Resources.settingsUpdatesDisableUpdates; - } - - public override string Info() - { - return Properties.Resources.settingsUpdatesDisableUpdatesInfo; - } - - public override bool CheckSetting() - { - return !( - RegistryHelper.IntEquals(NoAutoUpdate, "NoAutoUpdate",0) && - RegistryHelper.IntEquals(AUOptions, "AUOptions", 2) && - RegistryHelper.IntEquals(ScheduledInstallDay, "ScheduledInstallDay", 0) && - RegistryHelper.IntEquals(ScheduledInstallTime, "ScheduledInstallTime", 3) - ); - } - - public override bool DoSetting() - { - try - { - Registry.SetValue(NoAutoUpdate, "NoAutoUpdate", 0, RegistryValueKind.DWord); - Registry.SetValue(AUOptions, "AUOptions", 2, RegistryValueKind.DWord); - Registry.SetValue(ScheduledInstallDay, "ScheduledInstallDay", 0, RegistryValueKind.DWord); - Registry.SetValue(ScheduledInstallTime, "ScheduledInstallTime", 3, RegistryValueKind.DWord); - return true; - } - catch - { } - - return false; - } - - public override bool UndoSetting() - { - try - { - Registry.SetValue(NoAutoUpdate, "NoAutoUpdate", 1, RegistryValueKind.DWord); - - var RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Policies\Microsoft\Windows\WindowsUpdate\AU", true); - RegKey.DeleteValue("AUOptions"); - RegKey.DeleteValue("ScheduledInstallDay"); - RegKey.DeleteValue("ScheduledInstallTime"); - - return true; - } - catch - {} - - return false; - } - - } -} \ No newline at end of file