22 lines
804 B
PowerShell
22 lines
804 B
PowerShell
# Build the exe. Run from the project root with the venv activated:
|
|
# .\build.ps1 windowed build (no console), for release
|
|
# .\build.ps1 -Console keeps a console window so startup errors are visible
|
|
param([switch]$Console)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$windowMode = if ($Console) { "--console" } else { "--windowed" }
|
|
|
|
$appName = python -c "import sys; sys.path.insert(0, 'src'); from config import APP_NAME; print(APP_NAME)"
|
|
if (-not $appName) { throw "Could not read APP_NAME from src\config.py" }
|
|
|
|
pyinstaller --noconfirm --clean --onedir $windowMode `
|
|
--name $appName `
|
|
--icon assets\images\icon.png `
|
|
--add-data "assets;assets" `
|
|
--hidden-import keyring.backends.Windows `
|
|
--hidden-import pystray._win32 `
|
|
src\main.py
|
|
|
|
Write-Host "Built: dist\$appName\$appName.exe"
|