37 lines
1.1 KiB
PowerShell
37 lines
1.1 KiB
PowerShell
# Build Anime Video Editor to exe (Windows)
|
|
# Run: .\build_exe.ps1
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
Set-Location $PSScriptRoot
|
|
|
|
$buildRoot = Join-Path $PSScriptRoot "BUILDS"
|
|
$distPath = Join-Path $buildRoot "dist"
|
|
$workPath = Join-Path $buildRoot "build"
|
|
$exePath = Join-Path $distPath "AnimeVideoEditor.exe"
|
|
|
|
if (-not (Test-Path $buildRoot)) {
|
|
New-Item -ItemType Directory -Path $buildRoot | Out-Null
|
|
}
|
|
|
|
Write-Host "Checking project dependencies..." -ForegroundColor Cyan
|
|
pip install -r requirements.txt -q
|
|
if (-not $?) { exit 1 }
|
|
Write-Host "Checking PyInstaller..." -ForegroundColor Cyan
|
|
pip show pyinstaller 2>$null | Out-Null
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Host "Installing PyInstaller..." -ForegroundColor Yellow
|
|
pip install pyinstaller
|
|
}
|
|
|
|
Write-Host "Building exe..." -ForegroundColor Cyan
|
|
pyinstaller --noconfirm AnimeVideoEditor.spec --distpath "$distPath" --workpath "$workPath"
|
|
|
|
if (Test-Path $exePath) {
|
|
Write-Host ""
|
|
Write-Host "Done: $exePath" -ForegroundColor Green
|
|
} else {
|
|
Write-Host ""
|
|
Write-Host "Build failed. Check output above." -ForegroundColor Red
|
|
exit 1
|
|
}
|