-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
32 lines (24 loc) · 932 Bytes
/
install.bat
File metadata and controls
32 lines (24 loc) · 932 Bytes
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
@echo off
setlocal
set REPO=kip2/rlr
set FILE=rlr-x86_64-pc-windows-msvc.zip
set INSTALL_DIR=%USERPROFILE%\rlr-bin
set URL=https://github.com/%REPO%/releases/latest/download/%FILE%
echo Downloading %URL%
curl -L -o %FILE% %URL%
echo Creating install directory: %INSTALL_DIR%
mkdir "%INSTALL_DIR%"
echo Extracting %FILE%
powershell -Command "Expand-Archive -Path '%CD%\%FILE%' -DestinationPath '%INSTALL_DIR%' -Force"
echo Deleting archive
del "%FILE%"
for /f "tokens=*" %%i in ('powershell -command "[System.Environment]::GetEnvironmentVariable('Path', 'User')"') do set "CURRENT_PATH=%%i"
echo %CURRENT_PATH% | find /i "%INSTALL_DIR%" >nul
if errorlevel 1 (
echo Adding %INSTALL_DIR% to PATH
powershell -Command "[Environment]::SetEnvironmentVariable('Path', '%CURRENT_PATH%;%INSTALL_DIR%', 'User')"
) else (
echo PATH already contains %INSTALL_DIR%
)
echo Done. You may need to restart your terminal.
endlocal