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
$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)"
$options += "setup_autostart"
$i++
}
Write-Host " $i) 安装计划任务 (hub + runner)"
$options += "setup_autostart"
$i++
if ($autostartEnabled) {
Write-Host " $i) 禁用开机自启"
+3 -5
View File
@@ -1168,11 +1168,9 @@ main_menu() {
local autostart_enabled=false
[[ "$STATUS_AUTOSTART_HUB_ENABLED" == "enabled" || "$STATUS_AUTOSTART_RUNNER_ENABLED" == "enabled" ]] && autostart_enabled=true
if [[ "$has_service" == false ]]; then
echo " $i) 安装系统服务 (hub + runner)"
options+=("setup_autostart")
((i++))
fi
echo " $i) 安装系统服务 (hub + runner)"
options+=("setup_autostart")
((i++))
if [[ "$autostart_enabled" == true ]]; then
echo " $i) 禁用开机自启"