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, and one for the configured default distribution,
to start a respective WSL terminal in a specific folder from an Explorer window. to start a respective WSL terminal in a specific folder from an Explorer window.
They are not installed by default. 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`. Start Menu subfolder `WSLtty`.
#### Mintty settings #### #### Mintty settings ####

View File

@ -2,6 +2,7 @@
contextmenu=false contextmenu=false
remove=false remove=false
alldistros=true
case "$1" in case "$1" in
-shortcuts-remove) -shortcuts-remove)
remove=true remove=true
@ -9,6 +10,10 @@ case "$1" in
-contextmenu) -contextmenu)
contextmenu=true contextmenu=true
shift;; shift;;
-contextmenu-default)
contextmenu=true
alldistros=false
shift;;
-contextmenu-remove) -contextmenu-remove)
contextmenu=true contextmenu=true
remove=true remove=true
@ -18,7 +23,7 @@ case "$1" in
while read name while read name
do do
case `regtool get "$direckey/shell/$name/command/"` in 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/command"
regtool remove "$direckey/shell/$name" regtool remove "$direckey/shell/$name"
;; ;;
@ -29,7 +34,7 @@ case "$1" in
while read name while read name
do do
case `regtool get "$direckey/Background/shell/$name/command/"` in 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/command"
regtool remove "$direckey/Background/shell/$name" regtool remove "$direckey/Background/shell/$name"
;; ;;
@ -84,7 +89,12 @@ PATH=/bin:$PATH
lxss="/HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Lxss" lxss="/HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Lxss"
schema="/HKEY_CURRENT_USER/Software/Classes/Local Settings/Software/Microsoft/Windows/CurrentVersion/AppModel/SystemAppData" 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 while read guid
do do
ok=false ok=false

View File

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

View File

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