-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
34 lines (27 loc) · 771 Bytes
/
build.ps1
File metadata and controls
34 lines (27 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $projectRoot
$exeName = "QuickImage"
$distDir = Join-Path $projectRoot "dist"
$buildDir = Join-Path $projectRoot "build"
$specFile = Join-Path $projectRoot "$exeName.spec"
if (Test-Path $distDir) {
Remove-Item -LiteralPath $distDir -Recurse -Force
}
if (Test-Path $buildDir) {
Remove-Item -LiteralPath $buildDir -Recurse -Force
}
if (Test-Path $specFile) {
Remove-Item -LiteralPath $specFile -Force
}
python -m PyInstaller `
--noconfirm `
--clean `
--onefile `
--windowed `
--name $exeName `
--icon "icon.ico" `
--add-data "i.png;." `
"main.pyw"
Write-Host ""
Write-Host "Build completed: $distDir\$exeName.exe"