-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
42 lines (33 loc) · 945 Bytes
/
build.bat
File metadata and controls
42 lines (33 loc) · 945 Bytes
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
@echo off
echo Building OCR Tool...
:: Create and activate virtual environment
python -m venv venv
call venv\Scripts\activate.bat
:: Install requirements
pip install -r requirements.txt
:: Uninstall PyInstaller and reinstall fresh without cache
pip uninstall -y pyinstaller
pip install --no-cache-dir pyinstaller
:: Create ICO file from PNG
python create_ico.py
:: Clean previous build
rmdir /s /q build dist
mkdir "dist"
:: Build executable
echo Building executable...
pyinstaller --clean build.spec
:: Verify the executable was created
if not exist "dist\OCR_to_Excel_Tool.exe" (
echo Error: Build failed - executable not created
exit /b 1
)
:: Create NSIS installer
echo Creating installer...
"C:\Program Files (x86)\NSIS\makensis.exe" installer.nsi
echo Build complete!
if exist "OCR_Tool_Setup.exe" (
echo Installer created successfully at "OCR_Tool_Setup.exe"
) else (
echo Error: Installer creation failed
)
pause