79 lines
2.1 KiB
Batchfile
79 lines
2.1 KiB
Batchfile
@echo off
|
|
REM Build script for EBoek.info Scraper Windows executable
|
|
REM Run this script to compile the application into a standalone .exe file
|
|
|
|
echo =====================================
|
|
echo Building EBoek.info Scraper
|
|
echo =====================================
|
|
echo.
|
|
|
|
REM Check if PyInstaller is installed
|
|
python -c "import PyInstaller" 2>nul
|
|
if errorlevel 1 (
|
|
echo Installing PyInstaller...
|
|
python -m pip install pyinstaller
|
|
echo.
|
|
)
|
|
|
|
REM Clean previous builds
|
|
if exist "dist" rmdir /s /q "dist"
|
|
if exist "build" rmdir /s /q "build"
|
|
echo Cleaned previous builds
|
|
echo.
|
|
|
|
REM Option 1: Quick build (single file executable)
|
|
echo Building single-file executable...
|
|
echo This may take a few minutes...
|
|
echo.
|
|
|
|
pyinstaller --onefile --windowed --name "EBoek_Scraper" ^
|
|
--hidden-import "PyQt5.QtCore" ^
|
|
--hidden-import "PyQt5.QtGui" ^
|
|
--hidden-import "PyQt5.QtWidgets" ^
|
|
--hidden-import "selenium" ^
|
|
--hidden-import "selenium.webdriver" ^
|
|
--hidden-import "selenium.webdriver.chrome" ^
|
|
--hidden-import "core.scraper" ^
|
|
--hidden-import "core.scraper_thread" ^
|
|
--hidden-import "core.credentials" ^
|
|
--hidden-import "gui.main_window" ^
|
|
--hidden-import "gui.login_dialog" ^
|
|
--hidden-import "gui.progress_dialog" ^
|
|
--hidden-import "utils.validators" ^
|
|
--exclude-module "tkinter" ^
|
|
--exclude-module "matplotlib" ^
|
|
..\gui_main.py
|
|
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo BUILD FAILED! Trying alternative method...
|
|
echo.
|
|
|
|
REM Option 2: Use spec file
|
|
echo Building with spec file...
|
|
pyinstaller eboek_scraper.spec
|
|
|
|
if errorlevel 1 (
|
|
echo BUILD FAILED!
|
|
echo Please check the error messages above.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
)
|
|
|
|
echo.
|
|
echo =====================================
|
|
echo BUILD SUCCESSFUL!
|
|
echo =====================================
|
|
echo.
|
|
echo Your executable is located at:
|
|
echo dist\EBoek_Scraper.exe
|
|
echo.
|
|
echo File size:
|
|
dir /b "dist\EBoek_Scraper.exe" | find /v "EBoek_Scraper.exe" || echo Not found
|
|
for %%f in ("dist\EBoek_Scraper.exe") do echo %%~zf bytes
|
|
echo.
|
|
echo You can now distribute this single file!
|
|
echo Note: Windows may show a security warning on first run.
|
|
echo.
|
|
pause |