Package standalone app and automate MySQL setup

This commit is contained in:
王鹏
2026-10-09 08:22:29 +08:00
parent d1695eba74
commit 0e7f52e26a
8 changed files with 67 additions and 9 deletions

View File

@@ -437,11 +437,9 @@ def _restart_backend(
log_file.write(f"\n\n===== 后端部署 {started_at},端口 {port} =====\n")
log_file.flush()
if os.name == "nt":
console_runner = Path(__file__).with_name("service_console.py")
process = popen(
[
sys.executable,
str(console_runner),
*_service_console_launcher(),
"--title",
f"后端服务 - 端口 {port}",
"--log",
@@ -488,6 +486,13 @@ def _restart_backend(
return 1
def _service_console_launcher() -> list[str]:
if getattr(sys, "frozen", False):
return [sys.executable, "--service-console"]
console_runner = Path(__file__).with_name("service_console.py")
return [sys.executable, str(console_runner)]
def _restart_ssm_backend(
command: list[str],
cwd: Path,