Commit Graph
1 Commits
Author SHA1 Message Date
Christian Manivong 4108581580 feat(updates): Windows Update -- search, pending updates, install in a SYSTEM task, history (NetOrk/netork#2892)
refresh_available_updates runs the Windows Update Agent's search against the
configured source and keeps its reading under HKLM\SOFTWARE\napalm-windows;
get_available_updates reads it back without a search, leaving out what the
history shows installed since, and raises PackageIndexMissing before the
first search. Each update carries its title, KB articles, CveIDs and
MsrcSeverity, and is named by its title without month, KB and version, so
next month's cumulative update keeps the name. Previews, feature upgrades and
drivers are left out.

apply_updates installs in a one-shot task running as SYSTEM, since Windows
refuses downloads and installs to a network logon. The task's script and the
exact UpdateID:revision chosen travel in the run's registry key; it searches
again, refuses what no longer matches exactly, what asks for input or has
unaccepted licence terms, installs nothing while a restart is pending and
never restarts. Its log is followed line by line; the next run sweeps what a
dead run left. get_scheduled_jobs shows these tasks as an application's.

get_update_history reads QueryHistory, one transaction per entry, with the
ClientApplicationID as requested_by.
2026-12-01 12:57:20 +01:00