-
Notifications
You must be signed in to change notification settings - Fork 14
/
run.bat
45 lines (35 loc) · 1.11 KB
/
run.bat
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
@echo off
setlocal enabledelayedexpansion
:: PixelLlama info
echo PixelLlama - version 0.95b
echo Launching...
:: Set the name of your virtual environment
set VENV_NAME=.env
:: Check if the virtual environment exists by looking for pyvenv.cfg
if not exist %VENV_NAME%\Scripts\python.exe (
echo Creating virtual environment...
python -m venv %VENV_NAME%
)
:: Activate the virtual environment
call %VENV_NAME%\Scripts\activate.bat
:: Check if required packages are installed by comparing installed versions
for %%i in (PyQt6 PyQt6-WebEngine requests) do (
pip show %%i >nul 2>&1
if errorlevel 1 (
set need_install=1
)
)
:: Check if requirements are installed
set REQUIREMENTS_FILE=requirements.txt
:: Install or upgrade the required packages only if needed
if defined need_install (
echo Installing/Upgrading required packages...
pip install -r requirements.txt
)
:: Run the Python script using pythonw
echo Running...
start "" pythonw main.py %*
:: Deactivate the virtual environment
deactivate
:: Exit the batch file (closes the terminal)
exit