Fix bundled install auto-config: always run wizard DB setup, block tray until .env exists.

Selecting built-in PostgreSQL now always applies setup_first_run after files copy;
failed config shows a clear error instead of a misleading first-time tip.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-10-07 15:06:17 +08:00
parent 97393cd407
commit 3a89438e5b
3 changed files with 109 additions and 23 deletions

View file

@ -1,4 +1,4 @@
param(
param(
[string]$ProgramRoot = "",
[string]$DataRoot = "",
[switch]$StartOnLaunch = $true,
@ -43,8 +43,8 @@ function T([string]$En, [string]$Zh) {
if (-not (Test-Path $envPath)) {
[void][System.Windows.Forms.MessageBox]::Show(
(T `
"First-time setup incomplete (missing $envPath).`nRun Start Menu → NetX → First-time setup." `
"尚未完成首次配置(缺少 $envPath)。`n请运行「开始菜单 → NetX → First-time setup」。"),
"NetX is not configured yet (missing $envPath).`nRe-run the installer and choose built-in or external DB,`nor use Start Menu → NetX → Reconfigure database." `
"尚未完成数据库配置(缺少 $envPath)。`n请重新运行安装向导并选择内置或外置数据库,`n或使用「开始菜单 → NetX → 重新配置数据库」。"),
"NetX",
[System.Windows.Forms.MessageBoxButtons]::OK,
[System.Windows.Forms.MessageBoxIcon]::Warning