-
Notifications
You must be signed in to change notification settings - Fork 47
/
xi_checker.bat
54 lines (45 loc) · 1.57 KB
/
xi_checker.bat
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
@ECHO OFF
CLS
:: Exit Codes
:: -1 - variable used for server not found
:: -2 - DirectPlay not installed
:: -3 - POL path not found
:: -4 - xiloader not in POL path
IF %1.==. (
@ECHO Server not provided:
@ECHO xiloader dankstar.server.biz
EXIT /B -1
)
SETLOCAL ENABLEEXTENSIONS
:: Find DirectPlay
FOR /F "usebackq skip=2 tokens=3*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Notifications\OptionalFeatures\DirectPlay" /v Selection 2^>nul`) DO (
SET DIRECT_PLAY=%%A
)
IF NOT DEFINED DIRECT_PLAY (
@ECHO DirectPlay not installed, install via Turning On/Off Windows Features
EXIT /B -2
)
:: Find and set POL_PATH
SET POL_PATH_REGKEYS=(HKEY_LOCAL_MACHINE\SOFTWARE\PlayOnlineUS HKEY_LOCAL_MACHINE\SOFTWARE\PlayOnlineEU HKEY_LOCAL_MACHINE\SOFTWARE\PlayOnlineJP HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PlayOnlineUS HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PlayOnlineEU HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PlayOnlineJP)
SET INSTALL_FOLDER=\InstallFolder
set POL_PATH_VALUE=1000
SET POL_PATH=
FOR %%I IN %POL_PATH_REGKEYS% DO (
FOR /F "usebackq skip=2 tokens=3*" %%A IN (`REG QUERY "%%I%INSTALL_FOLDER%" /v %POL_PATH_VALUE% 2^>nul`) DO (
SET POL_PATH=%%A
GOTO PATH_FOUND
)
)
:PATH_FOUND
IF DEFINED POL_PATH (
IF EXIST "%POL_PATH%\xiloader.exe" (
START /d "%POL_PATH%" xiloader --server %1
) ELSE (
@ECHO xiloader.exe not found in POL path
@ECHO Copy xiloader.exe to %POL_PATH%
EXIT /B -4
)
) ELSE (
@ECHO POL path not found.
EXIT /B -3
)