1
0
mirror of https://github.com/mintty/wsltty.git synced 2025-01-18 20:10:58 +00:00

tweak removal of ALL previous shortcuts, also on reconfigure (#218)

This commit is contained in:
Thomas Wolff 2020-03-05 00:00:00 +01:00
parent 9ae697ac20
commit 00c4c2f20b

View File

@ -38,22 +38,6 @@ case "$1" in
shift;;
-shortcuts-remove)
remove=true
(cd "$INSTDIR"
for lnk in *.lnk
do
if cmd /C comp/M "$lnk" "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\$lnk"
then cmd /C del "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\$lnk"
fi
done
for bat in *.bat
do
if cmd /C comp/M "$bat" "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$bat"
then cmd /C del "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$bat"
fi
done
)
shift;;
-contextmenu)
contextmenu=true
@ -92,6 +76,25 @@ case "$1" in
shift;;
esac
if $config && ! $contextmenu
then
# remove shortcut entries in Start menu and cmd-line bat shortcuts
(cd "$INSTDIR"
for lnk in *.lnk
do
if cmd /C comp/M "$lnk" "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\$lnk"
then cmd /C del "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\$lnk"
fi
done
for bat in *.bat
do
if cmd /C comp/M "$bat" "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$bat"
then cmd /C del "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$bat"
fi
done
)
fi
# test w/o WSL: call this script with REGTOOLFAKE=true dash config-distros.sh
if ${REGTOOLFAKE:-false}
then