File tree Expand file tree Collapse file tree 2 files changed +51
-53
lines changed Expand file tree Collapse file tree 2 files changed +51
-53
lines changed Original file line number Diff line number Diff line change
1
+ @ echo off
2
+ setlocal enabledelayedexpansion
3
+ for /F %%a in ('echo prompt $E ^ | cmd') do set " ESC = %%a "
4
+ set " packId = REPLACE_ME"
5
+ set " packVersion = REPLACE_ME"
6
+
7
+ set " downloadUrl = https://github.com/FTBTeam/FTB-Server-Installer/releases/latest/download/ftb-server-"
8
+
9
+ IF " %packId% " == " " (
10
+ echo %ESC% [31mMissing pack id, if you renamed this bat file undo your changes otherwise contact FTB%ESC% [0m
11
+ exit /b 1
12
+ )
13
+ IF " %packId% " == " REPLACE_ME" (
14
+ echo %ESC% [31mInvalid pack id " %packVersion% " , please contact FTB%ESC% [0m
15
+ exit /b 1
16
+ )
17
+ IF " %packVersion% " == " " (
18
+ echo %ESC% [31mMissing pack version, if you renamed this bat file undo your changes otherwise contact FTB%ESC% [0m
19
+ exit /b 1
20
+ )
21
+ IF " %packVersion% " == " REPLACE_ME" (
22
+ echo %ESC% [31mInvalid pack version " %packVersion% " , please contact FTB%ESC% [0m
23
+ exit /b 1
24
+ )
25
+
26
+ echo PackId: %packId%
27
+ echo PackVersion: %packVersion%
28
+
29
+ reg query " HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE > nul 2 >& 1
30
+ for /f " tokens=3" %%A in ('reg query " HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE 2^ > nul ') do set " sysArch = %%A "
31
+
32
+
33
+ set " arch = amd64"
34
+ if /i " %sysArch% " == " ARM64" (
35
+ set " arch = arm64"
36
+ )
37
+
38
+ set " completeUrl = %downloadUrl% windows-%arch% .exe"
39
+
40
+ echo Downloading FTB Server Installer from: %completeUrl%
41
+
42
+ curl -L -o serverinstaller_%packId% _%packVersion% .exe %completeUrl%
43
+
44
+ IF %ERRORLEVEL% NEQ 0 (
45
+ echo %ESC% [31mFailed to download the file. Please check the URL or your internet connection.%ESC% [0m
46
+ pause
47
+ exit /b %ERRORLEVEL%
48
+ )
49
+
50
+ echo %ESC% [32mDownloaded FTB Server Installer to: %~dp0 serverinstaller_%packId% _%packVersion% .exe%ESC% [0m
51
+ echo %ESC% [36mYou can now run the installer using the command: .\serverinstaller_%packId% _%packVersion% .exe%ESC% [0m
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments