17 lines
1.0 KiB
PowerShell
17 lines
1.0 KiB
PowerShell
|
|
$ErrorActionPreference = 'Stop'
|
|||
|
|
Write-Host '[AZA] Build Windows EXE (basis14.py) via PyInstaller'
|
|||
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|||
|
|
$entry = Join-Path $root 'basis14.py'
|
|||
|
|
if (-not (Test-Path $entry)) { throw ('[AZA] FAIL: EntryPoint not found: ' + $entry) }
|
|||
|
|
$venv = Join-Path $PSScriptRoot '.venv_build'
|
|||
|
|
if (-not (Test-Path $venv)) { Write-Host '[AZA] Creating build venv...'; & python -m venv $venv }
|
|||
|
|
$py = Join-Path $venv 'Scripts\python.exe'
|
|||
|
|
if (-not (Test-Path $py)) { throw ('[AZA] FAIL: venv python missing: ' + $py) }
|
|||
|
|
Write-Host '[AZA] Installing PyInstaller...'
|
|||
|
|
& $py -m pip install --upgrade pip | Out-Host
|
|||
|
|
& $py -m pip install pyinstaller==6.13.0 | Out-Host
|
|||
|
|
Push-Location $root; try { Write-Host '[AZA] Building EXE...'; & $py -m PyInstaller --onefile --clean --name AZA-basis14 $entry | Out-Host } finally { Pop-Location }
|
|||
|
|
$exe = Join-Path $root 'dist\AZA-basis14.exe'
|
|||
|
|
if (-not (Test-Path $exe)) { throw ('[AZA] FAIL: EXE not found: ' + $exe) }
|
|||
|
|
Write-Host ('[AZA] OK: Built ' + $exe)
|