1
0
mirror of https://github.com/mintty/wsltty.git synced 2024-10-05 18:31:04 +01:00

enhance context menu options; fix removal

This commit is contained in:
mintty 2017-10-29 16:47:04 +01:00
parent 276fb6ae88
commit 9be0b3ec10
4 changed files with 23 additions and 8 deletions

View File

@ -86,7 +86,8 @@ WSLtty provides context menu entries for all installed WSL distributions
and one for the configured default distribution,
to start a respective WSL terminal in a specific folder from an Explorer window.
They are not installed by default.
To add or remove context menu entries, run the respective script from the
To add launch entries for the default or all WSL distributions to the
Explorer context menu, or remove them, run the respective script from the
Start Menu subfolder `WSLtty`.
#### Mintty settings ####

View File

@ -2,6 +2,7 @@
contextmenu=false
remove=false
alldistros=true
case "$1" in
-shortcuts-remove)
remove=true
@ -9,6 +10,10 @@ case "$1" in
-contextmenu)
contextmenu=true
shift;;
-contextmenu-default)
contextmenu=true
alldistros=false
shift;;
-contextmenu-remove)
contextmenu=true
remove=true
@ -18,7 +23,7 @@ case "$1" in
while read name
do
case `regtool get "$direckey/shell/$name/command/"` in
*bin\\mintty.exe*/bin/wslbridge*)
*bin\\mintty.exe*/bin/wslbridge*|*bin\\mintty.exe*--WSL*)
regtool remove "$direckey/shell/$name/command"
regtool remove "$direckey/shell/$name"
;;
@ -29,7 +34,7 @@ case "$1" in
while read name
do
case `regtool get "$direckey/Background/shell/$name/command/"` in
*bin\\mintty.exe*/bin/wslbridge*)
*bin\\mintty.exe*/bin/wslbridge*|*bin\\mintty.exe*--WSL*)
regtool remove "$direckey/Background/shell/$name/command"
regtool remove "$direckey/Background/shell/$name"
;;
@ -84,7 +89,12 @@ PATH=/bin:$PATH
lxss="/HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Lxss"
schema="/HKEY_CURRENT_USER/Software/Classes/Local Settings/Software/Microsoft/Windows/CurrentVersion/AppModel/SystemAppData"
(regtool list "$lxss" 2>/dev/null && echo || echo "No WSL packages registered" >&2) |
#(regtool list "$lxss" 2>/dev/null && echo || echo "No WSL packages registered" >&2) |
(
if $alldistros
then regtool list "$lxss" 2>/dev/null
else true
fi && echo || echo "No WSL packages registered" >&2) |
while read guid
do
ok=false

View File

@ -23,6 +23,7 @@ copy LICENSE.mintty "%installdir%"
copy LICENSE.wslbridge "%installdir%"
copy "add to context menu.lnk" "%installdir%"
copy "add default to context menu.lnk" "%installdir%"
copy "remove from context menu.lnk" "%installdir%"
copy "configure WSL shortcuts.lnk" "%installdir%"
copy wsl.ico "%installdir%"
@ -53,6 +54,7 @@ del /Q "%smf%\*.lnk"
copy "wsltty home & help.url" "%smf%"
copy "add to context menu.lnk" "%smf%"
copy "add default to context menu.lnk" "%smf%"
copy "remove from context menu.lnk" "%smf%"
copy "configure WSL shortcuts.lnk" "%smf%"
rem clean up previous installation

View File

@ -49,10 +49,11 @@ FILE13="install.bat"
FILE14="uninstall.bat"
FILE15="wsl.ico"
FILE16="add to context menu.lnk"
FILE17="remove from context menu.lnk"
FILE18="wsltty home & help.url"
FILE19="zoo.exe"
FILE20="po.zoo"
FILE17="add default to context menu.lnk"
FILE18="remove from context menu.lnk"
FILE19="wsltty home & help.url"
FILE20="zoo.exe"
FILE21="po.zoo"
[SourceFiles]
SourceFiles0=.
@ -79,4 +80,5 @@ SourceFiles0=.
%FILE18%=
%FILE19%=
%FILE20%=
%FILE21%=