fix: always show install-service option regardless of current state

This commit is contained in:
i
2026-06-02 22:50:25 +08:00
parent f02838a95d
commit 0dd33ea3c2
2 changed files with 6 additions and 10 deletions
+3 -5
View File
@@ -801,11 +801,9 @@ function Main-Menu {
$hasService = $hubExists -or $runnerExists $hasService = $hubExists -or $runnerExists
$autostartEnabled = ($hubExists -and "$($script:STATUS_AUTOSTART_HUB)" -ne "Disabled") -or ($runnerExists -and "$($script:STATUS_AUTOSTART_RUNNER)" -ne "Disabled") $autostartEnabled = ($hubExists -and "$($script:STATUS_AUTOSTART_HUB)" -ne "Disabled") -or ($runnerExists -and "$($script:STATUS_AUTOSTART_RUNNER)" -ne "Disabled")
if (-not $hasService) { Write-Host " $i) 安装计划任务 (hub + runner)"
Write-Host " $i) 安装计划任务 (hub + runner)" $options += "setup_autostart"
$options += "setup_autostart" $i++
$i++
}
if ($autostartEnabled) { if ($autostartEnabled) {
Write-Host " $i) 禁用开机自启" Write-Host " $i) 禁用开机自启"
+3 -5
View File
@@ -1168,11 +1168,9 @@ main_menu() {
local autostart_enabled=false local autostart_enabled=false
[[ "$STATUS_AUTOSTART_HUB_ENABLED" == "enabled" || "$STATUS_AUTOSTART_RUNNER_ENABLED" == "enabled" ]] && autostart_enabled=true [[ "$STATUS_AUTOSTART_HUB_ENABLED" == "enabled" || "$STATUS_AUTOSTART_RUNNER_ENABLED" == "enabled" ]] && autostart_enabled=true
if [[ "$has_service" == false ]]; then echo " $i) 安装系统服务 (hub + runner)"
echo " $i) 安装系统服务 (hub + runner)" options+=("setup_autostart")
options+=("setup_autostart") ((i++))
((i++))
fi
if [[ "$autostart_enabled" == true ]]; then if [[ "$autostart_enabled" == true ]]; then
echo " $i) 禁用开机自启" echo " $i) 禁用开机自启"