From fabdf1ec30b657fe83f22833c10bd3118aceca72 Mon Sep 17 00:00:00 2001 From: mintty Date: Mon, 12 Aug 2019 00:00:00 +0200 Subject: [PATCH] uninstall to remove desktop shortcut (#184) --- config-distros.sh | 8 ++++++++ uninstall.bat | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config-distros.sh b/config-distros.sh index d375082..f3cef4c 100755 --- a/config-distros.sh +++ b/config-distros.sh @@ -275,6 +275,14 @@ config () { cmd /C del "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\$name Terminal.lnk" cmd /C del "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$name.bat" cmd /C del "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$name~.bat" + + if [ "$name" = "WSL" ] + then + # determine actual Desktop folder + desktopkey='\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Desktop' + desktop=`regtool get "$desktopkey"` + cmd /C del "$desktop\\$name Terminal.lnk" + fi else # desktop shortcut in %USERPROFILE% -> Start Menu - WSLtty cscript /nologo mkshortcut.vbs "/name:$name Terminal %" diff --git a/uninstall.bat b/uninstall.bat index a445df6..1460cd1 100755 --- a/uninstall.bat +++ b/uninstall.bat @@ -9,10 +9,6 @@ rem delete Start Menu Folder set smf=%APPDATA%\Microsoft\Windows\Start Menu\Programs\WSLtty rmdir /S /Q "%smf%" -rem delete Desktop Shortcuts (not installed anymore) -rem del "%USERPROFILE%\Desktop\WSL % in Mintty.lnk" -rem del "%USERPROFILE%\Desktop\WSL ~ in Mintty.lnk" - :start menu