Repository navigation
Expand file tree
/
Copy pathinstall.bat
More file actions
61 lines (50 loc) · 1.6 KB
/
Copy pathinstall.bat
File metadata and controls
61 lines (50 loc) · 1.6 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 install.bat — Deploy BeamOnTarget into a Python virtual environment on Windows.
REM
REM Usage:
REM install.bat — installs into .\venv (default)
REM install.bat C:\bot\env — installs into C:\bot\env
REM
REM After installation:
REM venv\Scripts\activate
REM beamontarget — launches the GUI
REM python -m beamontarget.workflows.run_simulation -i config.json — runs a headless simulation
setlocal
set "SCRIPT_DIR=%~dp0"
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
set "VENV_DIR=%~1"
if "%VENV_DIR%"=="" set "VENV_DIR=%SCRIPT_DIR%\venv"
echo === BeamOnTarget Installer ===
echo Source: %SCRIPT_DIR%
echo Venv: %VENV_DIR%
echo.
if not exist "%VENV_DIR%\Scripts\python.exe" (
echo Creating virtual environment...
python -m venv "%VENV_DIR%"
if errorlevel 1 goto :error
)
echo Activating environment...
call "%VENV_DIR%\Scripts\activate.bat"
if errorlevel 1 goto :error
echo Upgrading pip...
"%VENV_DIR%\Scripts\python.exe" -m pip install --upgrade pip setuptools wheel
if errorlevel 1 goto :error
echo Installing BeamOnTarget...
"%VENV_DIR%\Scripts\python.exe" -m pip install -e "%SCRIPT_DIR%"
if errorlevel 1 goto :error
echo.
echo === Installation complete ===
echo.
echo To use:
echo BeamOnTarget.cmd ^<^< double-click to launch the GUI
echo %VENV_DIR%\Scripts\activate
echo beamontarget — launch the GUI
echo python -m beamontarget.workflows.run_simulation -i config.json
echo.
endlocal
exit /b 0
:error
echo.
echo ERROR: Installation failed. Review the message above.
endlocal
exit /b 1