Ship a runtime-only PostgreSQL and the small WinSW build.

- PostgreSQL: keep postgres/pg_ctl/initdb/psql/pg_dump(all)/pg_restore/
  pg_isready; drop StackBuilder + wx DLLs, dev/test tools, static .lib,
  pgxs and non-Chinese message catalogs (123MB -> 62MB unpacked).
- WinSW: .NET Framework 4.6.1 build (0.6MB, in-box on Win10 1607+ /
  Server 2016+) instead of the self-contained x64 build (18MB).
  install_service.ps1 still accepts an older bundled WinSW-x64.exe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
oliver 2026-10-13 22:15:30 +08:00
parent 7a4e2b9477
commit e2e6c09825
2 changed files with 23 additions and 8 deletions

View file

@ -11,7 +11,7 @@ param(
# Install NetX as a Windows Service (WinSW) or as a SYSTEM startup Scheduled Task.
# Requires elevation for winsw / task modes that run as SYSTEM.
# WinSW binary is bundled at packaging\winsw\WinSW-x64.exe by build_release.ps1 — no network needed.
# WinSW binary is bundled at packaging\winsw\WinSW.exe by build_release.ps1 — no network needed.
$ErrorActionPreference = "Stop"
. "$PSScriptRoot\_common.ps1"
@ -40,8 +40,10 @@ function Ensure-WinSW {
if (-not (Test-Path $cacheDir)) {
New-Item -ItemType Directory -Path $cacheDir -Force | Out-Null
}
$bundled = Join-Path $PSScriptRoot "winsw\WinSW-x64.exe"
$dl = Join-Path $cacheDir "WinSW-x64.exe"
# WinSW.exe = .NET Framework build (current); WinSW-x64.exe = older self-contained bundles.
$bundled = Join-Path $PSScriptRoot "winsw\WinSW.exe"
if (-not (Test-Path $bundled)) { $bundled = Join-Path $PSScriptRoot "winsw\WinSW-x64.exe" }
$dl = Join-Path $cacheDir "WinSW.NET461.exe"
$src = $null
if (Test-Path $bundled) {
$src = $bundled
@ -50,7 +52,7 @@ function Ensure-WinSW {
$src = $dl
Write-Host "==> Using cached WinSW: $dl"
} elseif ($AllowDownload) {
$url = "https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW-x64.exe"
$url = "https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW.NET461.exe"
Write-Host "==> Downloading WinSW: $url"
Invoke-WebRequest -Uri $url -OutFile $dl -UseBasicParsing
$src = $dl