Skip to content

fix(win): remediate legacy uninstall failures#54

Merged
hqhq1025 merged 2 commits intoOpenCoworkAI:mainfrom
Sun-sunshine06:fix/windows-uninstall-remediation
Mar 20, 2026
Merged

fix(win): remediate legacy uninstall failures#54
hqhq1025 merged 2 commits intoOpenCoworkAI:mainfrom
Sun-sunshine06:fix/windows-uninstall-remediation

Conversation

@Sun-sunshine06
Copy link
Copy Markdown
Collaborator

Summary

  • add a custom NSIS recovery path for legacy Windows uninstall failures instead of leaving users with a generic "cannot close" message
  • bundle a legacy cleanup helper next to Windows release artifacts so support and users can repair broken <=3.1.x installs without manual registry spelunking
  • tighten app shutdown cleanup on quit by closing long-lived resources before uninstall/upgrade retries
  • add focused tests for the installer include and cleanup helper packaging

Why we intentionally do not delete all AppData on uninstall

We are keeping deleteAppDataOnUninstall: false on purpose.

From the user point of view, uninstall + reinstall is often a repair path, not a request to erase all personal state. If we delete AppData by default, we would silently wipe user-owned data such as configuration, provider/API setup, local history/database, and other runtime state that users expect to survive a reinstall.

The safer default is:

  • remove app binaries during uninstall
  • preserve user data by default
  • provide an explicit cleanup path when someone truly wants a full reset

This PR follows that model by shipping a dedicated legacy cleanup helper. Users/support can run it normally to remove broken install leftovers while keeping data, or opt into a stronger reset with -RemoveAppData when they explicitly want everything cleared.

Validation

  • npm.cmd test -- --run tests/build-windows-script.test.ts tests/build-windows-artifacts.test.ts tests/windows-legacy-uninstall-remediation.test.ts

Notes

  • I also attempted tsc --noEmit in the PR worktree, but the local environment currently reports an unrelated missing module issue for rehype-sanitize.

@Sun-sunshine06 Sun-sunshine06 force-pushed the fix/windows-uninstall-remediation branch from f180cea to 6bd44d2 Compare March 19, 2026 09:55
- Replace fragile +3 jump offsets in NSIS macros with named labels
- Increase sandbox cleanup timeout from 10s to 30s to prevent data loss
- Add MCP server shutdown to cleanup path to prevent orphan processes
- Guard dev-mode closeDatabase() with try/catch for robustness
- Add test assertion for MCP shutdown
@hqhq1025 hqhq1025 merged commit d71592c into OpenCoworkAI:main Mar 20, 2026
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.

2 participants