2016-11-16 16:46:50 +01:00
|
|
|
@echo off
|
2016-09-14 14:55:14 +02:00
|
|
|
|
2017-05-19 22:19:20 +02:00
|
|
|
set refinstalldir=%%LOCALAPPDATA%%\wsltty
|
2016-10-16 21:31:56 +02:00
|
|
|
set installdir=%LOCALAPPDATA%\wsltty
|
2017-05-19 22:19:20 +02:00
|
|
|
set refconfigdir=%%APPDATA%%\wsltty
|
|
|
|
set configdir=%APPDATA%\wsltty
|
|
|
|
set oldroot=%installdir%
|
|
|
|
set oldhomedir=%installdir%\home\%USERNAME%
|
|
|
|
set oldconfigdir=%oldhomedir%\.config\mintty
|
|
|
|
if not "%1" == "" set refinstalldir=%1 && set installdir=%1
|
|
|
|
if not "%2" == "" set refconfigdir=%2 && set configdir=%2
|
2016-09-16 13:58:30 +02:00
|
|
|
|
|
|
|
|
2016-10-16 21:31:56 +02:00
|
|
|
:deploy
|
2016-09-14 14:55:14 +02:00
|
|
|
|
2016-10-15 21:59:53 +02:00
|
|
|
mkdir "%installdir%"
|
|
|
|
|
2017-10-23 08:14:40 +02:00
|
|
|
rem clean up previous installation artefacts
|
|
|
|
del /Q "%installdir%\*.bat"
|
|
|
|
del /Q "%installdir%\*.lnk"
|
2017-07-28 14:14:51 +02:00
|
|
|
|
2017-10-23 08:14:40 +02:00
|
|
|
copy LICENSE.mintty "%installdir%"
|
|
|
|
copy LICENSE.wslbridge "%installdir%"
|
2017-05-19 22:19:20 +02:00
|
|
|
|
2016-11-18 00:17:56 +01:00
|
|
|
copy "add to context menu.lnk" "%installdir%"
|
2017-10-29 16:47:04 +01:00
|
|
|
copy "add default to context menu.lnk" "%installdir%"
|
2016-11-18 00:17:56 +01:00
|
|
|
copy "remove from context menu.lnk" "%installdir%"
|
2017-07-28 14:14:51 +02:00
|
|
|
copy "configure WSL shortcuts.lnk" "%installdir%"
|
2018-04-18 10:46:17 +02:00
|
|
|
copy "WSL Terminal.lnk" "%installdir%"
|
|
|
|
copy "WSL Terminal %%.lnk" "%installdir%"
|
2017-07-28 14:14:51 +02:00
|
|
|
copy wsl.ico "%installdir%"
|
|
|
|
copy config-distros.sh "%installdir%"
|
2018-04-18 10:46:17 +02:00
|
|
|
copy mkshortcut.vbs "%installdir%"
|
2016-09-19 00:46:51 +02:00
|
|
|
|
2017-12-05 20:45:02 +01:00
|
|
|
if not exist "%installdir%\bin" goto instbin
|
|
|
|
rem move previous programs possibly in use out of the way
|
|
|
|
del /Q "%installdir%\bin\*.old"
|
|
|
|
ren "%installdir%\bin\cygwin1.dll" cygwin1.dll.old
|
|
|
|
ren "%installdir%\bin\cygwin-console-helper.exe" cygwin-console-helper.exe.old
|
|
|
|
ren "%installdir%\bin\mintty.exe" mintty.exe.old
|
|
|
|
ren "%installdir%\bin\wslbridge.exe" wslbridge.exe.old
|
|
|
|
ren "%installdir%\bin\wslbridge-backend" wslbridge-backend.old
|
|
|
|
del /Q "%installdir%\bin\*.old"
|
|
|
|
|
|
|
|
:instbin
|
2016-10-15 21:59:53 +02:00
|
|
|
mkdir "%installdir%\bin"
|
|
|
|
copy cygwin1.dll "%installdir%\bin"
|
|
|
|
copy cygwin-console-helper.exe "%installdir%\bin"
|
|
|
|
copy mintty.exe "%installdir%\bin"
|
|
|
|
copy wslbridge.exe "%installdir%\bin"
|
|
|
|
copy wslbridge-backend "%installdir%\bin"
|
2016-09-14 14:55:14 +02:00
|
|
|
|
2017-12-05 20:45:02 +01:00
|
|
|
copy dash.exe "%installdir%\bin"
|
|
|
|
copy regtool.exe "%installdir%\bin"
|
|
|
|
copy zoo.exe "%installdir%\bin"
|
|
|
|
|
2017-05-19 22:19:20 +02:00
|
|
|
rem create system config directory and copy config archive
|
|
|
|
mkdir "%installdir%\usr\share\mintty\lang"
|
2017-11-09 17:08:29 +01:00
|
|
|
copy lang.zoo "%installdir%\usr\share\mintty\lang"
|
|
|
|
mkdir "%installdir%\usr\share\mintty\themes"
|
|
|
|
copy themes.zoo "%installdir%\usr\share\mintty\themes"
|
2018-04-02 23:35:40 +02:00
|
|
|
mkdir "%installdir%\usr\share\mintty\info"
|
|
|
|
copy charnames.txt "%installdir%\usr\share\mintty\info"
|
2018-04-02 23:44:50 +02:00
|
|
|
mkdir "%installdir%\usr\share\mintty\icon"
|
|
|
|
copy wsl.ico "%installdir%\usr\share\mintty\icon"
|
2016-09-14 14:55:14 +02:00
|
|
|
|
2017-01-06 16:47:13 +01:00
|
|
|
|
2016-11-16 16:46:50 +01:00
|
|
|
rem create Start Menu Folder
|
|
|
|
set smf=%APPDATA%\Microsoft\Windows\Start Menu\Programs\WSLtty
|
|
|
|
mkdir "%smf%"
|
2017-10-23 08:14:40 +02:00
|
|
|
|
|
|
|
rem clean up previous installation
|
|
|
|
del /Q "%smf%\*.lnk"
|
|
|
|
|
2016-11-16 16:46:50 +01:00
|
|
|
copy "wsltty home & help.url" "%smf%"
|
2017-07-28 14:14:51 +02:00
|
|
|
copy "add to context menu.lnk" "%smf%"
|
2017-10-29 16:47:04 +01:00
|
|
|
copy "add default to context menu.lnk" "%smf%"
|
2017-07-28 14:14:51 +02:00
|
|
|
copy "remove from context menu.lnk" "%smf%"
|
|
|
|
copy "configure WSL shortcuts.lnk" "%smf%"
|
2018-04-18 10:46:17 +02:00
|
|
|
copy "WSL Terminal.lnk" "%smf%"
|
|
|
|
copy "WSL Terminal %%.lnk" "%smf%"
|
2017-07-28 14:14:51 +02:00
|
|
|
rem clean up previous installation
|
|
|
|
rmdir /S /Q "%smf%\context menu shortcuts"
|
|
|
|
|
2017-05-19 22:19:20 +02:00
|
|
|
rem unpack config files in system config directory
|
|
|
|
cd /D "%installdir%\usr\share\mintty\lang"
|
2017-11-09 17:08:29 +01:00
|
|
|
"%installdir%\bin\zoo" xO lang
|
|
|
|
cd /D "%installdir%\usr\share\mintty\themes"
|
|
|
|
"%installdir%\bin\zoo" xO themes
|
2017-05-19 22:19:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
:migrate configuration
|
|
|
|
|
|
|
|
rem migrate old config resource files to new config dir
|
|
|
|
if exist "%configdir%" goto configfile
|
|
|
|
if not exist "%oldconfigdir%" goto configfile
|
|
|
|
if exist "%oldhomedir%\.minttyrc" copy "%oldhomedir%\.minttyrc" "%oldconfigdir%\config" && del "%oldhomedir%\.minttyrc"
|
|
|
|
xcopy /E /I /Y "%oldconfigdir%" "%configdir%" && rmdir /S /Q "%oldconfigdir%"
|
|
|
|
rmdir "%oldhomedir%\.config"
|
|
|
|
:configfile
|
|
|
|
if exist "%configdir%\config" goto deloldhome
|
|
|
|
if exist "%oldhomedir%\.minttyrc" copy "%oldhomedir%\.minttyrc" "%configdir%\config" && del "%oldhomedir%\.minttyrc"
|
|
|
|
:deloldhome
|
|
|
|
rmdir "%oldhomedir%"
|
|
|
|
rmdir "%oldroot%\home"
|
|
|
|
|
|
|
|
|
|
|
|
:userconfig
|
2017-01-06 16:47:13 +01:00
|
|
|
|
2017-05-19 22:19:20 +02:00
|
|
|
rem create user config directory and subfolders
|
|
|
|
mkdir "%configdir%\lang"
|
|
|
|
mkdir "%configdir%\sounds"
|
|
|
|
mkdir "%configdir%\themes"
|
2017-01-06 16:47:13 +01:00
|
|
|
|
2017-05-25 18:07:10 +02:00
|
|
|
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"
|
|
|
|
|
2017-07-28 14:14:51 +02:00
|
|
|
rem distro-specific stuff: shortcuts and launch scripts
|
|
|
|
cd "%installdir%"
|
|
|
|
bin\dash.exe "%installdir%\config-distros.sh"
|
2017-10-23 08:14:40 +02:00
|
|
|
rem bin\dash.exe "%installdir%\config-distros.sh" -contextmenu
|
2017-07-28 14:14:51 +02:00
|
|
|
|
2017-01-06 16:47:13 +01:00
|
|
|
|
2016-09-16 13:58:30 +02:00
|
|
|
:end
|