You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.4 KiB
59 lines
1.4 KiB
@echo off
|
|
REM Tesla Coil Spark Course - Launch Script
|
|
REM Creates virtual environment and runs PyQt5 application
|
|
|
|
echo ========================================
|
|
echo Tesla Coil Spark Physics Course
|
|
echo ========================================
|
|
echo.
|
|
|
|
REM Navigate to spark-lessons directory
|
|
cd spark-lessons
|
|
|
|
REM Check if virtual environment exists
|
|
if not exist venv (
|
|
echo [*] Creating virtual environment...
|
|
python -m venv venv
|
|
if errorlevel 1 (
|
|
echo [ERROR] Failed to create virtual environment!
|
|
echo Please ensure Python 3.8+ is installed and in PATH.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
echo [OK] Virtual environment created
|
|
)
|
|
|
|
REM Activate virtual environment
|
|
echo [*] Activating virtual environment...
|
|
call venv\Scripts\activate.bat
|
|
|
|
REM Check if dependencies are installed
|
|
if not exist venv\installed.flag (
|
|
echo [*] Installing dependencies...
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
if errorlevel 1 (
|
|
echo [ERROR] Failed to install dependencies!
|
|
pause
|
|
exit /b 1
|
|
)
|
|
echo. > venv\installed.flag
|
|
echo [OK] Dependencies installed
|
|
)
|
|
|
|
REM Run the application
|
|
echo [*] Launching Tesla Coil Spark Course...
|
|
echo.
|
|
python app/main.py
|
|
|
|
REM Capture exit code
|
|
set EXIT_CODE=%ERRORLEVEL%
|
|
|
|
REM Deactivate virtual environment
|
|
call deactivate
|
|
|
|
REM Return to original directory
|
|
cd ..
|
|
|
|
REM Exit with application's exit code
|
|
exit /b %EXIT_CODE%
|