UpdateLock README

The project's README from github.com/hhht110/UpdateLock. As one markdown file: README.md.

Win7/10/11自动更新关闭工具v3.3

一个原生 C++/Win32 单文件工具,自动识别 Windows 7、Windows 10、Windows 11 或 Windows Server 2016,并使用对应策略关闭 Windows Update。

主要特性

系统策略

Windows 7

只处理:

不会处理 BITS、CryptSvc、TrustedInstaller、SoftwareDistribution、Catroot2 或系统文件。

原始状态保存到:

%ProgramData%\UpdateLock\windows7-original-state-v1.txt

Windows 10 / Windows 11

处理原六项策略:

2.1 额外设置:

该策略会隐藏或禁用 Windows Update 页面中的手动检查、下载和安装入口。Win10/11 不停止 wuauserv、BITS、UsoSvc、WaaSMedicSvc 或 Update Orchestrator。

备份文件:

%ProgramData%\UpdateLock\policy-backup-v1.txt
%ProgramData%\UpdateLock\windows-update-access-backup-v1.txt

原六项备份格式保持兼容,2.1 的访问封锁使用独立备份文件。

Windows Server 2016

仅对真实版本 10.0 / Build 14393 / Server 启用,复用现代系统的可恢复注册表控制,但不会把 Server 当成桌面 Windows 10:

Windows 11 升级锁定在 Server 2016 上不可用,底层调用同样拒绝写入。其他尚未验证的 Windows Server 版本不会被自动放行。

Windows 10 禁止升级到 Windows 11

Windows 10 界面另外提供“禁止升级到 Windows 11”和“恢复允许升级到 Windows 11”。该功能与自动更新控制独立,只写入:

功能版本按 RtlGetVersion 的真实 Build 与 DisplayVersion、ReleaseId 交叉校验,支持 1507 至 22H2 的已知 Build;未知 Build 会拒绝写入。首次修改前的原始存在性、注册表类型和值保存到:

%ProgramData%\UpdateLock\windows11-upgrade-backup-v1.txt

Windows 7、Windows 11 和 Windows Server 2016 上该组按钮不可用,底层调用也会拒绝写入。该功能不会禁用更新服务、修改 TPM/Secure Boot 或删除系统文件,也不会把旧版 Windows 10 自动升级到 22H2。

Windows 11 功能版本显示支持 24H2、25H2 和 26H2;当注册表 DisplayVersion 不可用时,会按真实 Build 识别,26H2 对应 Build 26300 系列。

重要影响

关闭 Windows Update 驱动更新后,新接入的 USB 或其他硬件可能无法自动在线获取驱动。此时可从硬件厂商官网下载并离线安装驱动,或先恢复更新、安装驱动后再重新关闭。

不要在系统正在安装或卸载更新时运行关闭或恢复操作。

构建

需要 Visual Studio Build Tools、MSVC v141 工具链和 Windows 10 SDK 19041。在 native 目录运行:

build-native.cmd

构建输出位于 native\build。脚本同时生成 UpdateLock.exe 和只使用临时目录的原生测试程序。

发布包只分发一个文件:Win7-10-11自动更新关闭工具v3.3.exe。NativeTests.exe、目标文件和资源文件均不放入发布包。

下载与校验

普通用户请从 GitHub Releases 下载单文件 EXE,并使用 Release 中公布的 SHA-256 校验文件完整性。

当前 v3.3 EXE 的作者元数据为“啊常用户”,但尚未使用受信任的 Authenticode 证书签名,因此 Windows 仍可能提示“未知发布者”或显示 SmartScreen 警告。加壳或混淆不会建立发布者信誉,反而可能提高安全软件的启发式风险;正式分发应使用一致的受信任 Authenticode 证书签名,并对明确误报逐版本提交厂商复核。

验证边界

已完成原生构建、单元测试和二进制依赖检查。不同补丁级别和定制系统可能存在行为差异,真实机器操作前应确保重要数据已有备份。

本次发布已检查 Windows 10 运行界面;Windows 7、Windows 11 和 Windows Server 2016 未在本次发布中重新完成实机禁止、重启及恢复全流程验证。自动化测试不能替代这些实机验证。

窗口支持最大化和拖动调整大小,启动时会根据当前屏幕工作区选择初始尺寸;窗口变化时标题、字体、卡片、按钮、Badge 和图标会按客户区整体缩放,当可用高度仍不足时再显示垂直滚动条,确保底部说明和操作按钮仍可访问。状态显示表示所检查策略达到目标值,不代表所有后台更新通道永久停止。

UpdateLock (hhht110/UpdateLock)

Searching Database…

What is this?This is a native Windows utility that automatically detects whether you're on Windows 7, 10, or 11, and applies the matching registry/service policies to turn off Windows Update, with a one-click way to undo it.
Is this an installer, a script, or something else?It's a single standalone native Win32 EXE, not an installer or a script - no .NET and no extra runtime dependencies are required to run it.
How do I get it running?Download the prebuilt UpdateLock.exe from the GitHub Releases page, verify it against the published SHA-256 checksum, then run it with administrator rights.
Do I need to install anything first?Just running the released EXE needs nothing else - it's statically linked. Building it yourself from source requires Visual Studio Build Tools, the MSVC v141 toolchain, and the Windows 10 SDK 19041.
What's the main catch with turning updates off?With driver updates disabled, newly plugged-in USB or other hardware may not auto-fetch drivers online, so you'd install drivers offline or briefly re-enable updates. The EXE also isn't signed yet with a trusted Authenticode certificate, so Windows may show an 'unknown publisher' or SmartScreen warning.
Which Windows versions does it actually support?It targets Windows only, specifically Windows 7 SP1, Windows 10, and Windows 11, each handled with version-specific policies via its own detection logic.
What exactly gets changed on Windows 7 versus Windows 10/11?On Win7 it only touches NoAutoUpdate, DisableWindowsUpdateAccess, and stops/disables the wuauserv service. On Win10/11 it manages six policies like NoAutoUpdate, AUOptions, and NoAutoRebootWithLoggedOnUsers, plus an optional SetDisableUXWUAccess=1 setting that hides the manual check/install controls in the Update page, without stopping BITS or UsoSvc.
Can I undo the changes later?Yes - before making any change it saves your original settings to a backup file, and offers one-click restore with write-then-read verification and automatic rollback if something fails.
Does it rely on PowerShell or sc.exe under the hood?No, it talks to Windows directly via the Win32 Registry API and the Service Control Manager API, and never shells out to PowerShell, CMD, reg.exe, or sc.exe.
Is it safe to run while Windows is mid-update?No - the README warns not to run the disable or restore operation while the system is actively installing or uninstalling updates, and recommends backing up important data before using it on a real machine.
Creator
hhht110
Size
0.3 MB
Stars
245
Age
3mo
Commits · 90 Days