fix(windows): make installer upgrades version aware

This commit is contained in:
cabbage committed 2026-10-27 15:17:52 +00:00
1 parent 6906ed52f2
commit ee7844cb40
14 files changed
+824 -51

No files matched your search

+24
View File
@@ -91,6 +91,30 @@ not inject a tray into another session. One tray may run in each
logged-in session; its exit, failure, disablement, or Explorer restart does not
stop the service or commands.
Double-clicking an already-installed package first checks SCM and the current
desktop's tray. With the same version, a healthy service and visible tray cause
a silent no-op; otherwise it starts only the missing components. Starting a
stopped service requests UAC when required, while restoring just the tray does
not. Pending service transitions are bounded to 30 seconds. These activation
paths do not replace files, rewrite configuration, change startup mode, or show
an installation-success dialog.
A different package version requests UAC, validates the existing TOML with the
candidate's config parser, gracefully closes this desktop's old tray and waits
for its process to exit, stops the SCM service, and atomically replaces its
executable. It preserves the actual SCM executable/config paths, TOML contents,
spool/history, and Automatic/Manual setting, then starts the service and tray.
Version identity uses the PE `ProductVersion` string, including prerelease
labels; missing/dev metadata falls back to SHA-256 file identity. A different
version is an explicit replacement, not an automatic newer-version comparison.
Concurrent interactive setup launches are serialized by a parent-owned global
mutex; another launch during setup exits quietly. Replacement retries transient
file locks for five seconds. A `.previous` executable backup enables best-effort
rollback if replacement/startup fails; an originally running service is restarted
with the prior binary. This is executable rollback, not a spool/schema downgrade
guarantee. Other sessions' trays are not forcibly terminated. Successful fresh
installation/upgrade shows only `Installed and is running on server <server_url>`.
The executable uses the Windows GUI subsystem so service, tray, and internal
helpers do not flash consoles. Human-invoked console modes such as
`--check-config`, install, uninstall, and service configuration first call