-
Notifications
You must be signed in to change notification settings - Fork 371
/
INSTALL PACKAGES.bat
executable file
·39 lines (30 loc) · 1.27 KB
/
INSTALL PACKAGES.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
@echo off
:: Check for Python Installation
py -3 --version 2>NUL
if errorlevel 1 goto errorNoPython
:: Reaching here means Python is installed.
IF EXIST "python-3.6.0-amd64.exe" (
del "python-3.6.0-amd64.exe"
)
cls
ECHO Installing the required packages for the bot!
TIMEOUT 3
py -3 -m pip install -U -r requirements.txt
ECHO Done! Now run START BOT.bat
PAUSE
:: Once done, exit the batch file -- skips executing the errorNoPython section
goto:eof
:errorNoPython
TITLE PartyBot^: Error
echo Error^: Python not installed or not added to PATH.
:: set mypath=%cd%
:: bitsadmin.exe /transfer "InstallPython" https://www.python.org/ftp/python/3.7.0/python-3.7.0-amd64.exe %mypath%\python-3.7.0-amd64.exe
IF EXIST "python-3.7.0-amd64.exe" (
echo Python Installer is already installed, install and/or add Python to PATH
) ELSE (
echo Installing Python Installer now, this will take a minute or 2.
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://www.python.org/ftp/python/3.6.0/python-3.6.0-amd64.exe', 'python-3.7.0-amd64.exe')"
powershell -Command "Invoke-WebRequest https://www.python.org/ftp/python/3.7.0/python-3.7.0-amd64.exe -OutFile python-3.7.0-amd64.exe"
echo Python Installer is now installed, install and/or add Python to PATH.
)
cmd /k