mirror of
https://github.com/mintty/wsltty.git
synced 2025-11-01 07:31:56 +00:00
support new WSL distribution model (#52)
This commit is contained in:
58
install.bat
58
install.bat
@@ -22,19 +22,26 @@ echo set refinstalldir=%refinstalldir%>> setdirs.bat
|
||||
echo set installdir=%installdir%>> setdirs.bat
|
||||
echo set refconfigdir=%refconfigdir%>> setdirs.bat
|
||||
echo set configdir=%configdir%>> setdirs.bat
|
||||
copy setdirs.bat + uninstall.bat "%installdir%\uninstall.bat"
|
||||
|
||||
copy setdirs.bat + wsl.bat "%installdir%\wsl.bat"
|
||||
copy setdirs.bat + wsl~.bat "%installdir%\wsl~.bat"
|
||||
copy setdirs.bat + wsl-l.bat "%installdir%\wsl-l.bat"
|
||||
copy setdirs.bat + uninstall.bat "%installdir%\uninstall.bat"
|
||||
copy setdirs.bat + config-context-menu.bat "%installdir%\config-context-menu.bat"
|
||||
|
||||
copy "add to context menu.lnk" "%installdir%"
|
||||
copy "remove from context menu.lnk" "%installdir%"
|
||||
copy "configure WSL shortcuts.lnk" "%installdir%"
|
||||
copy wsl.ico "%installdir%"
|
||||
copy config-distros.sh "%installdir%"
|
||||
copy mkshortcut.vbs "%installdir%"
|
||||
rem clean up previous installation
|
||||
del "%installdir%\config-context-menu.bat"
|
||||
|
||||
mkdir "%installdir%\bin"
|
||||
copy cygwin1.dll "%installdir%\bin"
|
||||
copy cygwin-console-helper.exe "%installdir%\bin"
|
||||
rem copy dash.exe "%installdir%\bin"
|
||||
copy dash.exe "%installdir%\bin"
|
||||
copy regtool.exe "%installdir%\bin"
|
||||
copy mintty.exe "%installdir%\bin"
|
||||
copy zoo.exe "%installdir%\bin"
|
||||
copy wslbridge.exe "%installdir%\bin"
|
||||
@@ -49,30 +56,46 @@ copy po.zoo "%installdir%\usr\share\mintty\lang"
|
||||
|
||||
rem generate shortcuts
|
||||
|
||||
set icon=%%LOCALAPPDATA%%\lxss\bash.ico
|
||||
rem set icon=%%LOCALAPPDATA%%\lxss\bash.ico
|
||||
set lxicon=%%LOCALAPPDATA%%\lxss\bash.ico
|
||||
set icon=%%LOCALAPPDATA%%\wsltty\wsl.ico
|
||||
if exist "%installdir%\wsl.ico" goto iconok
|
||||
if exist "%lxicon" copy "%lxicon" "%installdir%\wsl.ico"
|
||||
:iconok
|
||||
|
||||
set target=%refinstalldir%\bin\mintty.exe
|
||||
set minttyargs=--wsl -h err --configdir="%refconfigdir%" -o Locale=C -o Charset=UTF-8 /bin/wslbridge
|
||||
set bridgeargs=-t /bin/bash
|
||||
cscript mkshortcut.vbs "/name:WSL Bash %% in Mintty"
|
||||
cscript mkshortcut.vbs "/name:WSL %% in Mintty"
|
||||
set bridgeargs=-C~ -t /bin/bash
|
||||
cscript mkshortcut.vbs "/name:WSL Bash ~ in Mintty"
|
||||
cscript mkshortcut.vbs "/name:WSL ~ in Mintty"
|
||||
set bridgeargs=-t /bin/bash -l
|
||||
cscript mkshortcut.vbs "/name:WSL Bash -l in Mintty"
|
||||
cscript mkshortcut.vbs "/name:WSL -l in Mintty"
|
||||
|
||||
rem create Start Menu Folder
|
||||
set smf=%APPDATA%\Microsoft\Windows\Start Menu\Programs\WSLtty
|
||||
mkdir "%smf%"
|
||||
copy "wsltty home & help.url" "%smf%"
|
||||
copy "WSL Bash %% in Mintty.lnk" "%smf%"
|
||||
copy "WSL Bash ~ in Mintty.lnk" "%smf%"
|
||||
copy "WSL Bash -l in Mintty.lnk" "%smf%"
|
||||
mkdir "%smf%\context menu shortcuts"
|
||||
copy "add to context menu.lnk" "%smf%\context menu shortcuts"
|
||||
copy "remove from context menu.lnk" "%smf%\context menu shortcuts"
|
||||
copy "add to context menu.lnk" "%smf%"
|
||||
copy "remove from context menu.lnk" "%smf%"
|
||||
copy "configure WSL shortcuts.lnk" "%smf%"
|
||||
rem clean up previous installation
|
||||
rmdir /S /Q "%smf%\context menu shortcuts"
|
||||
|
||||
rem create launch shortcuts for default WSL distro
|
||||
copy "WSL %% in Mintty.lnk" "%smf%"
|
||||
copy "WSL ~ in Mintty.lnk" "%smf%"
|
||||
copy "WSL -l in Mintty.lnk" "%smf%"
|
||||
rem clean up previous installation
|
||||
del "%smf%\WSL Bash %% in Mintty.lnk"
|
||||
del "%smf%\WSL Bash ~ in Mintty.lnk"
|
||||
del "%smf%\WSL Bash -l in Mintty.lnk"
|
||||
|
||||
goto sysconfig
|
||||
|
||||
rem create Desktop Shorcuts
|
||||
copy "WSL Bash %% in Mintty.lnk" "%USERPROFILE%\Desktop"
|
||||
copy "WSL Bash ~ in Mintty.lnk" "%USERPROFILE%\Desktop"
|
||||
copy "WSL %% in Mintty.lnk" "%USERPROFILE%\Desktop"
|
||||
copy "WSL ~ in Mintty.lnk" "%USERPROFILE%\Desktop"
|
||||
|
||||
|
||||
:sysconfig
|
||||
@@ -108,5 +131,10 @@ mkdir "%configdir%\themes"
|
||||
rem create config file if it does not yet exist
|
||||
if not exist "%configdir%\config" echo # To use common configuration in %%APPDATA%%\mintty, simply remove this file>"%configdir%\config"
|
||||
|
||||
rem distro-specific stuff: shortcuts and launch scripts
|
||||
cd "%installdir%"
|
||||
bin\dash.exe "%installdir%\config-distros.sh"
|
||||
bin\dash.exe "%installdir%\config-distros.sh" -contextmenu
|
||||
|
||||
|
||||
:end
|
||||
|
||||
Reference in New Issue
Block a user