From aa01e8b382bf5668d7d4221dfed29c2d02880cec Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 11 Jun 2026 23:15:22 -0700 Subject: [PATCH] fix(uninstall): sweep legacy distro-suffixed Studio shortcuts The Windows uninstaller removed only the exact name "Unsloth Studio.lnk", orphaning legacy "Unsloth Studio (WSL - ).lnk" shortcuts left by pre-release dev builds. Glob "Unsloth Studio (*.lnk" across Desktop + Start Menu so the documented "remove the shortcuts" contract holds regardless of suffix. Validated on N1X: both canonical and suffixed .lnk removed. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/uninstall.ps1 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/uninstall.ps1 b/scripts/uninstall.ps1 index 287531fd71..81f4dd58cb 100644 --- a/scripts/uninstall.ps1 +++ b/scripts/uninstall.ps1 @@ -341,13 +341,17 @@ function Uninstall-UnslothStudio { } # ── Remove desktop and Start Menu shortcuts ── + # Canonical name is "Unsloth Studio.lnk"; also sweep legacy distro-suffixed + # names ("Unsloth Studio (WSL - ).lnk") left by pre-release dev builds. _Step "Removing desktop and Start Menu shortcuts..." - try { - $desktop = [Environment]::GetFolderPath("Desktop") - if ($desktop) { _RemovePath (Join-Path $desktop "Unsloth Studio.lnk") } - } catch { } - if ($env:APPDATA) { - _RemovePath (Join-Path $env:APPDATA "Microsoft\Windows\Start Menu\Programs\Unsloth Studio.lnk") + $shortcutDirs = @() + try { $d = [Environment]::GetFolderPath("Desktop"); if ($d) { $shortcutDirs += $d } } catch { } + if ($env:APPDATA) { $shortcutDirs += (Join-Path $env:APPDATA "Microsoft\Windows\Start Menu\Programs") } + foreach ($dir in $shortcutDirs) { + if (-not (Test-Path -LiteralPath $dir)) { continue } + _RemovePath (Join-Path $dir "Unsloth Studio.lnk") + Get-ChildItem -LiteralPath $dir -Filter "Unsloth Studio (*.lnk" -ErrorAction SilentlyContinue | + ForEach-Object { _RemovePath $_.FullName } } # Invalidate the Win11 Start Menu tile cache so the removed shortcut's tile # disappears promptly instead of lingering stale (mirrors install.ps1's