From f329f504040f3608478c687a99aa36a3cf5720b7 Mon Sep 17 00:00:00 2001 From: xyc <jc_xiong@hotmail.com> Date: 星期六, 03 十月 2026 23:45:04 +0800 Subject: [PATCH] feat(observation): 新增观测站分日调查数据导入与明细查看 --- deploy-templates/backend/install-service.cmd | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/deploy-templates/backend/install-service.cmd b/deploy-templates/backend/install-service.cmd new file mode 100644 index 0000000..6e4199f --- /dev/null +++ b/deploy-templates/backend/install-service.cmd @@ -0,0 +1,49 @@ +@echo off +rem ============================================================ +rem Double-click entry point for a fresh Windows server: +rem installs the TrafficAudit backend as a Windows service +rem (auto-start at boot) and then verifies it comes up. +rem +rem It asks for Administrator rights (UAC) and then runs +rem install-service.ps1 from this folder. +rem +rem If double-clicking does nothing, right-click this file and +rem choose "Run as administrator". +rem +rem ASCII-only on purpose: cmd.exe reads this file with the OEM +rem code page. +rem ============================================================ +setlocal +cd /d "%~dp0" + +if not exist "%~dp0trafficAudit.exe" ( + echo [ERROR] trafficAudit.exe was not found next to this script. + echo Copy the WHOLE backend folder to the server, do not + echo pick single files out of it. + echo. + pause + exit /b 1 +) + +rem S-1-16-12288 = High Mandatory Level, i.e. this window is already elevated. +whoami /groups | findstr /C:"S-1-16-12288" >nul 2>&1 +if errorlevel 1 ( + echo Administrator rights are required. A UAC prompt will appear now. + powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -Verb RunAs" + if errorlevel 1 ( + echo. + echo [ERROR] Automatic elevation failed. + echo Right-click install-service.cmd and choose + echo "Run as administrator" instead. + echo. + pause + ) + exit /b +) + +powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0install-service.ps1" %* + +echo. +echo ------------------------------------------------------------ +echo Finished. Press any key to close this window. +pause >nul -- Gitblit v1.9.1