mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 09:35:39 +00:00
29d03492fb
Harden native, agent and Docker lifecycle paths with tracked update verification, rollback and preflight checks, safe uninstall semantics, and health verification. Add shared protocol tests, installer CI gates, and lifecycle documentation. Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow)
1.9 KiB
1.9 KiB
Installer TUI Modernization (all 3 ALL-IN-ONE scripts)
Goal: arrow-key TUI look across betterdesk.sh, betterdesk-docker.sh, betterdesk.ps1.
Pattern
- bash:
tui_selectengine +menu_choose "Title" "Subtitle"sets$MENU_CHOICE. Caller builds_menu_items=( $'Label\tDesc' )+_menu_returns=( 1 2 0 ), then feeds$MENU_CHOICEinto UNCHANGEDcaseblock. Cancel returns LAST token. - PS1:
Invoke-TuiSelectengine (~L275) +Invoke-MenuChoose -Title -Subtitle -Items @("LabeltDesc") -Returns @("1","0")sets$script:MENU_CHOICE. Feeds into UNCHANGEDswitch. Cancel returns last entry.Test-TuiAvailable` honors BETTERDESK_CLASSIC_MENU=1, AUTO_MODE, IsInputRedirected.
Status: COMPLETE (all 3 scripts)
- betterdesk.sh: all menus + main.
bash -nOK. - betterdesk-docker.sh: TUI ported, main + 7 sub-menus.
bash -nOK. - betterdesk.ps1: 10 menus via Invoke-MenuChoose (DatabaseType, update-method, repair,
password-reset, diagnostics, paths, SSL, protocol-toggle, build, migration) +
main menu via Invoke-TuiSelect with menuLabels/menuActions. PowerShell AST
parsing is now enforced by
.github/workflows/installer-ci.yml; runtime install/update tests still require a Windows environment.
Rules learned
- Keep emoji OUT of printf/PadRight TUI labels (renderer counts 1 cell, term shows 2). Use ASCII
->,+--+. - Data-entry prompts (host/port/password/paths/domain) stay plain read/Read-Host. Only MENUS convert.
- menu_choose/Invoke-MenuChoose keep SAME return tokens the existing case/switch expects.
- Docker SSL menu originally had no back option -> added
0+0) return ;;. - Run
bash -nafter each bash script. CI parses every official Bash and PowerShell installer; runtime install/update tests remain an environment validation step. - Classic fallback: BETTERDESK_CLASSIC_MENU=1 (bash) / $env:BETTERDESK_CLASSIC_MENU=1 (ps1).