-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRun.bat
More file actions
49 lines (44 loc) · 1.07 KB
/
Copy pathRun.bat
File metadata and controls
49 lines (44 loc) · 1.07 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
@echo off
setlocal enabledelayedexpansion
cd /d "%~dp0"
title WinFunct Terminal
:: Check admin
net session >nul 2>&1
if %errorlevel% NEQ 0 (
echo Requesting admin privileges...
PowerShell -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
exit
)
:: Check Python
where python >nul 2>nul
if %errorlevel% NEQ 0 (
echo Python not found in PATH. Please install Python 3.10+.
pause
exit /B 1
)
:: Check Git & update
where git >nul 2>nul
if %errorlevel% EQU 0 (
echo Checking for updates...
git fetch origin main >nul 2>&1
git rev-parse HEAD > "%TEMP%\wf_local.txt"
git rev-parse origin/main > "%TEMP%\wf_remote.txt"
fc "%TEMP%\wf_local.txt" "%TEMP%\wf_remote.txt" >nul 2>&1
if %errorlevel% NEQ 0 (
echo Pulling updates...
git pull
pip install -r requirements.txt >nul
) else (
echo Up to date.
)
del "%TEMP%\wf_local.txt" "%TEMP%\wf_remote.txt" 2>nul
)
:: Launch
if not exist "main.py" (
echo Error: main.py not found.
pause
exit /B 1
)
echo Starting WinFunct...
python main.py
exit /B 0