-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2 auto check all paks for conflict only automated.bat
More file actions
117 lines (100 loc) · 2.71 KB
/
Copy path2 auto check all paks for conflict only automated.bat
File metadata and controls
117 lines (100 loc) · 2.71 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
@echo off
setlocal EnableDelayedExpansion
chcp 65001 >nul
title PAK Conflict Analyzer [Windows 11]
:: Set colors for output and enable virtual terminal sequences
color 0b
reg add HKEY_CURRENT_USER\Console /v VirtualTerminalLevel /t REG_DWORD /d 1 /f >nul 2>&1
:: Store the script's directory and set target mods directory
set "SCRIPT_DIR=%~dp0"
:: python script should be in the same folder as this bat file
set "PYTHON_SCRIPT=%SCRIPT_DIR%1_Python_Merging_s2hoc.py"
:: location of your mods folder
set "MODS_DIR=E:\s2hoc\Stalker2\Content\Paks\~mods"
:: Clear screen
cls
echo [92m╔════════════════════════╗
echo ║ PAK Conflict Analyzer ║
echo ╚════════════════════════╝[0m
echo.
:: Validate if Python script exists
if not exist "%PYTHON_SCRIPT%" (
color 0c
echo [91m ERROR: Cannot find the Python script at:[0m
echo %PYTHON_SCRIPT%
echo.
echo Please ensure the batch file is in the same directory as the Python script.
echo.
pause
exit /b 1
)
:: Validate if mods directory exists
if not exist "%MODS_DIR%" (
color 0c
echo [91m ERROR: Mods directory not found at:[0m
echo %MODS_DIR%
echo.
pause
exit /b 1
)
:: Initialize variables
set "VALID_FILES="
set "FILE_COUNT=0"
echo [96mScanning for .pak files in:[0m
echo %MODS_DIR%
echo and its subfolders...
echo.
:: Find all .pak files recursively
for /r "%MODS_DIR%" %%F in (*.pak) do (
set /a FILE_COUNT+=1
set "VALID_FILES=!VALID_FILES! "%%~fF""
echo [90m⚬ Found:[0m %%~nxF
)
:: Check if we found any .pak files
if %FILE_COUNT% equ 0 (
color 0c
echo [91m ERROR: No .pak files found in the mods directory.[0m
echo.
pause
exit /b 1
)
:: Try to locate Python
where python >nul 2>nul
if %ERRORLEVEL% neq 0 (
where py >nul 2>nul
if %ERRORLEVEL% neq 0 (
color 0c
echo [91m ERROR: Python is not found in the system PATH[0m
echo Please install Python and ensure it's added to the system PATH
echo.
pause
exit /b 1
)
set "PYTHON_CMD=py"
) else (
set "PYTHON_CMD=python"
)
:: Display summary
color 0a
echo.
echo [92m Found %FILE_COUNT% .pak files to analyze [0m
echo.
echo [93m Starting conflict analysis...[0m
echo [90m This will NOT merge any files - analysis only mode[0m
echo.
:: Execute the Python script with the analyze flag
%PYTHON_CMD% "%PYTHON_SCRIPT%" --analyze %VALID_FILES%
:: Check if Python script execution had an error
if %ERRORLEVEL% neq 0 (
color 0c
echo.
echo [91m ERROR: The conflict analysis encountered an error.[0m
echo.
pause
exit /b 1
)
:: Normal exit
echo.
echo [92m✓ Analysis complete![0m
pause
exit /b 0