-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall.bat
More file actions
168 lines (144 loc) Β· 6.27 KB
/
install.bat
File metadata and controls
168 lines (144 loc) Β· 6.27 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
@echo off
setlocal enabledelayedexpansion
:: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
:: OpenWhale Windows Installer (Batch)
:: Usage: Double-click this file, or run from Command Prompt
:: For best results, run as Administrator
:: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
title OpenWhale Installer
echo.
echo ================================================================
echo = =
echo = OpenWhale Windows Installer =
echo = =
echo ================================================================
echo.
:: Default install directory
set "INSTALL_DIR=%USERPROFILE%\openwhale"
echo Install location: %INSTALL_DIR%
echo.
:: ββ Step 1: Check Git ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo [1/7] Checking Git...
git --version >nul 2>&1
if %errorlevel% equ 0 (
for /f "tokens=3" %%v in ('git --version') do echo Found: Git %%v
) else (
echo Git not found. Installing via winget...
winget install --id Git.Git -e --source winget --accept-package-agreements --accept-source-agreements
if %errorlevel% neq 0 (
echo ERROR: Could not install Git.
echo Please install manually from https://git-scm.com/download/win
pause
exit /b 1
)
:: Refresh PATH
call refreshenv >nul 2>&1
set "PATH=%ProgramFiles%\Git\cmd;%PATH%"
echo Git installed!
)
:: ββ Step 2: Check Node.js ββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo.
echo [2/7] Checking Node.js...
node -v >nul 2>&1
if %errorlevel% equ 0 (
for /f %%v in ('node -v') do echo Found: Node.js %%v
) else (
echo Node.js not found. Installing via winget...
winget install --id OpenJS.NodeJS.LTS -e --source winget --accept-package-agreements --accept-source-agreements
if %errorlevel% neq 0 (
echo ERROR: Could not install Node.js.
echo Please install manually from https://nodejs.org/
pause
exit /b 1
)
call refreshenv >nul 2>&1
echo Node.js installed!
)
:: ββ Step 3: Check pnpm ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo.
echo [3/7] Checking pnpm...
pnpm -v >nul 2>&1
if %errorlevel% equ 0 (
for /f %%v in ('pnpm -v') do echo Found: pnpm %%v
) else (
echo Installing pnpm...
call npm install -g pnpm
echo pnpm installed!
)
:: ββ Step 4: Clone Repository βββββββββββββββββββββββββββββββββββββββββββββββββ
echo.
echo [4/7] Cloning OpenWhale repository...
echo Target: %INSTALL_DIR%
if exist "%INSTALL_DIR%\.git" (
echo Repository already exists. Pulling latest...
pushd "%INSTALL_DIR%"
git pull origin main
popd
echo Updated!
) else (
git clone https://github.com/viralcode/openwhale.git "%INSTALL_DIR%"
if %errorlevel% neq 0 (
echo ERROR: Clone failed. Check your internet connection.
pause
exit /b 1
)
echo Cloned successfully!
)
:: ββ Step 5: Install Dependencies βββββββββββββββββββββββββββββββββββββββββββββ
echo.
echo [5/7] Installing dependencies (this may take a few minutes)...
pushd "%INSTALL_DIR%"
call pnpm install
if %errorlevel% neq 0 (
echo pnpm install had issues, trying npm fallback...
call npm install
)
:: ββ Step 6: Build Native Modules βββββββββββββββββββββββββββββββββββββββββββββ
echo.
echo [6/7] Building native modules...
echo Select all packages when prompted.
call pnpm approve-builds
:: ββ Step 7: Setup Environment ββββββββββββββββββββββββββββββββββββββββββββββββ
echo.
echo [7/7] Setting up environment...
if not exist ".env" (
if exist ".env.example" (
copy ".env.example" ".env" >nul
echo Created .env from template.
echo Edit .env to add your AI API keys.
) else (
echo No .env.example found. Create .env manually.
)
) else (
echo .env already exists, skipping.
)
popd
:: ββ Done βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
echo.
echo ================================================================
echo = =
echo = OpenWhale installed successfully! =
echo = =
echo ================================================================
echo.
echo Location: %INSTALL_DIR%
echo Dashboard: http://localhost:7777/dashboard
echo.
echo Next steps:
echo 1. cd %INSTALL_DIR%
echo 2. Edit .env and add your AI API keys
echo 3. pnpm run dev
echo 4. Open http://localhost:7777/dashboard
echo 5. Login with admin / admin
echo.
set /p START_NOW=" Start OpenWhale now? (Y/n): "
if /i "%START_NOW%" neq "n" (
echo.
echo Starting OpenWhale...
echo Press Ctrl+C to stop the server.
echo.
pushd "%INSTALL_DIR%"
call pnpm run dev
popd
)
pause