-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrun-main.bat
44 lines (36 loc) · 1008 Bytes
/
run-main.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
40
41
42
43
44
@echo off
setlocal
where python >nul 2>nul
if %errorlevel%==0 (
echo Python sudah terinstall.
notepad "./.env"
python -m pip install -r windows.txt >nul 2>nul
echo menjalankan script main.py
python main.py
goto end
)
where python3 >nul 2>nul
if %errorlevel%==0 (
echo Python sudah terinstall.
notepad "./.env"
python3 -m pip install -r windows.txt >nul 2>nul
echo menjalankan script main.py
python3 main.py
goto end
)
echo Python tidak ditemukan. Mengunduh dan menginstal Python...
curl -o python-installer.exe https://www.python.org/ftp/python/3.12.6/python-3.12.6-amd64.exe
start /wait python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0
del python-installer.exe
where python >nul 2>nul
if %errorlevel%==0 (
echo Instalasi Python berhasil.
notepad "./.env"
python -m pip install -r windows.txt >nul 2>nul
echo menjalankan script main.py
python main.py
) else (
echo Instalasi Python gagal.
)
:end
pause