Advertisement
TDHooligan

PY Install

May 22nd, 2025
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. setlocal ENABLEDELAYEDEXPANSION
  3.  
  4. REM ----------------------------
  5. REM Configuration
  6. REM ----------------------------
  7. set PYTHON_VERSION=3.11.8
  8. set INSTALLER_NAME=python-%PYTHON_VERSION%-amd64.exe
  9. set DOWNLOAD_URL=https://www.python.org/ftp/python/%PYTHON_VERSION%/%INSTALLER_NAME%
  10. set REQUIREMENTS=pillow tkinterdnd2
  11.  
  12. REM ----------------------------
  13. REM Check if Python is installed
  14. REM ----------------------------
  15. where python >nul 2>&1
  16. if %ERRORLEVEL%==0 (
  17.     echo Python is already installed.
  18. ) else (
  19.     echo Python not found. Downloading and installing...
  20.  
  21.     REM Download Python installer
  22.     curl -o %INSTALLER_NAME% %DOWNLOAD_URL%
  23.     if NOT EXIST %INSTALLER_NAME% (
  24.         echo Failed to download Python installer.
  25.         exit /b 1
  26.     )
  27.  
  28.     REM Install Python for current user only
  29.     %INSTALLER_NAME% /quiet InstallLauncherAllUsers=0 InstallAllUsers=0 PrependPath=1 Include_pip=1
  30.  
  31.     REM Delete installer after install
  32.     del %INSTALLER_NAME%
  33. )
  34.  
  35. REM ----------------------------
  36. REM Upgrade pip and install requirements
  37. REM ----------------------------
  38. echo Installing required pip packages...
  39. python -m pip install --upgrade pip
  40. python -m pip install %REQUIREMENTS%
  41.  
  42. echo.
  43. echo Setup complete.
  44. pause
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement