-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_preview.bat
More file actions
74 lines (58 loc) · 1.79 KB
/
update_preview.bat
File metadata and controls
74 lines (58 loc) · 1.79 KB
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
@echo off
if "%1" EQU "" (
set TAG=preview
) else (
set TAG=%1
)
if "%TAG%" EQU "production" (
set BUILD=Release
) else (
SET BUILD=Debug
)
if "%2" EQU "" (
set BRANCH=public
) else (
set BRANCH=%2
)
SET root=%cd%
SET server=%root%\server
SET steam=%root%\steam
SET steamCmd=https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
echo Server directory: %server%
echo Steam directory: %steam%
echo Root directory: %root%
echo Branch: %BRANCH%
@REM Ensure folders are created
if not exist "%server%" mkdir "%server%"
@REM Download & extract Steam it in the steam folder
if not exist "%steam%" (
mkdir "%steam%"
cd "%steam%"
echo Downloading Steam
powershell -Command "(New-Object Net.WebClient).DownloadFile('%steamCmd%', '%root%\steam.zip')"
echo Extracting Steam
powershell -Command "Expand-Archive '%root%\steam.zip' -DestinationPath '%steam%'" -Force
del "%root%\steam.zip"
)
@REM Download the server
cd "%steam%"
echo Downloading Rust server on %BRANCH% branch...
steamcmd.exe +force_install_dir "%server%" ^
+login anonymous ^
+app_update 258550 ^
-beta %BRANCH% ^
validate ^
+quit ^
@REM Download latest development build of Oxide
echo Downloading Oxide
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://github.com/OxideMod/Oxide.Rust/releases/latest/download/Oxide.Rust.zip', '%root%\oxide.zip')"
@REM Extract it in the server folder
echo Extracting Oxide
powershell -Command "Expand-Archive '%root%\oxide.zip' -DestinationPath '%root%\Oxide.Rust'" -Force
@REM Copy the files to the server folder, only overwriting files in recursive folders, not the folders themselves
echo Copying Oxide files
xcopy %root%\Oxide.Rust\* %root%\server /y /s /i
@REM Cleanup
echo Cleaning up
del %root%\oxide.zip
rmdir /s /q %root%\Oxide.Rust