-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
105 lines (90 loc) · 3.09 KB
/
setup.bat
File metadata and controls
105 lines (90 loc) · 3.09 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
@echo off
REM ============================================================================
REM RegressionLab - Setup Script for Windows
REM ============================================================================
REM This script sets up the development environment for RegressionLab
REM ============================================================================
REM Change to project root directory (where this script lives)
cd /d "%~dp0"
echo.
echo ====================================
echo RegressionLab Setup (Windows)
echo ====================================
echo.
REM Check if Python is installed
python --version >nul 2>&1
if errorlevel 1 (
echo ERROR: Python is not installed or not in PATH
echo Please install Python 3.12 or higher from https://www.python.org/
pause
exit /b 1
)
echo [1/7] Checking Python version...
python --version
REM Check Python version is 3.12 or higher
python -c "import sys; exit(0 if sys.version_info >= (3, 12) else 1)" >nul 2>&1
if errorlevel 1 (
echo ERROR: Python 3.12 or higher is required
pause
exit /b 1
)
echo Python version OK
echo.
echo [2/7] Creating virtual environment...
if exist .venv (
echo Virtual environment already exists, skipping creation
) else (
python -m venv .venv
echo Virtual environment created
)
echo.
echo [3/7] Activating virtual environment...
call .venv\Scripts\activate.bat
echo.
echo [4/7] Upgrading pip...
python -m pip install --upgrade pip
echo.
echo [5/7] Installing dependencies...
pip install -r requirements.txt
echo.
echo [6/7] Setting up environment file...
if exist .env (
echo .env file already exists, skipping
) else (
if exist .env.example (
copy .env.example .env >nul
echo .env file created from .env.example
) else (
echo Warning: .env.example not found, skipping .env creation
)
)
echo.
echo [7/7] Creating desktop shortcut...
set "DESKTOP=%USERPROFILE%\Desktop"
set "SHORTCUT_NAME=RegressionLab.lnk"
set "TARGET_PATH=%~dp0bin\run.bat"
set "WORKING_DIR=%~dp0"
set "ICON_PATH=%~dp0images\RegressionLab_icon_low_res.ico"
REM Create shortcut using PowerShell
powershell -Command "$WshShell = New-Object -ComObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut('%DESKTOP%\%SHORTCUT_NAME%'); $Shortcut.TargetPath = '%TARGET_PATH%'; $Shortcut.WorkingDirectory = '%WORKING_DIR%'; $Shortcut.IconLocation = '%ICON_PATH%'; $Shortcut.Description = 'RegressionLab - Quick Launch'; $Shortcut.Save()" >nul 2>&1
if errorlevel 1 (
echo Warning: Could not create desktop shortcut
) else (
echo Desktop shortcut created successfully
)
echo.
echo ====================================
echo Setup Complete!
echo ====================================
echo.
echo To run RegressionLab:
echo 1. Activate the virtual environment: .venv\Scripts\activate.bat
echo 2. Run the program: python main_program.py
echo.
echo Or simply use: bin\run.bat
echo Or double-click the desktop shortcut: RegressionLab.lnk
echo.
echo To configure the application:
echo 1. Edit .env with your preferences (already created during setup)
echo.
pause