This document explains how to build the Kawkab AI Windows installer.
- Python 3.12 with all project dependencies installed (
uv sync --extra gpu --extra dev --extra build) - PyTorch with CUDA support
- PyInstaller (
uv sync --extra buildinstalls it) - (Optional) Inno Setup for creating the Windows installer
uv run python scripts/end_to_end_test.py --video data/real_match.mp4This ensures the codebase is working before bundling.
# Remove old build artifacts
Remove-Item -Recurse -Force build, dist -ErrorAction SilentlyContinue# Build as a directory distribution (faster, smaller startup)
uv run pyinstaller KawkabAI.spec
# Or build as a single .exe (slower startup, single file)
# Modify KawkabAI.spec: change EXE to have console=False and add --onefileOutput: dist/KawkabAI/ (folder with .exe and dependencies)
Bundle size: ~1.5-2.5 GB (includes PyTorch + ultralytics + all models)
Build time: 5-15 minutes on modern hardware
- Download and install Inno Setup
- Open
installer.issin Inno Setup - Click "Compile" (or run from CLI:
iscc installer.iss) - Output:
installer/KawkabAI-Setup-0.1.0.exe(single .exe installer)
Installer size: Same as bundle (~2 GB), compressed to ~800 MB
- Run
installer/KawkabAI-Setup-0.1.0.exe - Follow the installation wizard
- Launch Kawkab AI from Start Menu or Desktop
- Verify it opens, accepts video uploads, and analyzes matches
Upload the installer to GitHub Releases:
gh release create v0.1.0 installer/KawkabAI-Setup-0.1.0.exe `
--title "Kawkab AI v0.1.0" `
--notes "First public release! See README.md for features."To reduce bundle size:
# Use conda-installed PyTorch (smaller than pip)
conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia
# Exclude unnecessary packages in KawkabAI.spec:
excludes=[
'torchvision.datasets',
'torch.distributions',
'matplotlib.tests',
'PIL.ImageQt',
# ... etc
]To reduce startup time:
- Use a directory distribution instead of --onefile
- Bundle models separately (download on first run)
For a professional release, sign the .exe with a code certificate:
# Using signtool (Windows SDK)
signtool sign /f certificate.pfx /p password /t http://timestamp.digicert.com dist\KawkabAI\KawkabAI.exeThis prevents Windows SmartScreen warnings.
The project includes a GitHub Actions workflow (.github/workflows/build.yml)
that automatically builds the installer on every release tag.
"Failed to load Qt platform plugin": Ensure PySide6.QtWebEngineWidgets is in hiddenimports.
"Module not found": Add the missing module to hiddenimports in KawkabAI.spec.
Antivirus flags the .exe: Code-sign it or submit to Microsoft for analysis.
Build takes too long: Build only the directory distribution, not --onefile.