From 241c5c16d61f373058c30fda9bf3ab054bf8f2b7 Mon Sep 17 00:00:00 2001 From: dazedanon Date: Wed, 10 Sep 2025 15:02:59 -0500 Subject: [PATCH] Add bat script for startin GUI --- START.bat | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ start.py | 3 -- 2 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 START.bat delete mode 100644 start.py diff --git a/START.bat b/START.bat new file mode 100644 index 0000000..8b314cd --- /dev/null +++ b/START.bat @@ -0,0 +1,109 @@ +@echo off +setlocal EnableDelayedExpansion + +echo ========================================== +echo DazedMTLTool Startup Script +echo ========================================== +echo. + +:: Check if Python is installed and get version +echo [1/4] Checking Python installation... +python --version >nul 2>&1 +if errorlevel 1 ( + echo ERROR: Python is not installed or not in PATH. + echo Please install Python 3.12 or higher from https://python.org + pause + exit /b 1 +) + +:: Get Python version and check if it's 3.12 or higher +for /f "tokens=2" %%i in ('python --version 2^>^&1') do set PYTHON_VERSION=%%i +for /f "tokens=1,2 delims=." %%a in ("%PYTHON_VERSION%") do ( + set MAJOR=%%a + set MINOR=%%b +) + +if !MAJOR! LSS 3 ( + echo ERROR: Python version !PYTHON_VERSION! is too old. + echo Please install Python 3.12 or higher. + pause + exit /b 1 +) + +if !MAJOR! EQU 3 if !MINOR! LSS 12 ( + echo ERROR: Python version !PYTHON_VERSION! is too old. + echo Please install Python 3.12 or higher. + pause + exit /b 1 +) + +echo ✓ Python !PYTHON_VERSION! detected (compatible) +echo. + +:: Check if virtual environment exists +echo [2/4] Checking virtual environment... +if not exist "venv" ( + echo Creating virtual environment... + python -m venv venv + if errorlevel 1 ( + echo ERROR: Failed to create virtual environment. + pause + exit /b 1 + ) + echo ✓ Virtual environment created +) else ( + echo ✓ Virtual environment already exists +) +echo. + +:: Activate virtual environment +echo [3/4] Activating virtual environment... +call venv\Scripts\activate.bat +if errorlevel 1 ( + echo ERROR: Failed to activate virtual environment. + pause + exit /b 1 +) +echo ✓ Virtual environment activated +echo. + +:: Check and install dependencies +echo [4/4] Checking dependencies... +echo Checking if requirements are satisfied... + +:: Try importing key packages to see if they're installed +python -c "import PyQt5; import openai; import dotenv; import PIL; print('All dependencies satisfied')" >nul 2>&1 +if errorlevel 1 ( + echo Installing/updating requirements... + pip install -r requirements.txt + if errorlevel 1 ( + echo ERROR: Failed to install requirements. + pause + exit /b 1 + ) + echo ✓ Dependencies installed successfully +) else ( + echo ✓ All dependencies are already satisfied +) +echo. + +:: Launch the GUI +echo ========================================== +echo Launching DazedMTLTool GUI... +echo ========================================== +echo. + +python start_gui.py + +:: Check if GUI launched successfully +if errorlevel 1 ( + echo. + echo ERROR: Failed to launch GUI. + echo Check the error messages above. + pause + exit /b 1 +) + +echo. +echo GUI closed successfully. +pause \ No newline at end of file diff --git a/start.py b/start.py deleted file mode 100644 index 3956884..0000000 --- a/start.py +++ /dev/null @@ -1,3 +0,0 @@ -from modules.main import main - -main()