fix(windows): embed legacy cleanup tool in installer#82
Open
Sun-sunshine06 wants to merge 4 commits intoOpenCoworkAI:mainfrom
Open
fix(windows): embed legacy cleanup tool in installer#82Sun-sunshine06 wants to merge 4 commits intoOpenCoworkAI:mainfrom
Sun-sunshine06 wants to merge 4 commits intoOpenCoworkAI:mainfrom
Conversation
hqhq1025
reviewed
Mar 27, 2026
Collaborator
hqhq1025
left a comment
There was a problem hiding this comment.
⚠️ Conditional Approve — NSIS flow verified correct, minor issues
I traced the full NSIS installer flow end-to-end. The self-elevation mechanism is safe (no injection vectors — $PSCommandPath + known switches only). ExecShell "open" on .cmd files works correctly.
Security notes
- Low risk: Predictable
%TEMP%\Open-Cowork-Legacy-Cleanuppath could be pre-empted with a directory junction by a local attacker. Consider clearing any pre-existing directory before extraction:IfFileExists "$OpenCoworkCleanupDir\*.*" 0 +2 RMDir /r "$OpenCoworkCleanupDir"
-ExecutionPolicy Bypasson the elevated process is standard for embedded utilities but could trigger AV heuristics. Worth noting in release notes.
Code quality (non-blocking, suggest follow-up)
copyDirWithRetryhas unreachablereturn maxAttemptsafter the loop (dead code)listRelativeFiles(after-pack.js) andcollectRelativeFiles(stage-mcp-resources.js) are identical — should share- Retry-with-backoff logic is duplicated between files
- Extracted temp files (
%TEMP%\Open-Cowork-Legacy-Cleanup\) are never cleaned up after execution - Most new tests are string-matching source code rather than behavioral tests — very brittle
- Windows cleanup helpers are copied twice when using
build-windows.js(once viaafterAllArtifactBuildhook, once in script exit handler)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.exe%TEMP%\Open-Cowork-Legacy-Cleanupand offer to launch it immediately when the legacy uninstaller fails.cmdand.ps1helpers with Windows build artifactsTesting
Verification
A direct Windows
electron-buildersmoke build completed successfully with the embedded-cleanup installer changes, and the shared artifact hook still emitted:Open Cowork-3.3.0-beta.7-win-x64.exeOpen-Cowork-Legacy-Cleanup.cmdOpen-Cowork-Legacy-Cleanup.ps1