Delete BlockMajorUpdates.cs
This commit is contained in:
parent
ca72007781
commit
51a7a58ba8
1 changed files with 0 additions and 59 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue