Repository navigation
Start the Windows update recovery watcher under a neutral file name - #6505
Merged
Merged
Conversation
Refs #5981. Arming update install recovery copies Cave's executable and starts the copy at the updater's pre-exit teardown. The copy was named install-watch-<pid>.exe. With UAC on, Windows installer detection refuses to start an executable whose file name contains "install" or "update" unless its manifest declares a requestedExecutionLevel, and Tauri's default manifest declares none. Packaged Windows 11 acceptance (v0.5.21 to v0.5.22, filtered administrator, EnableInstallerDetection=1) traced the copy exiting with STATUS_ELEVATION_REQUIRED 3 ms after it started. A declined UAC prompt then left Cave closed with no recorded outcome. The same app.exe bytes failed with error 740 as install-watch-probe.exe and update-probe.exe, and started as cave-recovery-probe.exe. Started under a neutral name with Cave's own arguments, the watcher found the client msiexec, read 1602 after the decline, recorded the cancelled outcome and relaunched Cave. The copy is now cave-recovery-<pid>.exe. A test keeps the name free of installer-detection keywords. The banner that shows the outcome also needs the packaged origin's update_install_outcome grant (#6503).
Refs #5981. windows-startup.yml pins the number of windows_update_recovery tests it expects, and its contract mirrors the pin. The new installer-detection name test makes it 7. On the first run all 7 passed on Windows, and the lane failed only on "Unexpected test count".
This was referenced Nov 20, 2026
Open
4 of 17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #5981. #5981 stays open: the end-to-end declined-UAC UI row still needs a release that carries this PR and #6503, plus a newer release to update to.
Problem
Before Restart & install,
arm_update_install_recoverycopies Cave's executable. The updater's pre-exit teardown then starts the copy as a watcher, which relaunches Cave after a declined or failed install. The copy was namedinstall-watch-<pid>.exe.With UAC on, Windows installer detection refuses to start an executable whose file name contains words such as "install", "setup" or "update" unless its manifest declares a
requestedExecutionLevel. Tauri's default manifest declares none. So the watcher never ran, and a declined UAC prompt left Cave closed with no recorded outcome.Evidence (packaged Windows 11 VM for #5981, disposable admin profile,
EnableInstallerDetection=1)The UI cannot arm recovery today (#6503), so the main webview was moved over the debug port to Cave's bundled origin. That origin is granted the recovery commands. From there v0.5.21 ran its own sequence against the production v0.5.22 feed: arm, signature-verified download, install, disarm on a rejected install.
Run 1:
msiexecstarted and v0.5.21 exited. UAC was declined:consent.exeexit 1223, Windows Installer status 1602. No watcher process appeared, nothing was recorded, and Cave stayed closed.Run 2, with a WMI process start/stop trace:
install-watch-9772.exestarted and exited 3 ms later with0xC000042C(STATUS_ELEVATION_REQUIRED).A/B control (same
app.exebytes, run as the profile user, with a malformed watcher flag that should exit 2):install-watch-probe.exe: error 740, "The requested operation requires elevation"update-probe.exe: error 740cave-recovery-probe.exe: exit 2app-copy-probe.exe: exit 2Run 3: Cave's own copy failed again. The same bytes, started as
cave-recovery-watch.exewith Cave's exact watcher arguments:msiexec, which exited 1602 after the decline;{"kind":"cancelled","exitCode":1602,...};The relaunched v0.5.21 UI still showed only a fresh update offer: its loopback page is refused
update_install_outcomeby ACL (Grant the packaged UI its Windows recovery and update-link commands #6503). Read from the bundled origin, the outcome command returned the record.Change
cave-recovery-<pid>.exe, chosen bywatcher_copy_file_name(). Only the file name matters; the directory staysupdate-install-watch, and its leftover copies are still removed at startup.docs/windows-update-preparation.mdrecords the constraint and the acceptance evidence.Validation
cargo test --lib windows_update_recovery: 6/6 pass on macOS.rustfmt --checkon the changed file is clean, clippy reports nothing in the changed lines, anddocs-checkandgit diff --checkare clean.26c2d9fe6(run 43879698067): the Windows native lane built the app and ran all 7windows_update_recoverytests on Windows, including the new one. All passed, but the lane failed with "Unexpected test count", becausewindows-startup.ymland its contract insrc-tauri/release-runtime.test.mjspinned the count at 6. The follow-up commit raises the pin to 7. The contract passes locally, and actionlint is clean.