fix: Windows CLI uninstall no longer leaves stale commands behind#1169
Conversation
Remove the native install directory from User PATH during Windows uninstall so the command disappears from new shells. Harden the Windows installer to clean PATH-visible uloop-cli npm shims and packages before and after native install, then refresh the checked-in native binaries.
Ensure Windows uninstall removes the persistent User PATH entry before deleting the launcher, and make the Unity UI wait for both the launcher and User PATH entry to disappear. This prevents V3 uninstall from leaving a stale command directory that can confuse older V2 detection while preserving full command-not-found behavior after uninstall.
Run Windows editor uninstall through the CLI binary bundled with the current package when it is available. This lets the V3 UI recover from older installed launchers that can delete uloop.exe while leaving the persistent User PATH entry behind.
Leave an empty package-owned install directory after Windows uninstall so stale Unity Hub process PATH entries do not point at a missing directory while the launcher binary and User PATH entry are still removed.
Allow Settings uninstall to wait for deferred Windows PowerShell cleanup before reporting failure, so the UI does not show a failed uninstall after the launcher and User PATH entry are removed.
Drop the Unity 6.4/6.5 investigation workaround that recreated the Windows install directory and cleaned up an unused legacy marker. The workaround does not prevent the newer Unity Win32Exception path and it adds unnecessary uninstall behavior beyond removing the launcher and PATH entry.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR extends Windows uninstall to remove the native CLI directory from Windows User PATH, adds completion verification that checks both file removal and PATH absence, and supplies platform-aware completion messaging and path utilities across the Go CLI and C# orchestration layers. ChangesWindows Uninstall with PATH Cleanup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Keep Windows installs successful when the native uloop binary already owns persisted PATH even if legacy npm cleanup cannot finish cleanly. Also let fallback uninstall launchers complete without requiring User PATH removal they do not own, and align Go uninstall PATH normalization with the Unity wait logic.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 901181c9-5cce-453c-959f-3a853782ecfe
⛔ Files ignored due to path filters (4)
Packages/src/Cli~/dist/darwin-amd64/uloopis excluded by!**/dist/**and included by nonePackages/src/Cli~/dist/darwin-arm64/uloopis excluded by!**/dist/**and included by nonePackages/src/Cli~/dist/windows-amd64/uloop.exeis excluded by!**/dist/**,!**/*.exeand included by nonescripts/install.ps1is excluded by none and included by none
📒 Files selected for processing (5)
Assets/Tests/Editor/NativeCliInstallerTests.csPackages/src/Cli~/internal/uninstall/command.goPackages/src/Cli~/internal/uninstall/command_test.goPackages/src/Editor/Infrastructure/CLI/NativeCliInstaller.csscripts/test-install-release-filter.sh
🚧 Files skipped from review as they are similar to previous changes (3)
- Packages/src/Cli~/internal/uninstall/command.go
- Assets/Tests/Editor/NativeCliInstallerTests.cs
- Packages/src/Cli~/internal/uninstall/command_test.go
Report only the uninstall cleanup condition that is still pending so fallback launcher failures do not claim Windows User PATH cleanup ownership when that wait was intentionally disabled.
Summary
uloop-clishims more reliably before making the native launcher first on PATH.User Impact
uloopfrom the package-owned Windows install directory.Changes
Verification
go test ./internal/uninstall ./internal/cliscripts/check-go-cli.shPackages/src/Cli~/dist/windows-amd64/uloop.exe compile --project-path C:\Users\booql\oss\unity-cli-loopPackages/src/Cli~/dist/windows-amd64/uloop.exe run-tests --project-path C:\Users\booql\oss\unity-cli-loop --test-mode EditMode --filter-type regex --filter-value NativeCliInstallerTestsuloop.exeis removed and no legacy marker is created.