-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
57 lines (50 loc) · 1.5 KB
/
build.bat
File metadata and controls
57 lines (50 loc) · 1.5 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
@echo off
echo ============================================
echo BrainDead Background Remover - Build Script
echo ============================================
echo.
REM Check if venv exists
if not exist "build_env\Scripts\activate.bat" (
echo [*] Creating isolated virtual environment...
python -m venv build_env
if errorlevel 1 (
echo [!] Failed to create virtual environment
pause
exit /b 1
)
)
REM Activate venv
echo [*] Activating virtual environment...
call build_env\Scripts\activate.bat
REM Install dependencies in isolated env
echo [*] Installing dependencies in isolated environment...
pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
REM Build executable
echo.
echo [*] Building portable executable...
pyinstaller --onefile --windowed --name BrainDeadBGRemover ^
--hidden-import rembg ^
--hidden-import onnxruntime ^
--hidden-import PIL._tkinter_finder ^
--collect-all rembg ^
--collect-data tkinterdnd2 ^
bg_remover.py
REM Deactivate venv
call deactivate
REM Copy to root
if exist dist\BrainDeadBGRemover.exe (
copy /Y dist\BrainDeadBGRemover.exe .
echo.
echo ============================================
echo SUCCESS! BrainDeadBGRemover.exe created
echo ============================================
echo.
echo The executable is fully portable.
echo You can delete the build_env folder after building.
) else (
echo.
echo [!] Build may have failed. Check output above.
)
pause