Files
ThreadPilot/build/build-installer.ps1
Prime Build 03872a39b8 fix: recover saved-rule monitoring after sleep (v1.7.9) (#96)
Renew WMI subscriptions after resume, unlock, watcher failure or prolonged silence, then rescan processes and reapply saved rules. Retry unavailable executable paths, initialize diagnostics before monitoring, and use the shared startup path. Include regression tests and v1.7.9 release metadata. Related to #95; keep open pending reporter confirmation.
2026-11-11 15:11:56 +01:00

61 lines
2.0 KiB
PowerShell

param(
[string]$Version = "1.7.9",
[string]$Configuration = "Release",
[switch]$SkipPublish
)
$ErrorActionPreference = "Stop"
$scriptRoot = Split-Path -Parent $PSCommandPath
$projectRoot = Split-Path -Parent $scriptRoot
Set-Location -LiteralPath $projectRoot
$publishDir = Join-Path $projectRoot "artifacts\release\singlefile"
$installerOutputDir = Join-Path $projectRoot "artifacts\release\installer"
$installerExe = Join-Path $installerOutputDir ("ThreadPilot_v{0}_Setup.exe" -f $Version)
$publishedExe = Join-Path $publishDir "ThreadPilot.exe"
if (-not $SkipPublish)
{
Write-Host "Publishing ThreadPilot ($Configuration) to fresh single-file output..."
dotnet publish "ThreadPilot.csproj" --configuration $Configuration -p:PublishProfile=WinX64-SingleFile
}
if (-not (Test-Path -LiteralPath $publishedExe))
{
throw "Published executable not found: $publishedExe"
}
if (Test-Path -LiteralPath $installerExe)
{
Remove-Item -LiteralPath $installerExe -Force
}
$resolvedSourceDir = (Resolve-Path -LiteralPath $publishDir).Path
Write-Host "Building installer from source directory: $resolvedSourceDir"
& iscc.exe "/DMyAppVersion=$Version" "/DMyAppSourceDir=$resolvedSourceDir" "Installer/setup.iss"
if ($LASTEXITCODE -ne 0)
{
throw "Inno Setup compile failed with exit code $LASTEXITCODE"
}
if (-not (Test-Path -LiteralPath $installerExe))
{
throw "Installer not generated at expected path: $installerExe"
}
$publishedInfo = Get-Item -LiteralPath $publishedExe
$installerInfo = Get-Item -LiteralPath $installerExe
if ($installerInfo.LastWriteTimeUtc -lt $publishedInfo.LastWriteTimeUtc)
{
throw "Installer timestamp is older than the published executable. Build may be stale."
}
Write-Host "Installer build complete." -ForegroundColor Green
Write-Host "Published exe: $publishedExe"
Write-Host "Installer exe: $installerExe"
Write-Host "Published exe timestamp (UTC): $($publishedInfo.LastWriteTimeUtc.ToString('u'))"
Write-Host "Installer timestamp (UTC): $($installerInfo.LastWriteTimeUtc.ToString('u'))"