-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall_dependencies.bat
68 lines (60 loc) · 1.82 KB
/
install_dependencies.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@echo off
:: Ensure script is run as administrator
net session >nul 2>&1
if %errorLevel% neq 0 (
echo This script requires administrative privileges. Please run as administrator.
pause
exit /b
)
:: Check if Python is installed
python --version >nul 2>&1
if %errorLevel% neq 0 (
echo Python is not installed. Please install Python and add it to the PATH.
pause
exit /b
)
:: Install Python packages
echo Installing Python packages...
python -m pip install google-generativeai PyQt5==5.15.6 google pyqtgraph
if %errorLevel% neq 0 (
echo Failed to install Python packages.
pause
exit /b
)
:: Check if PowerShell is available
powershell -Command "exit 0" >nul 2>&1
if %errorLevel% neq 0 (
echo PowerShell is not available. Please install PowerShell.
pause
exit /b
)
:: Run PowerShell commands to download and install Google Cloud SDK
echo Downloading Google Cloud SDK...
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe', '%TEMP%\GoogleCloudSDKInstaller.exe')"
if %errorLevel% neq 0 (
echo Failed to download Google Cloud SDK.
pause
exit /b
)
echo Installing Google Cloud SDK...
powershell -Command "Start-Process '%TEMP%\GoogleCloudSDKInstaller.exe' -Wait"
if %errorLevel% neq 0 (
echo Failed to install Google Cloud SDK.
pause
exit /b
)
:: Prompt user to login to Google Cloud SDK with timeout
echo Please log in to Google Cloud SDK...
start "" "cmd.exe" /C "gcloud auth login && exit"
timeout /t 200
taskkill /im gcloud.exe /f >nul 2>&1
taskkill /im conhost.exe /f >nul 2>&1
:: Check if gcloud login was successful
gcloud auth list >nul 2>&1
if %errorLevel% neq 0 (
echo Google Cloud SDK login failed or was canceled.
pause
exit /b
)
echo Installation and setup complete.
pause