Fix Windows install start: writable runtime logs and robust Postgres bootstrap.
Some checks failed
Release Windows / build (push) Has been cancelled

API logs go under ProgramData; first-run verifies CREATE ROLE/DATABASE and login.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-10-07 11:22:01 +08:00
parent ca97a2a597
commit 86dfd41f44
7 changed files with 64 additions and 33 deletions

View file

@ -23,9 +23,16 @@ if ($Backgtound -and -not $Background) {
$projectRoot = Split-Path -Parent $PSScriptRoot
Set-Location $projectRoot
$runDir = Join-Path $PSScriptRoot ".run"
# Prefer writable data-root runtime dir (Program Files is not writable after Setup install).
if ($env:NETX_RUN_DIR) {
$runDir = $env:NETX_RUN_DIR
} elseif ($env:NETX_SCHEDULER_HEARTBEAT_PATH) {
$runDir = Split-Path -Parent ($env:NETX_SCHEDULER_HEARTBEAT_PATH -replace '/', '\')
} else {
$runDir = Join-Path $PSScriptRoot ".run"
}
if (-not (Test-Path $runDir)) {
New-Item -ItemType Directory -Path $runDir | Out-Null
New-Item -ItemType Directory -Path $runDir -Force | Out-Null
}
$pidFile = Join-Path $runDir "netx.pid"