-
Notifications
You must be signed in to change notification settings - Fork 2
/
installer.bat
executable file
·80 lines (51 loc) · 1.67 KB
/
installer.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@ECHO OFF
echo.
echo This script will install chocolatey and babun on your system,
echo MAKE SURE YOU ARE IN AN ELEVATED COMMAND PROMPT BEFORE PROCEEDING.
echo There if you do not want to use babun, you will need to manually install
echo cygwin or mysys and use .dotsys/installer.sh to install dotsys.
echo.
set install=y
set /p install="Would you like to proceed ? (y)es (n)o [y] : "
if /I NOT %install%==y (
goto :eof
)
SET dspath=%~dp0
SET builtins=%dspath%builtins
:: Install chocolatey
WHERE choco >nul 2>nul
if %ERRORLEVEL%==1 (
call %builtins%\choco\install.bat
) else (
echo [ info ] chocolaty is already installed
)
:: Install babun
WHERE babun >nul 2>nul
if %ERRORLEVEL%==1 (
echo [ info ] Installing babun
call %builtins%\babun\install.bat
) else (
echo [ info ] Babun is already installed, run the dotsys installer,
echo '.dotsys/installer.sh', in the babun shell to install dotsys.
)
:: Install dotsys
if %ERRORLEVEL%==0 (
echo [ info ] When the babun installation is complete, run the dotsys installer,
echo '.dotsys/installer.sh', in the babun shell to install dotsys.
) else (
echo [ fail ] Something when wrong with the installation. You must install,
echo some version of cygwin or msys and run .dotsys/installer.sh
echo manually to continue the installation.
)
:: Add usr/bin to path
:USRBIN
:: Documents\github\.dotsys\installer.sh
set usr_bin="\.babun\cygwin\usr\bin"
echo %PATH% |findstr /I /C:"%usr_bin%" 1>nul
if %ERRORLEVEL%==0 (
echo [ ok ] User cygwin bin already added to path
) else (
setx PATH "%PATH%;%USERPROFILE%%usr_bin%" 1>nul
echo [ ok ] User cygwin bin added to path
)
refreshenv