diff --git a/README.md b/README.md new file mode 100644 index 0000000..10d0ec0 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +Mintty as a terminal for Bash on Ubuntu on Windows / WSL. + +#### Overview #### + +Run the installer to install +* wsltty package components (see below) in the user’s application directory (where WSL is also installed) +* an empty “home directory” to enable storage of a mintty config file +* a Desktop Shortcut and a Start Menu Shortcut to start WSL with a login bash in the user’s WSL home directory +* context menu entries for Windows Explorer to start WSL with a bash in the respective directory + +An uninstaller is not provided. + +#### Components #### + +For mintty, see the [Mintty homepage](http://mintty.github.io/). + +It is based on [Cygwin](http://cygwin.com) +and includes its runtime library ([sources](http://mirrors.dotsrc.org/cygwin/x86/release/cygwin)). + +For interacting with WSL, it uses [wslbridge](https://github.com/rprichard/wslbridge). + diff --git a/install.bat b/install.bat index 72ea208..05b5ea5 100755 --- a/install.bat +++ b/install.bat @@ -1,16 +1,53 @@ @echo off +goto explorer + mkdir "%LOCALAPPDATA%\wsltty" -mkdir "%LOCALAPPDATA%\wsltty\bin" -rem mkdir "%LOCALAPPDATA%\wsltty\etc" -mkdir "%LOCALAPPDATA%\wsltty\%USERNAME%" copy LICENSE.mintty "%LOCALAPPDATA%\wsltty" copy LICENSE.wslbridge "%LOCALAPPDATA%\wsltty" -rem copy etc/minttyrc "%LOCALAPPDATA%\wsltty\etc" + +mkdir "%LOCALAPPDATA%\wsltty\bin" copy cygwin1.dll "%LOCALAPPDATA%\wsltty\bin" copy cygwin-console-helper.exe "%LOCALAPPDATA%\wsltty\bin" copy mintty.exe "%LOCALAPPDATA%\wsltty\bin" copy wslbridge.exe "%LOCALAPPDATA%\wsltty\bin" copy wslbridge-backend "%LOCALAPPDATA%\wsltty\bin" + +rem create "home directory" to enable storage of config file +mkdir "%LOCALAPPDATA%\wsltty\home +mkdir "%LOCALAPPDATA%\wsltty\home\%USERNAME%" + +rem create Desktop Shorcut copy "Bash on UoW in Mintty.lnk" "%USERPROFILE%\Desktop" + +rem create Start Menu Shortcut copy "Bash on UoW in Mintty.lnk" "%APPDATA%\Microsoft\Windows\Start Menu" + +:explorer +rem Explorer context menu +set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell +set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell + +rem WSL in Mintty +set label=WSL in Mintty +rem set here=in this directory +set here=Here + +rem WSL icon +set icon=%LOCALAPPDATA%\lxss\bash.ico + +rem WSL target shell +set shell=/bin/bash + +rem Mintty invocation +set cmd=%LOCALAPPDATA%\wsltty\bin\mintty.exe +set arg=/bin/wslbridge -t %shell% +set target=\"%cmd%\" %arg% + +reg add "%userdirname%\wsltty" /d "%label% %here%" /f +reg add "%userdirname%\wsltty" /v Icon /d "%icon%" /f +reg add "%userdirname%\wsltty\command" /d "%target%" /f +reg add "%userdirpane%\wsltty" /d "%label% %here%" /f +reg add "%userdirpane%\wsltty" /v Icon /d "%icon%" /f +reg add "%userdirpane%\wsltty\command" /d "%target%" /f + diff --git a/makefile b/makefile index ccfbf43..27a623c 100644 --- a/makefile +++ b/makefile @@ -43,8 +43,6 @@ cygwin: cp /bin/cygwin-console-helper.exe bin/ wsltty: - mkdir -p etc - touch etc/minttyrc pkg: mkdir -p rel @@ -56,7 +54,6 @@ pkg: cp bin/wslbridge-backend rel/ cp LICENSE.mintty rel/ cp LICENSE.wslbridge rel/ - cp etc/minttyrc rel/ cp "Bash on UoW in Mintty.lnk" rel/ cp install.bat rel/ cd rel; iexpress /n wsltty.SED diff --git a/makewinx.cfg b/makewinx.cfg index 5934550..452ba0d 100644 --- a/makewinx.cfg +++ b/makewinx.cfg @@ -39,9 +39,8 @@ FILE3="wslbridge.exe" FILE4="wslbridge-backend" FILE5="LICENSE.mintty" FILE6="LICENSE.wslbridge" -FILE7="minttyrc" -FILE8="Bash on UoW in Mintty.lnk" -FILE9="install.bat" +FILE7="Bash on UoW in Mintty.lnk" +FILE8="install.bat" [SourceFiles] SourceFiles0=. @@ -56,5 +55,4 @@ SourceFiles0=. %FILE6%= %FILE7%= %FILE8%= -%FILE9%=