[GH-ISSUE #3484] [Issue]: Windows uninstaller deletes packages/server/data (all user data) before the keep-data prompt #1882

Closed
opened 2026-10-21 05:43:30 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @kolacheee on GitHub (Jul 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3484

Originally assigned to: @SpicyMarinara, @kolacheee on GitHub.

Summary

The Windows uninstaller's comment promises to preserve user data, but the code removes the entire packages tree — which contains the canonical data directory packages/server/data (chats, characters, images, the database) — and the "keep your data?" prompt only guards the legacy top-level data\ folder.

Why this is a problem: the comment and the prompt both tell the user their data is safe while the code deletes it.
What it negatively affects: complete, silent user-data loss on uninstall for default installer-based Windows installs, even when the user explicitly chooses to keep their data.

Expected behavior

Uninstalling keeps packages/server/data unless the user explicitly declines the keep-data prompt.

Actual behavior

  • win/installer/installer.nsi:824-827 — the comment "Only remove known app directories — preserve user data if they stored it elsewhere" is immediately followed by RMDir /r "$INSTDIR\packages", which unconditionally wipes packages\server\data. The keep-data prompt only protects $INSTDIR\data (the legacy location).
  • win/installer/installer.nsi:830 — RMDir /r "$INSTDIR\installer" targets a pre-win/-reorg path that no longer exists, and nothing removes $INSTDIR\win, so uninstall leaves win\installer and win\launcher behind.
  • win/installer/installer.nsi:3 — header claims the installer is "Cross-compiled from macOS"; CI builds it on ubuntu-latest.

Steps to reproduce

  1. Install Marinara with the Windows installer and create a chat (data lands in packages\server\data).
  2. Run the uninstaller and choose to KEEP your data at the prompt.
  3. packages\server\data is deleted anyway.

Note: verified by reading the NSIS source; not executed on a disposable machine. The RMDir /r "$INSTDIR\packages" line runs unconditionally before/independently of the prompt guard, so the outcome follows from the script.

Environment

  • Marinara Engine version: 2.2.0 (staging @ 45b650de9)
  • Install type: installer (Windows)
  • OS + version: Windows (any supported)
  • Browser or app shell: N/A

Logs, screenshots, or video

N/A — file/line references above point at the exact code.

Additional context

Found by a repo-wide read-only sweep for dead code and stale comments; adversarially re-verified before filing. No fix started — filing for triage. Suggested direction: move the packages removal behind the same keep-data decision, or exclude packages\server\data from the recursive delete and remove it only when the user declines to keep data. Part of a coordinated set of sweep catalogue issues filed together.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Jul 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3484 Originally assigned to: @SpicyMarinara, @kolacheee on GitHub. ## Summary The Windows uninstaller's comment promises to preserve user data, but the code removes the entire `packages` tree — which contains the canonical data directory `packages/server/data` (chats, characters, images, the database) — and the "keep your data?" prompt only guards the legacy top-level `data\` folder. **Why this is a problem:** the comment and the prompt both tell the user their data is safe while the code deletes it. **What it negatively affects:** complete, silent user-data loss on uninstall for default installer-based Windows installs, even when the user explicitly chooses to keep their data. ## Expected behavior Uninstalling keeps `packages/server/data` unless the user explicitly declines the keep-data prompt. ## Actual behavior - [ ] `win/installer/installer.nsi:824-827` — the comment "Only remove known app directories — preserve user data if they stored it elsewhere" is immediately followed by `RMDir /r "$INSTDIR\packages"`, which unconditionally wipes `packages\server\data`. The keep-data prompt only protects `$INSTDIR\data` (the legacy location). - [ ] `win/installer/installer.nsi:830` — `RMDir /r "$INSTDIR\installer"` targets a pre-`win/`-reorg path that no longer exists, and nothing removes `$INSTDIR\win`, so uninstall leaves `win\installer` and `win\launcher` behind. - [ ] `win/installer/installer.nsi:3` — header claims the installer is "Cross-compiled from macOS"; CI builds it on `ubuntu-latest`. ## Steps to reproduce 1. Install Marinara with the Windows installer and create a chat (data lands in `packages\server\data`). 2. Run the uninstaller and choose to KEEP your data at the prompt. 3. `packages\server\data` is deleted anyway. Note: verified by reading the NSIS source; not executed on a disposable machine. The `RMDir /r "$INSTDIR\packages"` line runs unconditionally before/independently of the prompt guard, so the outcome follows from the script. ## Environment - Marinara Engine version: 2.2.0 (staging @ 45b650de9) - Install type: installer (Windows) - OS + version: Windows (any supported) - Browser or app shell: N/A ## Logs, screenshots, or video N/A — file/line references above point at the exact code. ## Additional context Found by a repo-wide read-only sweep for dead code and stale comments; adversarially re-verified before filing. No fix started — filing for triage. Suggested direction: move the `packages` removal behind the same keep-data decision, or exclude `packages\server\data` from the recursive delete and remove it only when the user declines to keep data. Part of a coordinated set of sweep catalogue issues filed together. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:43:30 +07:00
Author
Owner

@kolacheee commented on GitHub (Jul 11, 2026):

will do tomorrow

<!-- gh-comment-id:4949108170 --> @kolacheee commented on GitHub (Jul 11, 2026): will do tomorrow
Author
Owner

@kolacheee commented on GitHub (Jul 12, 2026):

this has not been fixed yet btw

<!-- gh-comment-id:4949250128 --> @kolacheee commented on GitHub (Jul 12, 2026): this has not been fixed yet btw
Author
Owner

@SpicyMarinara commented on GitHub (Jul 12, 2026):

@kolacheee I am taking this into the combined fix PR #3516 now, including the canonical packages/server/data preservation path and the stale Windows installer cleanup, so please avoid duplicating the implementation.

<!-- gh-comment-id:4950692955 --> @SpicyMarinara commented on GitHub (Jul 12, 2026): @kolacheee I am taking this into the combined fix PR #3516 now, including the canonical packages/server/data preservation path and the stale Windows installer cleanup, so please avoid duplicating the implementation.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 12, 2026):

Fixed in #3516 (commit d10626344): the Windows uninstaller now decides data retention before cleanup, preserves and restores packages/server/data, supports legacy data, and the NSIS source guard plus native compilation pass.

<!-- gh-comment-id:4950776005 --> @SpicyMarinara commented on GitHub (Jul 12, 2026): Fixed in #3516 (commit d10626344): the Windows uninstaller now decides data retention before cleanup, preserves and restores packages/server/data, supports legacy data, and the NSIS source guard plus native compilation pass.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1882
No description provided.