Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal ENABLEDELAYEDEXPANSION
- REM ----------------------------
- REM Configuration
- REM ----------------------------
- set PYTHON_VERSION=3.11.8
- set INSTALLER_NAME=python-%PYTHON_VERSION%-amd64.exe
- set DOWNLOAD_URL=https://www.python.org/ftp/python/%PYTHON_VERSION%/%INSTALLER_NAME%
- set REQUIREMENTS=pillow tkinterdnd2
- REM ----------------------------
- REM Check if Python is installed
- REM ----------------------------
- where python >nul 2>&1
- if %ERRORLEVEL%==0 (
- echo Python is already installed.
- ) else (
- echo Python not found. Downloading and installing...
- REM Download Python installer
- curl -o %INSTALLER_NAME% %DOWNLOAD_URL%
- if NOT EXIST %INSTALLER_NAME% (
- echo Failed to download Python installer.
- exit /b 1
- )
- REM Install Python for current user only
- %INSTALLER_NAME% /quiet InstallLauncherAllUsers=0 InstallAllUsers=0 PrependPath=1 Include_pip=1
- REM Delete installer after install
- del %INSTALLER_NAME%
- )
- REM ----------------------------
- REM Upgrade pip and install requirements
- REM ----------------------------
- echo Installing required pip packages...
- python -m pip install --upgrade pip
- python -m pip install %REQUIREMENTS%
- echo.
- echo Setup complete.
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement