Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#1967 Self-update fails on Windows: running binary cannot be replaced due to file locking

Opened by stack72 · 9/2/2026· Shipped 9/2/2026

Description

swamp update fails on Windows when replacing the running binary. The current implementation in src/infrastructure/update/http_update_checker.ts uses Deno.rename() to replace the binary in-place, but Windows locks executables that are currently running — the rename fails with an EBUSY or EPERM error.

This is a known Windows constraint: you cannot overwrite or delete a running .exe, but you can rename it.

Steps to Reproduce

  1. Install swamp on Windows
  2. Run swamp update when a newer version is available
  3. Binary replacement fails — the running swamp.exe cannot be overwritten

Expected Behavior

swamp update should successfully replace the binary on Windows.

Proposed Fix

Use the standard Windows rename-and-replace pattern:

  1. Rename the running binary from swamp.exe to swamp.old.exe (Windows allows renaming a locked file, just not overwriting or deleting it)
  2. Write the new binary as swamp.exe
  3. On next launch, add a startup cleanup step that detects and deletes swamp.old.exe if it exists

Files to Change

  • src/infrastructure/update/http_update_checker.tsreplaceBinary() needs a Windows-specific path: rename current to .old, write new binary, skip Deno.chmod (already handled)
  • Startup path (likely src/cli/ entrypoint) — add cleanup for stale .old.exe on launch

Environment

  • Platform: Windows (x86_64)
  • Relevant code: src/infrastructure/update/http_update_checker.ts (replaceBinary / downloadAndInstall)
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 9 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

9/2/2026, 7:38:50 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack729/2/2026, 6:29:38 PM

Sign in to post a ripple.