修复:Windows 更新检查仅探测程序路径,避免慢磁盘校验超时

This commit is contained in:
2026-11-05 14:40:33 +08:00
parent b208f93945
commit 4843768694
5 changed files with 278 additions and 1 deletions
+4 -1
View File
@@ -197,7 +197,10 @@ def validate_release(envelope, root=ROOT):
raise UpdateError('更新缺少必要程序文件。')
if KEY not in old_files or digest(destination(root, KEY)) != old_files[KEY]['sha256']:
raise UpdateError('更新信任公钥校验失败。')
for name in set(old_files) | set(files):
# 只探测本次会备份、删除或替换的程序路径;运行环境保持原样。
# 完整清单仍逐项验证路径语法、重复项、摘要以及运行环境指纹。
old_program = {name for name in old_files if program_path(name)}
for name in old_program | set(files):
destination(root, name)
return release