mirror of
https://github.com/hansjone/netx.git
synced 2026-10-14 18:30:47 +08:00
Modernize the Windows installer, tray and runtime control; fix lifecycle bugs.
Installer: dynamic light/dark Win11 style, new brand wizard images, auto language, exclusive run mode (tray / Windows service) plus autostart and auto-update on the Tasks page (pre-selected from what is installed on upgrades, untouched by silent updates), 5 localized Start Menu entries. Tray: theme-aware rounded menu with live status, icons and status-dot tray icon; health polled off the UI thread; Settings submenu toggles autostart and daily updates; browser opened de-elevated via explorer. Fixes: - tray Stop/Start was ignored in service mode (service_run restarted the children) - all start/stop now goes through runtime_ctl.ps1 - logon tray task and SYSTEM service task were killed after 72h (default ExecutionTimeLimit); autostart was registered for the elevating account and opened a browser on every logon - uninstall left the NetXTray/NetXUpdate tasks behind - silent auto-update killed the tray without restarting it - repair_venv.ps1 was never staged into the release - wildcard NETX_HOST (0.0.0.0) broke health checks - ICO frames were PNG, which System.Drawing decodes as noise; icons now use the current brand mark Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4c4c7d91d0
commit
e21719b66c
27 changed files with 1209 additions and 687 deletions
|
|
@ -43,15 +43,16 @@ if (Test-Path (Join-Path $dist "index.html")) {
|
|||
$mode = Get-DbMode -EnvMap $map
|
||||
$hostBind = if ($env:NETX_HOST) { $env:NETX_HOST } else { "127.0.0.1" }
|
||||
$port = if ($env:NETX_PORT) { [int]$env:NETX_PORT } else { 8890 }
|
||||
$clientHost = Get-NetxClientHost -BindHost $hostBind
|
||||
|
||||
Write-Host "==> Program: $prog"
|
||||
Write-Host "==> Data: $data"
|
||||
Write-Host "==> DB mode: $mode"
|
||||
|
||||
if (-not $Force -and (Test-NetxApiHealthy -HostName $hostBind -Port $port)) {
|
||||
Write-Host "==> NetX already healthy at http://${hostBind}:${port}/ — skip start (use -Force to restart)" -ForegroundColor Green
|
||||
if (-not $Force -and (Test-NetxApiHealthy -HostName $clientHost -Port $port)) {
|
||||
Write-Host "==> NetX already healthy at http://${clientHost}:${port}/ — skip start (use -Force to restart)" -ForegroundColor Green
|
||||
if (-not $SkipBrowser) {
|
||||
try { Start-Process "http://${hostBind}:${port}/" } catch {}
|
||||
Open-NetxUrl -Url "http://${clientHost}:${port}/"
|
||||
}
|
||||
exit 0
|
||||
}
|
||||
|
|
@ -106,8 +107,8 @@ try {
|
|||
exit 1
|
||||
}
|
||||
|
||||
if (-not (Test-NetxTcpPortFree -HostName $hostBind -Port $port)) {
|
||||
if (Test-NetxApiHealthy -HostName $hostBind -Port $port) {
|
||||
if (-not (Test-NetxTcpPortFree -HostName $clientHost -Port $port)) {
|
||||
if (Test-NetxApiHealthy -HostName $clientHost -Port $port) {
|
||||
Write-Host "==> Port $port already serves NetX — skip start" -ForegroundColor Green
|
||||
exit 0
|
||||
}
|
||||
|
|
@ -132,14 +133,14 @@ if ($InlineSchedulers) { $startArgs["InlineSchedulers"] = $true }
|
|||
& $startScript @startArgs
|
||||
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
|
||||
$url = "http://${hostBind}:${port}/"
|
||||
if (-not (Test-NetxApiHealthy -HostName $hostBind -Port $port -TimeoutSec 2)) {
|
||||
if (-not (Wait-NetxApiHealthy -HostName $hostBind -Port $port -TimeoutSec 30)) {
|
||||
$url = "http://${clientHost}:${port}/"
|
||||
if (-not (Test-NetxApiHealthy -HostName $clientHost -Port $port -TimeoutSec 2)) {
|
||||
if (-not (Wait-NetxApiHealthy -HostName $clientHost -Port $port -TimeoutSec 30)) {
|
||||
Write-Host "[ERR] NetX started but /health not ready: $url" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
Write-Host "==> Open: $url" -ForegroundColor Green
|
||||
if (-not $SkipBrowser) {
|
||||
try { Start-Process $url } catch {}
|
||||
Open-NetxUrl -Url $url
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue