-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.cmd
More file actions
30 lines (23 loc) · 749 Bytes
/
Copy pathinstall.cmd
File metadata and controls
30 lines (23 loc) · 749 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
@echo off
setlocal
set "VERSION=%~1"
if "%VERSION%"=="" set "VERSION=latest"
where powershell >nul 2>nul
if errorlevel 1 (
echo [ERROR] PowerShell is required.
exit /b 1
)
set "REPO=Vegetog/RustCloud"
if not "%RUSTCLOUD_REPO%"=="" set "REPO=%RUSTCLOUD_REPO%"
set "PS_SCRIPT=%TEMP%\rustcloud-install-%RANDOM%%RANDOM%.ps1"
set "SCRIPT_URL=https://raw.githubusercontent.com/%REPO%/main/install.ps1"
echo [INFO] Downloading installer from %SCRIPT_URL% ...
curl -fsSL "%SCRIPT_URL%" -o "%PS_SCRIPT%"
if errorlevel 1 (
echo [ERROR] Failed to download install.ps1
exit /b 1
)
powershell -NoProfile -ExecutionPolicy Bypass -File "%PS_SCRIPT%" -Version "%VERSION%"
set "EXIT_CODE=%ERRORLEVEL%"
del "%PS_SCRIPT%" >nul 2>nul
exit /b %EXIT_CODE%