Skip to content

Close iMirror during silent update handoff - #48

Merged
Balragon merged 1 commit into
mainfrom
codex/auto-close-before-update-install
Jul 1, 2026
Merged

Close iMirror during silent update handoff#48
Balragon merged 1 commit into
mainfrom
codex/auto-close-before-update-install

Conversation

@Balragon

@Balragon Balragon commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Close iMirror immediately after launching the downloaded silent installer so setup can replace files without asking the user to close the app.
  • Add /SUPPRESSMSGBOXES to the installer launch arguments while keeping close/restart and IMIRROR_LAUNCH relaunch behavior.
  • Add UpdateLauncher tests covering silent close/relaunch arguments and missing installer validation.

Validation

  • dotnet build .\iMirror.sln -c Release
  • dotnet test .\MacMirrorReceiver.Tests\MacMirrorReceiver.Tests.csproj -c Release

@Balragon
Balragon merged commit 53ddb61 into main Jul 1, 2026
1 check passed
Balragon added a commit that referenced this pull request Jul 3, 2026
)

* Refactor update workflow into UpdateController

Move the update orchestration out of MainWindow into a new
UpdateController: startup/manual update checks, the automatic-notice
policy, download, installer handoff, and the graceful shutdown from #48.
MainWindow keeps only the WPF concerns (update-notice controls, status
text, download-progress text) behind a new IUpdateNoticeView seam, and
ISettingsHost/SettingsWindow are unchanged apart from delegating to the
controller.

UpdateService (SHA-256 fail-closed download) and UpdateLauncher
(/IMIRROR_LAUNCH=1 silent handoff) are reused as-is; no behavior change.
The controller takes injected delegates so it is unit-testable without
WPF; adds 18 UpdateController tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Harden update download lifecycle: cleanup and shutdown cancellation

Two fixes to the update workflow, built on the UpdateController
extraction (#49):

1. Downloaded installers were never deleted, so
   %LOCALAPPDATA%\iMirror\Updates grew by one setup.exe per update
   forever. UpdateService.TryCleanUpDownloadedInstallers now removes
   leftover .exe/.download files at startup (best-effort; files locked
   by a still-running installer are skipped until the next start).

2. Update checks and installer downloads used CancellationToken.None,
   so an in-flight download raced process teardown when the user closed
   the app. UpdateController now owns a shutdown CancellationTokenSource
   that MainWindow cancels at the start of ShutdownApplicationAsync; a
   canceled install returns quietly without flashing the retry UI.

The SHA-256 fail-closed verification and the #48 installer handoff
(launch installer, then graceful shutdown, relaunch via
/IMIRROR_LAUNCH=1) are unchanged. Adds 7 tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant