forked from Mikael/MicroVolts-Server-Setup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_setup.bat
More file actions
47 lines (40 loc) · 1.11 KB
/
run_setup.bat
File metadata and controls
47 lines (40 loc) · 1.11 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
@echo off
echo MicroVolts Server Setup
echo ============================
echo.
REM Request administrator privileges
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
powershell -Command "Start-Process cmd.exe -ArgumentList '/c %~s0' -Verb RunAs"
exit
)
cd /d "%~dp0"
REM Check for updates
echo Checking for updates...
git remote update
git status -uno | findstr /C:"Your branch is behind" > nul
if not errorlevel 1 (
echo New version found. Updating...
git pull
echo Restarting script...
start "" "%~f0"
exit
) else (
echo Already up to date.
)
REM Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
echo Error: Python is not installed or not in PATH
echo Please install Python 3.7 or later from https://python.org
pause
exit /b 1
)
REM Install requirements if needed
echo Installing required packages...
pip install -r requirements.txt
REM Run the setup script
echo Starting MicroVolts Server Setup GUI...
python microvolts_server_setup.py
pause