-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_windows.ps1
More file actions
33 lines (26 loc) · 937 Bytes
/
Copy pathbuild_windows.ps1
File metadata and controls
33 lines (26 loc) · 937 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
param(
[switch]$Clean
)
$ErrorActionPreference = "Stop"
$ProjectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $ProjectRoot
$Python = "python"
if (Test-Path ".venv\Scripts\python.exe") {
$Python = ".venv\Scripts\python.exe"
}
if ($Clean) {
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue build, dist
}
& $Python -m pip install -r requirements.txt
& $Python -m pip install pyinstaller
& $Python -m PyInstaller --clean --noconfirm UnityScraper.spec
$Executable = Join-Path $ProjectRoot "dist\UnityScraper.exe"
if (-not (Test-Path $Executable)) {
throw "PyInstaller completed without creating $Executable"
}
$Hash = (Get-FileHash $Executable -Algorithm SHA256).Hash.ToLower()
"$Hash *UnityScraper.exe" | Set-Content "$Executable.sha256"
Write-Host ""
Write-Host "Build complete: $Executable"
Write-Host "Checksum: $Executable.sha256"
Write-Host "User data: %LOCALAPPDATA%\UnityScraper"