Skip to content

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

Closed

Description

@David-Noble-at-work

self uninstall, run on Windows from the installed copy, leaves the program behind with no record of it. At 01634491:

  • It cannot remove the running .exe. Windows refuses to delete a running executable. removeRecordedFiles warns and adds the file to skipped (cmd/internal/cli/selfinstall.go:689-692).
  • It reports the file as modified. The summary lists skipped under "Skipped N modified file(s)" (selfinstall.go:749), which is the wrong reason.
  • It then deletes the manifest (selfinstall.go:722, best-effort). The .exe stays on disk and nothing records it, so no later self install or self uninstall can reach it.

#1001 (#947) taught self install to rename a running .exe aside to <name>.exe.old and record it; uninstall does not use that path.

Found 2026-09-30 during #947's research.

Resolution

Uninstall run from the installed copy on Windows removes what it can, renames the running .exe aside and keeps a record of it (or keeps the manifest) so a later run can finish, and names a file it could not remove as such, not as modified.

Plan and design documents

Kind Document
Plan docs/plans/fix/1003-self-uninstall-on-windows-leaves.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions