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

72 lines
2.1 KiB
Batchfile
Raw Normal View History

2016-09-18 23:46:51 +01:00
rem @echo off
2016-09-14 13:55:14 +01:00
:deploy
2016-09-11 13:20:39 +01:00
mkdir "%LOCALAPPDATA%\wsltty"
copy LICENSE.mintty "%LOCALAPPDATA%\wsltty"
copy LICENSE.wslbridge "%LOCALAPPDATA%\wsltty"
copy uninstall.bat "%LOCALAPPDATA%\wsltty"
2016-09-14 13:55:14 +01:00
2016-09-18 23:46:51 +01:00
copy wsl.bat "%LOCALAPPDATA%\wsltty"
rem does not work without admin rights:
rem copy wsl.bat "%SYSTEMROOT%\System32"
2016-09-14 13:55:14 +01:00
mkdir "%LOCALAPPDATA%\wsltty\bin"
2016-09-11 13:20:39 +01:00
copy cygwin1.dll "%LOCALAPPDATA%\wsltty\bin"
copy cygwin-console-helper.exe "%LOCALAPPDATA%\wsltty\bin"
rem copy dash.exe "%LOCALAPPDATA%\wsltty\bin"
2016-09-11 13:20:39 +01:00
copy mintty.exe "%LOCALAPPDATA%\wsltty\bin"
copy wslbridge.exe "%LOCALAPPDATA%\wsltty\bin"
copy wslbridge-backend "%LOCALAPPDATA%\wsltty\bin"
2016-09-14 13:55:14 +01:00
rem create "home directory" to enable storage of config file
mkdir "%LOCALAPPDATA%\wsltty\home
mkdir "%LOCALAPPDATA%\wsltty\home\%USERNAME%"
:shortcuts
2016-09-14 13:55:14 +01:00
rem create Desktop Shorcut
2016-09-11 13:20:39 +01:00
copy "Bash on UoW in Mintty.lnk" "%USERPROFILE%\Desktop"
2016-09-14 13:55:14 +01:00
rem create Start Menu Shortcut
2016-09-11 13:20:39 +01:00
copy "Bash on UoW in Mintty.lnk" "%APPDATA%\Microsoft\Windows\Start Menu"
2016-09-14 13:55:14 +01:00
:explorer
2016-09-14 13:55:14 +01:00
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
2016-09-18 23:46:51 +01:00
set cset=-o Locale=C -o Charset=UTF-8
set icon=%LOCALAPPDATA%\lxss\bash.ico
2016-09-14 13:55:14 +01:00
set arg=/bin/wslbridge -t %shell%
2016-09-18 23:46:51 +01:00
set target0=\"%cmd%\" %cset% -i \"%icon%\" %arg%
rem set target1=\"%cmd%\" %cset% -i \"%icon%\" /bin/dash -c \"cd '%%1'; exec %arg%\"
set target1=\"%cmd%\" %cset% -i \"%icon%\" --dir \"%%1\" %arg%
2016-09-14 13:55:14 +01:00
reg add "%userdirname%\wsltty" /d "%label% %here%" /f
reg add "%userdirname%\wsltty" /v Icon /d "%icon%" /f
2016-09-18 23:46:51 +01:00
reg add "%userdirname%\wsltty\command" /d "%target1%" /f
2016-09-14 13:55:14 +01:00
reg add "%userdirpane%\wsltty" /d "%label% %here%" /f
reg add "%userdirpane%\wsltty" /v Icon /d "%icon%" /f
2016-09-18 23:46:51 +01:00
reg add "%userdirpane%\wsltty\command" /d "%target0%" /f
2016-09-14 13:55:14 +01:00
:end