fix: install service (#5479)

* fix: compatible older service version when install service

* docs: update Changelog.md

* chore: check service available

* chore: wait for service server is running

* fix: update changelog to reflect compatibility with legacy service mode upgrades

---------

Co-authored-by: Tunglies <tunglies.dev@outlook.com>
Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
This commit is contained in:
oomeow
2025-11-18 09:52:48 +08:00
committed by GitHub
parent a5de24a545
commit 16478d314b
2 changed files with 8 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
- macOS 非预期 Tproxy 端口设置
- 流量图缩放异常
- PAC 自动代理脚本内容无法动态调整
- 兼容从旧版服务模式升级
- Monaco 编辑器的行数上限
<details>

View File

@@ -555,6 +555,13 @@ impl ServiceManager {
ServiceStatus::InstallRequired => {
logging!(info, Type::Service, "需要安装服务,执行安装流程");
install_service().await?;
// compatible with older service version, force reinstall if service is unavailable
// wait for service server is running
tokio::time::sleep(Duration::from_millis(500)).await;
if is_service_available().await.is_err() {
logging!(info, Type::Service, "服务需要强制重装,执行强制重装流程");
force_reinstall_service().await?;
}
self.0 = ServiceStatus::Ready;
}
ServiceStatus::UninstallRequired => {