91 lines
2.6 KiB
Batchfile
91 lines
2.6 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 -m PyInstaller --version >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo Installing PyInstaller...
|
|
python -m pip install pyinstaller
|
|
echo.
|
|
) else (
|
|
echo PyInstaller found
|
|
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.
|
|
|
|
python -m 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...
|
|
python -m 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 Windows executable is located at:
|
|
echo dist\EBoek_Scraper.exe
|
|
echo.
|
|
echo Verifying file exists...
|
|
if exist "dist\EBoek_Scraper.exe" (
|
|
echo ✓ EBoek_Scraper.exe found
|
|
for %%f in ("dist\EBoek_Scraper.exe") do echo File size: %%~zf bytes
|
|
) else (
|
|
echo ❌ EBoek_Scraper.exe not found - build may have failed
|
|
)
|
|
echo.
|
|
echo ============================================
|
|
echo 🎉 Ready for Windows distribution!
|
|
echo ============================================
|
|
echo • Share the file: dist\EBoek_Scraper.exe
|
|
echo • No Python installation required on target PC
|
|
echo • Windows may show security warning on first run
|
|
echo (Click "More Info" → "Run Anyway")
|
|
echo.
|
|
pause |