-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.bat
More file actions
61 lines (50 loc) · 1.37 KB
/
Copy pathsetup.bat
File metadata and controls
61 lines (50 loc) · 1.37 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
@echo off
REM AutoMail Agent - Simple Setup Script
setlocal enabledelayedexpansion
REM Check Python
where python >nul 2>&1
if %errorlevel% neq 0 (
where python3 >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Python is not installed. Please install Python 3.8+ and try again.
pause
exit /b 1
) else (
set "PYTHON_CMD=python3"
)
) else (
set "PYTHON_CMD=python"
)
echo [SUCCESS] Python found
REM Check if we're in project directory
if not exist "requirements.txt" (
echo [ERROR] requirements.txt not found. Please run this script from the project directory.
pause
exit /b 1
)
echo [INFO] Setting up virtual environment...
if exist "venv" (
rmdir /s /q venv
)
%PYTHON_CMD% -m venv venv
call venv\Scripts\activate.bat
echo [SUCCESS] Virtual environment created
echo [INFO] Installing Python dependencies...
python -m pip install --upgrade pip
pip install -r requirements.txt
echo [SUCCESS] Python dependencies installed
REM Set up basic permissions
echo [INFO] Setting up permissions...
if not exist "logs" mkdir logs >nul 2>&1
icacls . /grant %USERNAME%:F >nul 2>&1
echo [SUCCESS] Permissions configured
REM Create simple start script
(
echo @echo off
echo call venv\Scripts\activate.bat
echo python -m main
) > start.bat
echo [SUCCESS] Setup complete!
echo Run: start.bat or python -m main (after activating venv)
pause
endlocal