forked from SomeOddCodeGuy/WilmerAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_windows.bat
More file actions
67 lines (59 loc) · 1.51 KB
/
run_windows.bat
File metadata and controls
67 lines (59 loc) · 1.51 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
@echo off
set "CONFIG_DIR="
set "USER= "
:parse_args
if "%~1"=="" goto :done
if /i "%~1"=="--ConfigDirectory" (
set "CONFIG_DIR=%~2"
shift
)
if /i "%~1"=="--User" (
set "USER=%~2"
shift
)
shift
goto :parse_args
:done
echo Creating virtual environment...
python -m venv venv
if %ERRORLEVEL% NEQ 0 (
echo Failed to create virtual environment.
exit /b %ERRORLEVEL%
)
echo Virtual environment created successfully.
echo Activating virtual environment...
call venv\Scripts\activate
if %ERRORLEVEL% NEQ 0 (
echo Failed to activate virtual environment.
exit /b %ERRORLEVEL%
)
echo Virtual environment activated.
echo Installing dependencies from requirements.txt...
pip install -r requirements.txt
if %ERRORLEVEL% NEQ 0 (
echo Failed to install dependencies.
exit /b %ERRORLEVEL%
)
echo Dependencies installed successfully.
echo.
echo ========================================
echo Starting WilmerAI with Waitress
echo (Production WSGI server for Windows)
echo ========================================
echo.
REM Pass arguments to run_waitress.py to maintain WilmerAI's config system
if not "%CONFIG_DIR%"=="" (
if not "%USER%"=="" (
python run_waitress.py --ConfigDirectory "%CONFIG_DIR%" --User "%USER%"
) else (
python run_waitress.py --ConfigDirectory "%CONFIG_DIR%"
)
) else if not "%USER%"=="" (
python run_waitress.py --User "%USER%"
) else (
python run_waitress.py
)
if %ERRORLEVEL% NEQ 0 (
echo Failed to start the application.
exit /b %ERRORLEVEL%
)