forked from SumZer0-git/EDAPGui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_ed_ap.bat
More file actions
83 lines (69 loc) · 2.23 KB
/
start_ed_ap.bat
File metadata and controls
83 lines (69 loc) · 2.23 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
@echo off
REM EDAPGui Startup Script
REM Creates Python venv with 3.11/3.10/3.9 (whichever is available) and runs EDAPGui
REM Check if venv exists
if not exist "venv\Scripts\python.exe" (
echo Creating Python virtual environment...
echo This may take a moment, please wait...
REM Try Python versions in order of preference: 3.11, 3.10, 3.9, then fallback
set PYTHON_CMD=
REM Try py launcher with specific versions (Windows Python Launcher)
py -3.11 --version >nul 2>&1
if %errorlevel% == 0 (
set PYTHON_CMD=py -3.11
echo Found Python 3.11 via py launcher
goto create_venv
)
py -3.10 --version >nul 2>&1
if %errorlevel% == 0 (
set PYTHON_CMD=py -3.10
echo Found Python 3.10 via py launcher
goto create_venv
)
py -3.9 --version >nul 2>&1
if %errorlevel% == 0 (
set PYTHON_CMD=py -3.9
echo Found Python 3.9 via py launcher
goto create_venv
)
REM Try py launcher with latest
py --version >nul 2>&1
if %errorlevel% == 0 (
for /f "tokens=2" %%i in ('py --version 2^>^&1') do (
echo Found Python %%i via py launcher
set PYTHON_CMD=py
goto create_venv
)
)
REM Fallback to python command
python --version >nul 2>&1
if %errorlevel% == 0 (
for /f "tokens=2" %%i in ('python --version 2^>^&1') do (
echo Found Python %%i
set PYTHON_CMD=python
goto create_venv
)
)
echo Error: No suitable Python installation found. Please install Python 3.9, 3.10, or 3.11.
pause
exit /b 1
:create_venv
%PYTHON_CMD% -m venv venv
if not exist "venv\Scripts\python.exe" (
echo Error: Failed to create virtual environment
pause
exit /b 1
)
echo Installing requirements...
venv\Scripts\python -m pip install --upgrade pip
venv\Scripts\python -m pip install -r requirements.txt
if %errorlevel% neq 0 (
echo Error: Failed to install requirements
pause
exit /b 1
)
echo Virtual environment setup complete!
)
REM Run EDAPGui with venv python
echo Starting EDAPGui...
venv\Scripts\python.exe EDAPGui.py