-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetup.bat
More file actions
604 lines (574 loc) · 17.4 KB
/
Setup.bat
File metadata and controls
604 lines (574 loc) · 17.4 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
@echo off
REM Rust Server Installer
mode 130,25 & color 02
:intro
title Rust Server Installer
echo This script will install a Rust Server on your computer.
echo.
pause
cls
:steamcmd
title Installing SteamCMD...
set steamcmd=C:\SteamCMD
echo Enter the location you want SteamCMD installed (Default: C:\SteamCMD)
echo.
set /p steamcmd="Location: "
echo.
md "%steamcmd%"
curl -SL -A "Mozilla/5.0" https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip --output "%steamcmd%"\SteamCMD.zip
cd /d "%steamcmd%"
powershell -command "Expand-Archive -Force SteamCMD.zip ./"
del SteamCMD.zip
cls
echo SteamCMD installed!
echo -------------------
:branch
title Setting Up Your Server
echo.
echo Pick Your Server Branch
echo.
echo 1: Main Branch Server
echo 2: Staging Branch Server
echo.
echo Note: There is no direct Oxide support for the Staging Branch. You will have to manually install it.
echo.
set /p choice="Enter 1 or 2: "
if not '%choice%'=='' set choice=%choice:~0,1%
cls
if '%choice%' == '1' goto rustmain
if '%choice%' == '2' goto ruststaging
echo Please Enter 1 or 2.
goto branch
:rustmain
set forceinstall=C:\RustServer
echo WARNING: Be sure there is not an existing Rust Server installation in this directory.
echo The folder should either be empty or non-existent.
echo.
echo Enter the location you want the Rust Server installed (Default: C:\RustServer)
echo.
set /p forceinstall="Location: "
md "%forceinstall%"
cd /d "%forceinstall%"
title Installing Rust Server...
"%steamcmd%"\steamcmd.exe +force_install_dir "%forceinstall%" +login anonymous +app_update 258550 +quit
REM Creating Update File (Release Server)
(
echo @echo off
echo REM UpdateServer.bat
echo mode 110,20
echo color 02
echo title Updating Server...
echo "%steamcmd%"\steamcmd.exe +force_install_dir "%forceinstall%" +login anonymous +app_update 258550 +quit
echo echo.
echo echo Rust Updated!
echo echo.
echo choice /c yn /m "Do you want to run your server now?: "
echo IF ERRORLEVEL 2 exit
echo IF ERRORLEVEL 1 goto serverstart
echo :serverstart
echo mode 120,30
echo title %comspec%
echo StartServer.bat
)>UpdateServer.bat
cls
echo Rust Server Installed!
echo ----------------------
echo.
goto modchoice
:ruststaging
set forceinstall=C:\RustStagingServer
echo WARNING: Be sure there is not an existing Rust Server installation in this directory.
echo The folder should either be empty or non-existent.
echo.
echo Enter the location you want the Rust Staging Branch Server installed (Default: C:\RustStagingServer)
echo.
set /p forceinstall="Location: "
echo.
md "%forceinstall%"
cd /d "%forceinstall%"
title Installing Rust Staging Server...
"%steamcmd%"\steamcmd.exe +force_install_dir "%forceinstall%" +login anonymous +app_update 258550 -beta staging +quit
REM Creating Update File (Staging Server)
(
echo @echo off
echo REM UpdateServer.bat
echo mode 110,20
echo color 02
echo title Updating Server...
echo "%steamcmd%"\steamcmd.exe +force_install_dir "%forceinstall%" +login anonymous +app_update 258550 -beta staging +quit
echo echo.
echo echo Rust Staging Updated!
echo echo.
echo choice /c yn /m "Do you want to run your server now?: "
echo IF ERRORLEVEL 2 exit
echo IF ERRORLEVEL 1 goto serverstart
echo :serverstart
echo mode 120,30
echo title %comspec%
echo StartServer.bat
)>UpdateServer.bat
cls
echo Rust Staging Server Installed!
echo ------------------------------
echo.
goto modchoicestaging
:modchoice
title Setting Up Your Server
echo 1: Oxide
echo 2: Carbon
echo 3: Vanilla (No Mods)
echo.
set /p mod="Would you like to install Oxide or Carbon?: "
echo.
if not '%mod%'=='' set mod=%mod:~0,1%
cls
if '%mod%' == '1' goto oxideinstall
if '%mod%' == '2' goto carboninstall
if '%mod%' == '3' goto mapchoice
echo Please Enter 1, 2, or 3.
echo.
goto modchoice
:modchoicestaging
title Setting Up Your Server
echo 1: Carbon
echo 2: Vanilla (No Mods)
echo.
set /p mod="Would you like to install Carbon?: "
echo.
if not '%mod%'=='' set mod=%mod:~0,1%
cls
if '%mod%' == '1' goto carboninstallstaging
if '%mod%' == '2' goto mapchoice
echo Please Enter 1 or 2.
echo.
goto modchoicestaging
:oxideinstall
title Installing Oxide...
curl -SL -A "Mozilla/5.0" "https://umod.org/games/rust/download" --output "%forceinstall%"\OxideMod.zip
cd /d "%forceinstall%"
powershell -command "Expand-Archive -Force OxideMod.zip ./"
del OxideMod.zip
REM Creating Update File (Oxide)
(
echo @echo off
echo REM UpdateServer.bat
echo mode 110,20
echo color 02
echo title Updating Server...
echo "%steamcmd%"\steamcmd.exe +force_install_dir "%forceinstall%" +login anonymous +app_update 258550 +quit
echo echo.
echo echo Rust Updated!
echo pause
echo curl -SL -A "Mozilla/5.0" "https://umod.org/games/rust/download" --output "%forceinstall%"\OxideMod.zip
echo cd /d "%forceinstall%"
echo powershell -command "Expand-Archive -Force OxideMod.zip ./"
echo del OxideMod.zip
echo echo.
echo echo Oxide Updated!
echo echo.
echo choice /c yn /m "Do you want to run your server now?: "
echo IF ERRORLEVEL 2 exit
echo IF ERRORLEVEL 1 goto serverstart
echo :serverstart
echo mode 120,30
echo title %comspec%
echo StartServer.bat
)>UpdateServer.bat
cls
echo Oxide installed!
echo ----------------
echo.
goto mapchoice
:carboninstall
title Installing Carbon...
curl -SL -A "Mozilla/5.0" "https://github.com/CarbonCommunity/Carbon.Core/releases/download/production_build/Carbon.Windows.Release.zip" --output "%forceinstall%"\CarbonMod.zip
cd /d "%forceinstall%"
powershell -command "Expand-Archive -Force CarbonMod.zip ./"
del CarbonMod.zip
REM Creating Update File (Carbon)
(
echo @echo off
echo REM UpdateServer.bat
echo mode 110,20
echo color 02
echo title Updating Server...
echo "%steamcmd%"\steamcmd.exe +force_install_dir "%forceinstall%" +login anonymous +app_update 258550 +quit
echo echo.
echo echo Rust Updated!
echo pause
echo echo.
echo choice /c yn /m "Do you want to update Carbon now?: "
echo IF ERRORLEVEL 2 goto start
echo IF ERRORLEVEL 1 goto carbonupdate
echo :carbonupdate
echo curl -SL -A "Mozilla/5.0" "https://github.com/CarbonCommunity/Carbon.Core/releases/download/production_build/Carbon.Windows.Release.zip" --output "%forceinstall%"\CarbonMod.zip
echo cd /d "%forceinstall%"
echo powershell -command "Expand-Archive -Force CarbonMod.zip ./"
echo del CarbonMod.zip
echo echo.
echo echo Carbon Updated!
echo :start
echo echo.
echo choice /c yn /m "Do you want to run your server now?: "
echo IF ERRORLEVEL 2 exit
echo IF ERRORLEVEL 1 goto serverstart
echo :serverstart
echo mode 120,30
echo title %comspec%
echo StartServer.bat
)>UpdateServer.bat
cls
echo Carbon installed!
echo ----------------
echo.
goto mapchoice
:carboninstallstaging
title Installing Carbon...
curl -SL -A "Mozilla/5.0" "https://github.com/CarbonCommunity/Carbon.Core/releases/download/production_build/Carbon.Windows.Release.zip" --output "%forceinstall%"\CarbonMod.zip
cd /d "%forceinstall%"
powershell -command "Expand-Archive -Force CarbonMod.zip ./"
del CarbonMod.zip
REM Creating Update File (Carbon Staging)
(
echo @echo off
echo REM UpdateServer.bat
echo mode 110,20
echo color 02
echo title Updating Server...
echo "%steamcmd%"\steamcmd.exe +force_install_dir "%forceinstall%" +login anonymous +app_update 258550 -beta staging +quit
echo echo.
echo echo Rust Staging Updated!
echo echo.
echo choice /c yn /m "Do you want to update Carbon now?: "
echo IF ERRORLEVEL 2 goto start
echo IF ERRORLEVEL 1 goto carbonupdate
echo :carbonupdate
echo curl -SL -A "Mozilla/5.0" "https://github.com/CarbonCommunity/Carbon.Core/releases/download/production_build/Carbon.Windows.Release.zip" --output "%forceinstall%"\CarbonMod.zip
echo cd /d "%forceinstall%"
echo powershell -command "Expand-Archive -Force CarbonMod.zip ./"
echo del CarbonMod.zip
echo echo.
echo echo Carbon Updated!
echo :start
echo echo.
echo choice /c yn /m "Do you want to run your server now?: "
echo IF ERRORLEVEL 2 exit
echo IF ERRORLEVEL 1 goto serverstart
echo :serverstart
echo mode 120,30
echo title %comspec%
echo StartServer.bat
)>UpdateServer.bat
cls
echo Carbon installed!
echo ----------------
echo.
goto mapchoice
:mapchoice
title Setting Up Your Server
choice /c yn /m "Are you using a custom map file? (For normal/first time installs, you likely aren't): "
cls
IF ERRORLEVEL 2 goto startproc
IF ERRORLEVEL 1 goto rusteditchoice
:rusteditchoice
choice /c yn /m "Do you want to install the RustEdit DLL? (You usually need this for custom maps): "
echo.
IF ERRORLEVEL 2 goto startcustom
IF ERRORLEVEL 1 goto rusteditinstall
:rusteditinstall
title Installing RustEdit DLL...
powershell -Command "Invoke-WebRequest https://github.com/k1lly0u/Oxide.Ext.RustEdit/raw/master/Oxide.Ext.RustEdit.dll -OutFile '"%forceinstall%"\RustDedicated_Data\Managed\Oxide.Ext.RustEdit.dll'
cls
echo RustEdit DLL installed!
echo -----------------------
echo.
goto startcustom
:startproc
cd /d "%forceinstall%"
title Creating Your Startup File...
set serverport=28015
set /p serverport="Enter your server port (Default: 28015): "
echo.
set rconport=28016
set /p rconport="Enter your RCON port (Default: 28016): "
echo.
set queryport=28017
set /p queryport="Enter your server query port (Default: 28017): "
echo.
set identity=RustServer
echo Don't have any spaces in the identity name!
set /p identity="Enter your server identity (Default: RustServer): "
echo.
set seed=1337
set /p seed="Enter your map seed (Default: 1337): "
echo.
set worldsize=4500
set /p worldsize="Enter your world size (Default: 4500): "
echo.
set maxplayers=150
set /p maxplayers="Enter the max players (Default: 150): "
echo.
set hostname=A Simple Rust Server
set /p hostname="Enter your server's hostname (How it appears on the server browser): "
echo.
set description=An unconfigured Rust server.
set /p description="Enter your server's description: "
echo.
set rconpw=ChangeThisPlease
set /p rconpw="Enter your RCON password (make it secure!): "
echo.
set /p serverurl="Enter your Server URL (Ex: Your Discord invite link. Can be blank if you don't have one): "
echo.
echo Reminder: Your Header Image link MUST contain ONLY the picture, at 1024x512 size
set /p headerimage="Enter your Server Header Image (Can be blank if you don't have one): "
REM Creating Start File (Procedural Map)
(
echo @echo off
echo :start
echo RustDedicated.exe -batchmode ^^
echo -logFile "%identity%_logs.txt" ^^
echo +server.queryport %queryport% ^^
echo +server.port %serverport% ^^
echo +server.level "Procedural Map" ^^
echo +server.seed %seed% ^^
echo +server.worldsize %worldsize% ^^
echo +server.maxplayers %maxplayers% ^^
echo +server.hostname "%hostname%" ^^
echo +server.description "%description%" ^^
echo +server.headerimage "%headerimage%" ^^
echo +server.url "%serverurl%" ^^
echo +server.identity "%identity%" ^^
echo +rcon.port %rconport% ^^
echo +rcon.password %rconpw% ^^
echo +rcon.web 1
echo goto start
)>StartServer.bat
REM Creating server.cfg (Procedural Map)
md "%forceinstall%"\server\%identity%\cfg
cd /d "%forceinstall%"\server\%identity%\cfg
(
echo fps.limit "60"
)>server.cfg
REM Creating Wipe File (Procedural Map)
cd /d "%forceinstall%"
(
echo @echo off
echo REM WipeServer.bat
echo mode 110,20
echo color 02
echo echo This file will allow you to wipe your server. Be sure you want to continue.
echo echo.
echo pause
echo echo.
echo choice /c yn /m "Do you want to wipe Blueprints?: "
echo IF ERRORLEVEL 2 goto wipemap
echo IF ERRORLEVEL 1 goto wipebp
echo :wipebp
echo echo.
echo echo WARNING: THIS WILL WIPE YOUR SERVER'S MAP, PLAYER, AND BLUEPRINT DATA. BE SURE YOU WANT TO CONTINUE.
echo pause
echo echo.
echo cd /d server/%identity%
echo del *.sav
echo del *.sav.*
echo del *.map
echo del *.db
echo del *.db-journal
echo del *.db-wal
echo goto finishbp
echo :wipemap
echo echo.
echo echo WARNING: THIS WILL WIPE YOUR SERVER'S MAP AND PLAYER DATA. BE SURE YOU WANT TO CONTINUE.
echo pause
echo echo.
echo cd /d server/%identity%
echo del *.sav
echo del *.sav.*
echo del *.map
echo del player.deaths.*
echo del player.identities.*
echo del player.states.*
echo del player.tokens.*
echo del sv.files.*
echo goto finishmap
echo :finishbp
echo echo.
echo echo Server has been Map and BP Wiped!
echo echo.
echo echo Be sure to change your map seed in your startup batch file!
echo echo Don't forget to delete any necessary plugin data!
echo echo.
echo pause
echo exit
echo :finishmap
echo echo.
echo echo Server has been Map Wiped!
echo echo.
echo echo Be sure to change your map seed in your startup batch file!
echo echo Don't forget to delete any necessary plugin data!
echo echo.
echo pause
)>WipeServer.bat
REM Admin Check
cls
choice /c yn /m "Do you want to add yourself as an admin on the server now?: "
cls
IF ERRORLEVEL 2 goto finish
IF ERRORLEVEL 1 goto admin
:startcustom
cd /d "%forceinstall%"
title Creating Your Startup File (Custom Map)...
set serverport=28015
set /p serverport="Enter your server port (Default: 28015): "
echo.
set rconport=28016
set /p rconport="Enter your RCON port (Default: 28016): "
echo.
set queryport=28017
set /p queryport="Enter your server query port (Default: 28017): "
echo.
set identity=RustServer
echo Don't have any spaces in the identity name!
set /p identity="Enter your server identity (Default: RustServer): "
echo.
set levelurl=https://www.dropbox.com/s/ig1ds1m3q5hnflj/proc_install_1.0.map?dl=1
set /p levelurl="Enter your custom map URL (Must be a direct download link!): "
echo.
set maxplayers=150
set /p maxplayers="Enter the max players (Default: 150): "
echo.
set hostname=A Simple Rust Server
set /p hostname="Enter your server's hostname (How it appears on the server browser): "
echo.
set description=An unconfigured Rust server.
set /p description="Enter your server's description: "
echo.
set rconpw=ChangeThisPlease
set /p rconpw="Enter your RCON password (make it secure!): "
echo.
set /p serverurl="Enter your Server URL (Ex: Your Discord invite link. Can be blank if you don't have one): "
echo.
echo Reminder: Your Header Image link MUST contain ONLY the picture, at 1024x512 size
set /p headerimage="Enter your Server Header Image (Can be blank if you don't have one): "
REM Creating Start File (Custom Map)
(
echo @echo off
echo :start
echo RustDedicated.exe -batchmode ^^
echo -logFile "%identity%_logs.txt" ^^
echo -levelurl "%levelurl%" ^^
echo +server.queryport %queryport% ^^
echo +server.port %serverport% ^^
echo +server.maxplayers %maxplayers% ^^
echo +server.hostname "%hostname%" ^^
echo +server.description "%description%" ^^
echo +server.headerimage "%headerimage%" ^^
echo +server.url "%serverurl%" ^^
echo +server.identity "%identity%" ^^
echo +rcon.port %rconport% ^^
echo +rcon.password %rconpw% ^^
echo +rcon.web 1
echo goto start
)>StartServer.bat
REM Creating server.cfg (Custom Map)
md "%forceinstall%"\server\%identity%\cfg
cd /d "%forceinstall%"\server\%identity%\cfg
(
echo fps.limit "60"
)>server.cfg
REM Creating Wipe File (Custom Map)
cd /d "%forceinstall%"
(
echo @echo off
echo REM WipeServer.bat
echo mode 110,20
echo color 02
echo echo This file will allow you to wipe your server. Be sure you want to continue.
echo echo.
echo pause
echo echo.
echo choice /c yn /m "Do you want to wipe Blueprints?: "
echo IF ERRORLEVEL 2 goto wipemap
echo IF ERRORLEVEL 1 goto wipebp
echo :wipebp
echo echo.
echo echo WARNING: THIS WILL WIPE YOUR SERVER'S MAP, PLAYER, AND BLUEPRINT DATA. BE SURE YOU WANT TO CONTINUE.
echo pause
echo echo.
echo cd /d server/%identity%
echo del *.sav
echo del *.sav.*
echo del *.map
echo del *.db
echo del *.db-journal
echo del *.db-wal
echo goto finishbp
echo :wipemap
echo echo.
echo echo WARNING: THIS WILL WIPE YOUR SERVER'S MAP AND PLAYER DATA. BE SURE YOU WANT TO CONTINUE.
echo pause
echo echo.
echo cd /d server/%identity%
echo del *.sav
echo del *.sav.*
echo del *.map
echo del player.deaths.*
echo del player.identities.*
echo del player.states.*
echo del player.tokens.*
echo del sv.files.*
echo goto finishmap
echo :finishbp
echo echo.
echo echo Server has been Map and BP Wiped!
echo echo.
echo echo Be sure to check your custom map link in your startup batch file!
echo echo Don't forget to delete any necessary plugin data!
echo echo.
echo pause
echo exit
echo :finishmap
echo echo.
echo echo Server has been Map Wiped!
echo echo.
echo echo Be sure to check your custom map link in your startup batch file!
echo echo Don't forget to delete any necessary plugin data!
echo echo.
echo pause
)>WipeServer.bat
REM Admin Check
cls
choice /c yn /m "Do you want to add yourself as an admin on the server now?: "
cls
IF ERRORLEVEL 2 goto finish
IF ERRORLEVEL 1 goto admin
:admin
REM This is not a valid SteamID, don't worry!
set steamid=12345678901234567
echo If you do not know your SteamID, please go here: https://www.businessinsider.com/how-to-find-steam-id
echo.
echo Admin and Moderator users are stored in the users.cfg folder located here: %forceinstall%\server\%identity%\cfg
echo.
set /p steamid="Enter your Steam64 ID: "
cd /d "%forceinstall%"\server\%identity%\cfg
(
echo ownerid %steamid% "unknown" "no reason"
)>users.cfg
cls
goto finish
:finish
echo All finished! You will see three batch files in %forceinstall%:
echo.
echo StartServer.bat is to launch your server.
echo UpdateServer.bat is to update your server (and Oxide if it was installed) come force wipe.
echo WipeServer.bat is to wipe your server. You will be given the choice of just a map or a full blueprint wipe.
echo.
choice /c yn /m "Do you want to run your new server now?: "
echo.
IF ERRORLEVEL 2 exit
IF ERRORLEVEL 1 goto serverstart
:serverstart
cd /d "%forceinstall%"
mode 120,30
title %comspec%
StartServer.bat