This repository has been archived on 2023-09-02. You can view files and clone it, but cannot push or open issues or pull requests.
csh/run.bat

38 lines
730 B
Batchfile
Raw Normal View History

2023-04-02 20:37:04 +02:00
@ECHO off
2023-04-05 12:14:31 +02:00
:: Variables
SET "pipR=pip install -r .\requirements.txt"
SET "py=python.exe"
2023-04-02 20:37:04 +02:00
:: Check python installation
2023-04-05 12:14:31 +02:00
%py% --version > NUL
2023-04-02 22:37:54 +02:00
:: Clean potential error or python version
2023-04-02 21:43:48 +02:00
CLS
2023-04-02 22:37:54 +02:00
2023-04-02 20:37:04 +02:00
IF errorlevel 1 (
ECHO Installation of Python not found, installation...
2023-04-02 21:43:48 +02:00
:: Install Python 3.11 from MS Store
ECHO Y | winget install -he 9NRWMJP3717K
2023-04-02 20:37:04 +02:00
ECHO Download and installation of dependencies...
2023-04-04 10:46:48 +02:00
:: Location of Python
2023-04-04 10:57:20 +02:00
SET "py=%LOCALAPPDATA%\Microsoft\WindowsApps\%py%"
2023-04-02 21:43:48 +02:00
2023-04-04 10:46:48 +02:00
:: Update pip
%py% -m pip install --upgrade pip
2023-04-02 20:37:04 +02:00
2023-04-04 10:46:48 +02:00
:: Install dependencies
%py% -m %pipR%
2023-04-02 21:43:48 +02:00
) ELSE (
:: Check dependencies
2023-04-05 12:14:31 +02:00
%py% -m %pipR% > NUL
2023-04-02 21:43:48 +02:00
)
2023-04-02 20:37:04 +02:00
2023-04-04 10:46:48 +02:00
:: Run app
2023-04-04 11:04:31 +02:00
%py% .\main.py
2023-04-04 10:46:48 +02:00
2023-04-02 20:37:04 +02:00
EXIT /b