-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_installer.ps1
More file actions
29 lines (24 loc) · 1016 Bytes
/
build_installer.ps1
File metadata and controls
29 lines (24 loc) · 1016 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
$ErrorActionPreference = "Stop"
$version = "0.75.1"
$forge = "D:\Workhammer\Forge\build\forge.exe"
$project = $PSScriptRoot
$outDir = Join-Path $PSScriptRoot "dist"
$output = Join-Path $outDir "Descry-Setup-$version.exe"
Write-Host "Building forge.exe (windowsgui) from D:\Workhammer\Forge..."
Push-Location "D:\Workhammer\Forge"
try {
& go build -tags "desktop,production" -ldflags "-H windowsgui -s -w" -o build\forge.exe ./cmd/forge
if ($LASTEXITCODE -ne 0) { throw "go build forge.exe failed ($LASTEXITCODE)" }
} finally {
Pop-Location
}
Push-Location $project
try {
# forge.exe is a GUI-subsystem binary, so PowerShell's call operator (&) does
# not wait for it and $LASTEXITCODE is unreliable. Use Start-Process -Wait.
$p = Start-Process -FilePath $forge -ArgumentList @("build", "--out", $outDir) -Wait -PassThru -NoNewWindow
if ($p.ExitCode -ne 0) { throw "forge build failed with exit code $($p.ExitCode)" }
} finally {
Pop-Location
}
Write-Host "Built: $output"