fix(service): stop waiting on a service that no longer starts with Windows

When the service's start type was changed from automatic, startup waited
about two minutes for it before falling back to Sidecar. Detect this
immediately, skip the TUN readiness wait, and offer a reinstall that
restores automatic start.

Refs #8129
This commit is contained in:
wonfen
2026-10-03 20:40:51 +08:00
parent 4a0882fc18
commit 57c5484080
23 changed files with 64 additions and 12 deletions
@@ -27,7 +27,7 @@ import getSystem from '@/utils/get-system'
type Remedy = 'installAndRestart' | 'reinstallAndRestart' | 'restartOnly'
const remedyFor = (reason: ServiceRequestReason): Remedy =>
reason === 'serviceLocationRefused'
reason === 'serviceLocationRefused' || reason === 'serviceNotAutoStarted'
? 'reinstallAndRestart'
: reason === 'sysproxySidecarReady'
? 'restartOnly'
@@ -40,6 +40,8 @@ const EXPLANATION = {
tunNeedsService: 'layout.components.sysproxyPrivilege.tunMessage',
serviceLocationRefused:
'layout.components.serviceMigration.locationRefusedMessage',
serviceNotAutoStarted:
'layout.components.serviceMigration.notAutoStartedMessage',
} as const
const TITLE = {
@@ -47,6 +49,7 @@ const TITLE = {
sysproxySidecarReady: 'layout.components.sysproxyPrivilege.title',
tunNeedsService: 'layout.components.sysproxyPrivilege.tunTitle',
serviceLocationRefused: 'layout.components.serviceMigration.repair',
serviceNotAutoStarted: 'layout.components.serviceMigration.repair',
} as const
const stateToRestore = (