Skip to content

Remove the old executable reliably after an update restart (v0.3.1) - #5

Merged
SkippyNet merged 1 commit into
mainfrom
fix/update-cleanup
Nov 8, 2026
Merged

SkippyNet merged 1 commit into
mainfrom
fix/update-cleanup

Conversation

@SkippyNet

Copy link
Copy Markdown
Owner

What does this change?

Found while testing the self-update from v0.2.0 to v0.3.0: the update installed correctly, but usb-forge.exe.old was left next to the app. The restarted process tries to delete it immediately on startup, while the previous process is still exiting and Windows still has the file locked, so the delete fails. The file was only cleaned up on the next launch.

cleanup_after_update (Windows) now retries in a background thread for up to 15 seconds. Startup is not delayed, and nothing changes when there is no .exe.old.

Checklist

  • cargo fmt --all --check, cargo clippy --workspace --all-targets --locked -- -D warnings and cargo test --workspace --locked pass
  • Tested on: Windows 11, Ubuntu via WSL (fmt/clippy/tests)
  • New downloads come from the project's official source and are pinned to a SHA-256 that project publishes (no new downloads)
  • No new dependencies, or each new dependency is explained below
  • Version bumped in Cargo.toml (and Cargo.lock) for this feature or fix (0.3.0 → 0.3.1)
  • No changes to disk-safety filtering, the updater, signing, or CI, or those changes are explained below

Notes for reviewers

Touches the updater's post-restart cleanup only. Download, signature verification and the executable swap are unchanged. This release is also the second round of updater testing (v0.3.0 → v0.3.1).

🤖 Generated with Claude Code

The restarted app tried once to delete usb-forge.exe.old while the previous
process was still exiting, so the delete failed and the file stayed until the
next launch. Retry for up to 15 seconds in the background.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T19:18:00.687808Z 78c6354 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SkippyNet
SkippyNet merged commit 1c5dd69 into main Nov 8, 2026
3 checks passed
@SkippyNet
SkippyNet deleted the fix/update-cleanup branch November 8, 2026 19:24
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