Skip to content

fix(cli): self uninstall finishes on Windows, keeps its record, and names a kept file by its reason - #1036

Merged
David-Noble-at-work merged 3 commits into
developfrom
fix/1003-self-uninstall-on-windows-leaves
Oct 5, 2026
Merged

David-Noble-at-work merged 3 commits into
developfrom
fix/1003-self-uninstall-on-windows-leaves

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lane 26 of #949.

  • The running image is deleted on Windows (self uninstall on Windows leaves the running .exe behind, calls it modified, and deletes the manifest that recorded it #1003). Windows refuses to delete a mapped image, so self uninstall run from the installed copy left <tool>.exe behind. It now hands the image's path to cmd.exe -- always present, copied nowhere, left nowhere -- which retries the delete until this process releases the image, then stops. No self-copy, no hidden flag, no elevation.
  • A kept file is named by its reason, on every platform. removeRecordedFiles reported a changed file, a refused file and an unreadable file all as "modified". It now says which: changed since installed (kept, it may be your edit), could not remove (access denied or in use), or could not read to check. This corrects Unix too.
  • The manifest is kept while it still records a file on disk. It was deleted outright, so a file left behind could never be found again. It is now rewritten to what remains and deleted only when nothing does, so a later run finishes what one could not. The running image stays recorded until a run confirms it gone.

Unix needs none of the Windows machinery: it unlinks a running binary in place, so a !windows build stub defers nothing and the image is removed inline.

  • Plan -- docs/plans/fix/1003-self-uninstall-on-windows-leaves.md. It stays active: its last box is a real install-and-uninstall on a Windows machine, owed until one is at hand; the Windows CI scenario stands in.

Resolves #1003

Test plan

  • make test (108 packages), make vet-all and make lint-all on linux, darwin and windows, star lint go, star lint shell; the PowerShell gate, 0 findings; cross-compiles for windows
  • New unit tests: a refused file is not called "modified", and the manifest is kept while a recorded file remains -- both failed against the parent commit, both pass
  • make test-scenario on linux: self uninstall run from the installed copy removes everything, the binary included
  • The Windows CI legs: the same scenario, where the running image cannot be deleted in place
  • After the merge: an install and uninstall on a Windows machine through the published installer leaves nothing behind (owed until a Windows machine is at hand)

Time

Marker UTC Elapsed
opened (first commit) 2026-10-05T15:40:57Z —
submitted (PR opened) 2026-10-05T18:09:02Z 2.5 h after opened
merged 2026-10-05T18:28:04Z 0.3 h after submitted; 2.8 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

… a file remains, and uninstall runs from the installed copy, failing (#1003)
…ecord, and on Windows deletes the running image after it exits (#1003)
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.

self uninstall on Windows leaves the running .exe behind, calls it modified, and deletes the manifest that recorded it

1 participant