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

36 lines
729 B
Batchfile
Raw Normal View History

2023-04-02 20:37:04 +02:00
@ECHO off
:: Check python installation
2023-04-02 21:43:48 +02:00
python.exe --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-03 05:00:18 +02:00
:: Variables
set "pipR=pip install -r .\requirements.txt"
set "run=.\main.py"
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-02 21:43:48 +02:00
:: Install dependencies
2023-04-03 05:00:18 +02:00
%LOCALAPPDATA%\Microsoft\WindowsApps\python.exe -m %pipR%
2023-04-02 21:43:48 +02:00
:: Run app
2023-04-03 05:00:18 +02:00
%LOCALAPPDATA%\Microsoft\WindowsApps\python.exe %run%
2023-04-02 20:37:04 +02:00
2023-04-02 21:43:48 +02:00
) ELSE (
:: Check dependencies
2023-04-03 05:00:18 +02:00
python.exe -m %pipR% > NUL
2023-04-02 21:43:48 +02:00
:: Run app
2023-04-03 05:00:18 +02:00
python.exe %run%
2023-04-02 21:43:48 +02:00
)
2023-04-02 20:37:04 +02:00
EXIT /b