forked from Fortigate/AutoAFK
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathupdate.bat
More file actions
59 lines (48 loc) · 1.42 KB
/
Copy pathupdate.bat
File metadata and controls
59 lines (48 loc) · 1.42 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
@echo off
setlocal enabledelayedexpansion
REM AutoAFK Updater Launcher
REM Check for self-updates and other staged files first
for /r "_internal" %%f in (*.new) do (
set "target=%%~dpnf"
echo [INFO] Applying update to %%~nxf...
del "!target!" >nul 2>&1
move "%%f" "!target!" >nul 2>&1
)
if exist "AutoAFKUpdater.py.new" (
echo [INFO] Applying updater update...
del "AutoAFKUpdater.py" >nul 2>&1
move "AutoAFKUpdater.py.new" "AutoAFKUpdater.py" >nul 2>&1
)
REM Try compiled updater first (in _internal folder)
if exist "_internal\AutoAFKUpdater.exe" (
_internal\AutoAFKUpdater.exe %*
exit /b %ERRORLEVEL%
)
REM Fallback to Python version
if exist "_internal\AutoAFKUpdater.py" (
echo [INFO] Using Python updater
REM Check Python
python --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Python not found!
echo [INFO] Download from: https://www.python.org/downloads/
pause
exit /b 1
)
REM Install requests if needed
python -c "import requests" 2>nul
if errorlevel 1 (
echo [INFO] Installing requests...
python -m pip install requests --quiet
)
python _internal\AutoAFKUpdater.py %*
exit /b %ERRORLEVEL%
)
if exist "AutoAFKUpdater.py" (
echo [INFO] Using Python updater
python AutoAFKUpdater.py %*
exit /b %ERRORLEVEL%
)
echo [ERROR] Updater not found in _internal folder!
pause
exit /b 1