Originally created by: kumaakh
Summary
On Windows, reinstalling apra-fleet while the MCP server is running fails because the OS holds a file lock on the executing binary. The installer cannot overwrite `apra-fleet.exe` while it is in use.
Reproduction
- Install apra-fleet — MCP server starts (registered in Claude Code, loaded automatically).
- Download a newer binary.
- Run `apra-fleet-win-x64.exe install` with the MCP server still running.
- Installer fails when trying to replace the binary (access denied / file in use).
Root cause
Windows locks executables while they are running. `apra-fleet.exe` is loaded as an MCP server by Claude Code, so it remains running in the background. Any attempt to overwrite it during installation hits a file-lock error.
Expected behaviour
The installer detects a running MCP server process and either stops it automatically (with `--force`) or prompts the user to stop it manually.
Proposed fix
`--force` flag
Add `apra-fleet install --force` that kills the running server before replacing the binary:
- On Windows: `taskkill /F /IM apra-fleet.exe`
- On macOS/Linux: `pkill -f apra-fleet`
Then replaces the binary and prints instructions to restart Claude Code.
Busy/running prompt (without `--force`)
When the installer detects a running process and `--force` was not passed, show a clear error:
```
Error: apra-fleet is currently running (MCP server process detected).
Stop it first, or re-run with --force to kill it automatically:
apra-fleet install --force
On Windows you can also run: taskkill /F /IM apra-fleet.exe
```
Steps
- Before copying the binary, check if a fleet process is running.
- If `--force`: kill it, proceed with install, print "Restart Claude Code to reload the MCP server."
- If not `--force`: print the prompt above and exit with a non-zero code.
Acceptance criteria
- [ ] `apra-fleet install` on a running server shows the prompt with `--force` hint
- [ ] `apra-fleet install --force` kills the running server and completes install
- [ ] Works on Windows (taskkill) and macOS/Linux (pkill)
- [ ] Post-install message reminds user to restart Claude Code / run `/mcp`
- [#95] — installer fails at step 5 if MCP entry already exists in config (separate issue, different root cause)
Originally posted by: kumaakh
Fixed in commit 211f043 (PR [#128]).
apra-fleet installnow detects a running server and shows a clear error with the--forcehint.apra-fleet install --forcekills the running process and completes the install on all platforms.Related
Tickets:
#128Ticket changed by: kumaakh