mirror of
https://github.com/mintty/wsltty.git
synced 2025-01-18 20:10:58 +00:00
remove ALL shortcut lnk and bat files (#218)
This commit is contained in:
parent
2aace74c9d
commit
433b11c47b
@ -34,8 +34,26 @@ case "$1" in
|
|||||||
-info)
|
-info)
|
||||||
config=false
|
config=false
|
||||||
shift;;
|
shift;;
|
||||||
|
-shortcuts)
|
||||||
|
shift;;
|
||||||
-shortcuts-remove)
|
-shortcuts-remove)
|
||||||
remove=true
|
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;;
|
shift;;
|
||||||
-contextmenu)
|
-contextmenu)
|
||||||
contextmenu=true
|
contextmenu=true
|
||||||
@ -255,6 +273,7 @@ config () {
|
|||||||
keyname="${name}_Terminal"
|
keyname="${name}_Terminal"
|
||||||
if $remove
|
if $remove
|
||||||
then
|
then
|
||||||
|
# obsolete; handled above
|
||||||
reg delete "$direckey\\shell\\$keyname" /f
|
reg delete "$direckey\\shell\\$keyname" /f
|
||||||
reg delete "$direckey\\Background\\shell\\$keyname" /f
|
reg delete "$direckey\\Background\\shell\\$keyname" /f
|
||||||
else
|
else
|
||||||
@ -288,9 +307,15 @@ config () {
|
|||||||
|
|
||||||
# launch script in . -> WSLtty home, WindowsApps launch folder
|
# launch script in . -> WSLtty home, WindowsApps launch folder
|
||||||
cmd /C mkbat.bat "$name"
|
cmd /C mkbat.bat "$name"
|
||||||
cmd /C copy "$name.bat" "$installdir"
|
|
||||||
cmd /C copy "$name.bat" "%LOCALAPPDATA%\\Microsoft\\WindowsApps"
|
cmd /C copy "$name.bat" "%LOCALAPPDATA%\\Microsoft\\WindowsApps"
|
||||||
|
|
||||||
|
# store backup copies in installation dir
|
||||||
|
if [ "$PWD" != "$INSTDIR" ]
|
||||||
|
then
|
||||||
|
cmd /C copy "$name Terminal %.lnk" "$installdir"
|
||||||
|
cmd /C copy "$name.bat" "$installdir"
|
||||||
|
fi
|
||||||
|
|
||||||
# prepare versions to target WSL home directory
|
# prepare versions to target WSL home directory
|
||||||
#bridgeargs="-C~ $bridgeargs"
|
#bridgeargs="-C~ $bridgeargs"
|
||||||
minttyargs="$minttyargs -~"
|
minttyargs="$minttyargs -~"
|
||||||
@ -315,8 +340,14 @@ config () {
|
|||||||
|
|
||||||
# launch script in ~ -> WSLtty home, WindowsApps launch folder
|
# launch script in ~ -> WSLtty home, WindowsApps launch folder
|
||||||
cmd /C mkbat.bat "$name~"
|
cmd /C mkbat.bat "$name~"
|
||||||
cmd /C copy "$name~.bat" "$installdir"
|
|
||||||
cmd /C copy "$name~.bat" "%LOCALAPPDATA%\\Microsoft\\WindowsApps"
|
cmd /C copy "$name~.bat" "%LOCALAPPDATA%\\Microsoft\\WindowsApps"
|
||||||
|
|
||||||
|
# store backup copies in installation dir
|
||||||
|
if [ "$PWD" != "$INSTDIR" ]
|
||||||
|
then
|
||||||
|
cmd /C copy "$name Terminal.lnk" "$installdir"
|
||||||
|
cmd /C copy "$name~.bat" "$installdir"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user