From c820364bd6f1307d53d5945222adc088e20ff27f Mon Sep 17 00:00:00 2001 From: mintty Date: Fri, 18 Nov 2016 10:30:56 +0100 Subject: [PATCH] adapt new configuration setup --- README.md | 3 ++- add to context menu.lnk | Bin 0 -> 1675 bytes ...ontext menu.bat => config-context-menu.bat | 24 ++++++++++++++++-- makewinx.cfg | 8 +++--- remove from context menu.bat | 12 --------- remove from context menu.lnk | Bin 0 -> 1681 bytes uninstall.bat | 2 +- 7 files changed, 30 insertions(+), 19 deletions(-) create mode 100755 add to context menu.lnk rename add to context menu.bat => config-context-menu.bat (71%) delete mode 100755 remove from context menu.bat create mode 100755 remove from context menu.lnk diff --git a/README.md b/README.md index fc5d7bb..6624699 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Run the [installer](https://github.com/mintty/wsltty/releases) to install * wsltty package components (see below) in the user’s application folder (where WSL is also installed) * an empty wsltty “home directory” to enable storage of a mintty config file * Start Menu and Desktop shortcuts to start a WSL bash (with some variations, see below) -* optional context menu entries for Windows Explorer to start a WSL bash in the respective folder, installable from the Start Menu subfolder +* optional context menu entries for Windows Explorer to start a WSL bash in the respective folder +* install/uninstall context menu items from Start Menu subfolder * `wsl*.bat` scripts to invoke wsltty manually (with some variations and invocation options, see below) * an uninstall script that can be invoked manually to remove shortcuts and context menu entries diff --git a/add to context menu.lnk b/add to context menu.lnk new file mode 100755 index 0000000000000000000000000000000000000000..54cd89e034cf777d8b41147d822cb2c30a6475f7 GIT binary patch literal 1675 zcmds1O=uHA6#inPMv7Q9wood~B~pacq^%mOpwms#tXXYn($c^pCNYhn`6Iji5t^8K z5GsmdQM_5vq7*#pL5uWKyl4-to;(y(Ja}jhUPMau&1Nm32kSX+n0fQw%zX3SH$M^p zgLxaZz`WMNvrJ}@`ZI3(TAnQ#3SX|do6js6zOUbz;C6gRdE(Bp+Gw8{%xHFXH`au5 zr=Pke7y9n457}1>P|*az6Y$i-q0Jrf7W4ZoESq(O)i8O~#?XcPE6d(n@rL%f)s|Na z?|-d4jQ6w2?uEBQ^DnQSf(b^H-i&zjdA{~At!dUmHg4=)?l5GjxDcj2IdT^yeb1aY z>#eg$nP@l(X9XVjbG*A6Ud<*v2^mBQDM@}a{2N$VU!7%CNvi4agO@)CI@u# zrb40=V;X}tO%Wc>hTja0czhaAnM2NQ7{DK$2x+ETIfaBC#20=r>F z9|CZrmx$~|4?Ga*c--V~qAHO`03*$4+)szd5Tt4)Dw33pLPge+P;i;jNoc8>DN;&e z+A8%3Ok#e&iv^i=%U~$2>XUzSSb6zm{hIv$rKvu)syCw+N^KXt3I5O>0e|50jRDV` zx9Beb literal 0 HcmV?d00001 diff --git a/add to context menu.bat b/config-context-menu.bat similarity index 71% rename from add to context menu.bat rename to config-context-menu.bat index dc6ef8f..b324908 100755 --- a/add to context menu.bat +++ b/config-context-menu.bat @@ -1,10 +1,16 @@ @echo off rem See comments in install.bat about changing the installation directory. - set installdir=%LOCALAPPDATA%\wsltty -rem Explorer context menu + +if "%1"=="/U" goto remove +if "%1"=="/u" goto remove + + +:add +rem add to Explorer context menu + set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell @@ -36,4 +42,18 @@ reg add "%userdirpane%\wsltty" /d "%label% %here%" /f reg add "%userdirpane%\wsltty" /v Icon /d "%icon%" /f reg add "%userdirpane%\wsltty\command" /d "%target0%" /f +goto end + + +:remove +rem remove from Explorer context menu + +rem delete Explorer context menu +set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell +set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell + +reg delete "%userdirname%\wsltty" /f +reg delete "%userdirpane%\wsltty" /f + + :end diff --git a/makewinx.cfg b/makewinx.cfg index 759d716..23543d1 100644 --- a/makewinx.cfg +++ b/makewinx.cfg @@ -47,9 +47,10 @@ FILE11="wsl~.bat" FILE12="wsl-l.bat" FILE13="install.bat" FILE14="uninstall.bat" -FILE15="add to context menu.bat" -FILE16="remove from context menu.bat" -FILE17="wsltty home & help.url" +FILE15="config-context-menu.bat" +FILE16="add to context menu.lnk" +FILE17="remove from context menu.lnk" +FILE18="wsltty home & help.url" [SourceFiles] SourceFiles0=. @@ -73,4 +74,5 @@ SourceFiles0=. %FILE15%= %FILE16%= %FILE17%= +%FILE18%= diff --git a/remove from context menu.bat b/remove from context menu.bat deleted file mode 100755 index e939697..0000000 --- a/remove from context menu.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off - -:explorer context menu - -rem delete Explorer context menu -set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell -set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell - -reg delete "%userdirname%\wsltty" /f -reg delete "%userdirpane%\wsltty" /f - -:end diff --git a/remove from context menu.lnk b/remove from context menu.lnk new file mode 100755 index 0000000000000000000000000000000000000000..f638405d7c0404bf5e41a4dcab18e4274797089d GIT binary patch literal 1681 zcmds1O-NKx6#kx0H6fAJq#%Z~nUG*~Mys}@2Il-ISIXA45%>osrPnFZm;+MO}3Cw7(`ca_-s_)M^&&eKs-9?qS9 z>KUKwzPC2uS}H(CEkvKyUOfdXELeUs9iQhA^VvGcr7>L|Dy+F1xtO;nDUl^%_9)SovwU@IRs zP>f+YilF2TD5ohETq@!dAQFl;5l9ZB0O*K-{aG8?oHxjl{ zyp+nML+%ur%z{A=3o*x*AyIPMkN#c5jaN`LFU$X5o$Xhx?VC|OrM8>i1b^;sC8&J4 z(d(O$TgBI_2PO_bNX`GvoImj$0`jMe4Ec*q)tz5 zvX?lgqp`#>x67?Z`M*I__^eLY#bxnHvBh?1>YI~Qj7_JWf8Y1w1cE)Yux>TaG5!Ga C#pu-l literal 0 HcmV?d00001 diff --git a/uninstall.bat b/uninstall.bat index 96e5bea..64cc3c3 100755 --- a/uninstall.bat +++ b/uninstall.bat @@ -18,7 +18,7 @@ del "%USERPROFILE%\Desktop\WSL Bash ~ in Mintty.lnk" :explorer context menu -call "%installdir%\remove from context menu.bat" +call "%installdir%\config-context-menu.bat" /U :undeploy