2.1 KiB
2.1 KiB
🪟 Windows Executable Build Guide
✅ Yes, Windows will have .exe extension!
PyInstaller automatically adds .exe extension when building on Windows.
🏗️ Building on Windows
Method 1: Simple Batch Script
# Double-click or run in Command Prompt
scripts\build_exe.bat
Method 2: Cross-Platform Python Script
python scripts\build_executable.py
📦 Expected Output
Windows build creates:
dist/
└── EBoek_Scraper.exe ← Windows executable (~30MB)
What happens:
- ✅ PyInstaller detects Windows platform
- ✅ Automatically adds
.exeextension - ✅ Creates
dist/EBoek_Scraper.exe - ✅ Bundles all dependencies (PyQt5, Selenium, Python runtime)
🚀 Distribution
Share this file: dist/EBoek_Scraper.exe
End users can:
- ✅ Double-click to run (no Python needed)
- ✅ Run from Command Prompt:
EBoek_Scraper.exe - ⚠️ May see Windows security warning on first run
🔐 Windows Security Warning
First run may show:
Windows protected your PC
Microsoft Defender SmartScreen prevented...
Solution:
- Click "More Info"
- Click "Run Anyway"
- This only happens once per PC
🧪 Testing
Verify build worked:
cd dist
dir EBoek_Scraper.exe
EBoek_Scraper.exe --help
💡 Platform-Specific Notes
| Build Platform | Creates | Best For |
|---|---|---|
| Windows | .exe file |
✅ Windows distribution |
| macOS | .app + Unix binary |
✅ macOS distribution |
| Linux | Unix binary | ✅ Linux distribution |
Best practice: Build on the target operating system for optimal compatibility.
🛠️ Troubleshooting
Build fails on Windows:
- Install Python 3.8+ from python.org
- Ensure pip works:
pip --version - Install dependencies:
pip install -r requirements.txt - Try again:
scripts\build_exe.bat
Missing .exe after build:
- Check
dist/folder contents - Look for error messages in build output
- Try alternative:
python -m PyInstaller --onefile --windowed gui_main.py
🎉 Windows users will definitely get a proper .exe file!