From a83d7bfd95e8394e52a16da5c7cd3cf6b0a1e47e Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期六, 03 十月 2026 12:37:19 +0800
Subject: [PATCH] feat(部署): 增加双击安装服务入口(install-service.cmd)并自动验证启动结果
---
HANDOFF.md | 7 ++
deploy-templates/README-部署说明.txt | 33 ++++++++--
deploy-templates/backend/install-service.ps1 | 77 +++++++++++++++++++++++--
docs/打包部署说明.md | 7 +
deploy-templates/backend/install-service.cmd | 49 ++++++++++++++++
pack-deploy.ps1 | 1
6 files changed, 157 insertions(+), 17 deletions(-)
diff --git a/HANDOFF.md b/HANDOFF.md
index ba45b9b..27a7ef7 100644
--- a/HANDOFF.md
+++ b/HANDOFF.md
@@ -43,6 +43,13 @@
- **鏈獙璇侀」锛堥渶鍦ㄧ洰鏍囨満鍋氫竴娆★級**锛氭湰鏈哄綋鍓嶄笉鏄鐞嗗憳锛�**娌$湡姝� install 杩囨湇鍔�**锛涘紑鏈鸿嚜鍚�佸け璐ラ噸鍚�佹棩蹇楁粴鍔ㄨ鍦ㄦ湇鍔″櫒涓婃寜 README 3.1 鎵ц涓�娆$‘璁ゃ��
- **鏂板寘锛堟湰鍦帮紝涓嶅叆搴擄級**锛歚deploy/traffic-audit-deploy-20261003-3/`锛�393 鏂囦欢 / 110.49 MB锛寊ip 83.77 MB锛夈�傚凡楠岃瘉锛氭湇鍔′笁浠跺鍦� `backend\`銆佸寘鍐� `trafficAudit.exe` SHA-256 涓庡浐瀹氬�间竴鑷淬�乣backend\web` 涓� `frontend/dist` 鍚� 44 鏂囦欢銆乯ar 鍘诲瘑鑷閫氳繃銆佹棤鏄庢枃 key銆�**鏃х殑 `traffic-audit-deploy-20261003/` 涓� `-2/` 宸茶鍙栦唬**锛岄儴缃茶鐢� `-3`锛堟棫鍖呭緟鐢ㄦ埛纭鍚庡啀鍒狅級銆�
- **杩愯鐘舵�侊紙鍐欐湰鏉℃椂锛�**锛氬紑鍙戠敤鍚庣 8090锛圥ID 43040锛夈�佸墠绔� 8080锛圥ID 43152锛夊潎鍦ㄨ窇锛涙暟鎹簱 `127.0.0.1:3305/traffic_audit`銆�
+- **琛ュ厖鍙搷浣滄�э紙鐢ㄦ埛鍙嶉鈥渂ackend 涓嬫枃浠跺お澶氾紝涓嶇煡閬撴�庝箞鎿嶄綔鈥濓級**锛�
+ - 鏂板鍙屽嚮鍏ュ彛 `deploy-templates/backend/install-service.cmd`锛氳嚜鍔� UAC 鎻愭潈 鈫� 璋� `install-service.ps1`锛涜嫢鎵句笉鍒� `trafficAudit.exe` 鍒欐彁绀衡�滃繀椤绘暣涓� backend 涓�璧锋嫹鈥濄��
+ - `install-service.ps1` 瑁呭畬浼氳嚜宸辨帰娴嬬鍙o紙TCP 鎺㈡祴锛屽吋瀹� PowerShell 2.0锛夛紝鎵撳嵃 OK + 鏈満/瀵瑰缃戝潃锛涜捣涓嶆潵鏃剁洿鎺ユ墦鍗� `logs\*.log` 鏈�鍚� 15 琛岋紱鑻� `application.yml` 鍙d护浠嶅儚鍗犱綅绗︼紝鏈�鍚庡啀鎵撲竴娆¢啋鐩彁绀恒��
+ - `README-閮ㄧ讲璇存槑.txt` 椤堕儴鏂板銆愭湇鍔″櫒涓婂彧瑕佸仛杩� 3 姝ャ��+鈥滃摢浜涜鎷�/鍝簺涓嶇敤鎷封�濓紱`docs/鎵撳寘閮ㄧ讲璇存槑.md` 鐨� 5.4 鏀逛负鈥滃彸閿� `install-service.cmd` 鈫掍互绠$悊鍛樿繍琛屸�濄��
+ - 涓変釜 `.cmd` 妯℃澘缁熶竴涓� CRLF锛堟柊澧炵殑涓や釜鍘熸潵鏄� LF锛屾壒澶勭悊鍦� Windows 涓婂簲鐢� CRLF锛夈��
+ - 瀹炴祴锛氬己鍒惰蛋鈥滃凡鎻愭潈鈥濆垎鏀椂 `cmd 鈫� install-service.ps1 -Status` 閾捐矾璺戦�氥�乣%*` 浼犲弬姝e父锛沗Test-LocalPort` 瀵� 8090 杩斿洖 True銆佸 8099 杩斿洖 False銆�
+ - 鏂板寘锛歚deploy/traffic-audit-deploy-20261003-4/`锛�394 鏂囦欢 / 110.50 MB锛寊ip 83.78 MB锛夆�斺��**褰撳墠鏈�鏂板彲鐢ㄥ寘**锛沗20261003` / `-2` / `-3` 鍧囧凡琚彇浠o紝寰呯敤鎴风‘璁ゅ悗娓呯悊銆�
## 鏈�鏂帮紙2026-10-02锛�
diff --git "a/deploy-templates/README-\351\203\250\347\275\262\350\257\264\346\230\216.txt" "b/deploy-templates/README-\351\203\250\347\275\262\350\257\264\346\230\216.txt"
index da56932..9c4b6a7 100644
--- "a/deploy-templates/README-\351\203\250\347\275\262\350\257\264\346\230\216.txt"
+++ "b/deploy-templates/README-\351\203\250\347\275\262\350\257\264\346\230\216.txt"
@@ -1,6 +1,21 @@
TrafficAudit 浜ら�氳揣杩愮粺璁″鏍哥郴缁� 鈥斺�� 閮ㄧ讲鍖咃紙{stamp}锛�
========================================================
+銆愭湇鍔″櫒涓婂彧瑕佸仛杩� 3 姝ャ�戯紙鍏跺畠鏂囦欢閮戒笉鐢ㄥ姩锛�
+ 绗� 1 姝� 鏀归厤缃細鐢ㄨ浜嬫湰鎵撳紑 backend\application.yml锛屾妸鏁版嵁搴撳湴鍧�/璐﹀彿/瀵嗙爜
+ 锛坰pring.datasource 涓嬮潰涓夐」锛夊拰 jwt.secret 鏀规垚杩欏彴鏈嶅姟鍣ㄧ殑鐪熷疄鍊笺��
+ 绗� 2 姝� 瑁呮湇鍔★細杩涘叆 backend 鏂囦欢澶癸紝鍙抽敭 install-service.cmd 鈫掋�屼互绠$悊鍛樿韩浠借繍琛屻��
+ 锛堢洿鎺ュ弻鍑讳篃琛岋紝瀹冧細鑷繁寮圭鐞嗗憳纭锛夈�傝剼鏈細娉ㄥ唽寮�鏈鸿嚜鍚湇鍔″苟鍚姩瀹冦��
+ 绗� 3 姝� 鐪嬬粨鏋滐細鑴氭湰鏈�鍚庝細鎵撳嵃 OK 鍜岀綉鍧�锛涙祻瑙堝櫒鎵撳紑 http://<鏈嶅姟鍣↖P>:8090
+ 锛堣处鍙� admin / admin123锛夛紝鑳界湅鍒扮櫥褰曢〉灏辩畻鎴愬姛銆�
+
+ 鍝簺瑕佹嫹銆佸摢浜涗笉鐢ㄦ嫹锛�
+ backend\ 蹇呴』鏁翠釜鐩綍涓�璧锋嫹锛坖ar銆乤pplication.yml銆乨ocs銆亀eb銆佹湇鍔℃枃浠堕兘鍦ㄩ噷闈級锛�
+ 涓嶈鍙寫鍑犱釜鏂囦欢鎷枫��
+ db\ 鍙湁闇�瑕佸垵濮嬪寲/杩樺師鏁版嵁搴撴椂鎵嶇敤锛屽钩鏃跺彲涓嶆嫹銆�
+ frontend\ 涓嶇敤鎷凤紙鍓嶇宸插唴宓屽湪 jar 閲岋紝8090 绔彛鐩存帴璁块棶锛夈��
+ 鏈枃浠� 鍙嫹鍙笉鎷凤紝灏辨槸杩欎唤璇存槑涔︺��
+
銆愮洰褰曠粨鏋勩��
backend/
traffic-audit-server-1.0.0-SNAPSHOT.jar 鍚庣绋嬪簭锛堝惈鍏ㄩ儴渚濊禆锛�**宸插唴宓屽墠绔�**锛�
@@ -9,7 +24,8 @@
start-backend.cmd / start-backend.sh 鍓嶅彴鍚姩鑴氭湰锛堜汉宸ヨ皟璇曠敤锛屽叧浜嗙獥鍙e氨鍋滐級
trafficAudit.exe WinSW 鏈嶅姟鍖呰鍣紙鎶� java 鍙樻垚 Windows 鏈嶅姟锛屽嬁鍒犲嬁鏀瑰悕锛�
trafficAudit.xml WinSW 鏈嶅姟閰嶇疆锛堟湇鍔″悕/鍚姩鏂瑰紡/鏃ュ織/澶辫触閲嶅惎绛栫暐锛�
- install-service.ps1 娉ㄥ唽/鏌ョ湅/閲嶅惎/鍒犻櫎 Windows 鏈嶅姟锛堝紑鏈鸿嚜鍚紝鎺ㄨ崘锛�
+ install-service.cmd 鍙屽嚮鍏ュ彛锛氭敞鍐屽紑鏈鸿嚜鍚湇鍔★紙浼氳嚜鍔ㄨ姹傜鐞嗗憳鏉冮檺锛�
+ install-service.ps1 涓婇潰閭d釜 cmd 瀹為檯璋冪敤鐨勮剼鏈紙娉ㄥ唽/鏌ョ湅/閲嶅惎/鍒犻櫎锛�
start-backend-service.cmd 闈炰氦浜掑惎鍔ㄥ櫒锛堟棤 pause銆佸啓 app.log锛岄厤鍚堣鍒掍换鍔$敤锛�
install-autostart.ps1 澶囬�夛細娉ㄥ唽鈥滆鍒掍换鍔♀�濇柟寮忕殑寮�鏈鸿嚜鍚�
frontend/
@@ -61,15 +77,17 @@
- deepseek.api-key 锛氶渶瑕� AI 鍒嗘瀽鏃跺~锛屼笉闇�瑕佸彲鐣欑┖
娉細application.yml 涓� jar 鍚岀骇鍗崇敓鏁堬紝涓嶇敤閲嶆柊鎵撳寘銆�
- 3. 鍚姩鍚庣锛堝湪 backend 鐩綍涓嬶級
+ 3. 鍚姩鍚庣锛堝湪 backend 鐩綍涓嬶紱杩欐鍙槸鎵嬪伐璇曡窇锛屽叧绐楀彛灏卞仠锛岃寮�鏈鸿嚜鍚鐪� 3.1锛�
Windows锛氬弻鍑� start-backend.cmd
Linux锛� sh start-backend.sh
鎴愬姛鏍囧織锛氬嚭鐜� "Started TrafficAuditApplication" 涓� "Tomcat started on port(s): 8090"
3.1 Windows 寮�鏈鸿嚜鍚紙鎺ㄨ崘锛氭敞鍐屾垚 Windows 鏈嶅姟锛屼竴娆¢厤缃暱鏈熺敓鏁堬級
- 鍓嶆彁锛歜ackend 鐩綍涓嬬殑 trafficAudit.exe / trafficAudit.xml / install-service.ps1 閮藉凡闅忔湰閮ㄧ讲鍖呮彁渚涳紝
- 涓嶉渶瑕佸彟澶栦笅杞� WinSW锛屼篃涓嶉渶瑕佺粰 java 瑁呭埆鐨勪笢瑗裤��
- 鍦� backend 鐩綍涓嬶紝鐢ㄣ�愮鐞嗗憳銆慞owerShell 鎵ц锛�
+ 鍓嶆彁锛歜ackend 鐩綍涓嬬殑 trafficAudit.exe / trafficAudit.xml / install-service.cmd / install-service.ps1
+ 閮藉凡闅忔湰閮ㄧ讲鍖呮彁渚涳紝涓嶉渶瑕佸彟澶栦笅杞� WinSW锛屼篃涓嶉渶瑕佺粰 java 瑁呭埆鐨勪笢瑗裤��
+ 鏈�鐪佷簨锛氬湪 backend 鐩綍鍙抽敭 install-service.cmd 鈫掋�屼互绠$悊鍛樿韩浠借繍琛屻��
+ 锛堢洿鎺ュ弻鍑讳篃琛岋紝瀹冧細鑷繁寮� UAC 绠$悊鍛樼‘璁わ級銆�
+ 绛変环鐨勬墜宸ユ柟寮忥紙鍦� backend 鐩綍涓嬶紝鐢ㄣ�愮鐞嗗憳銆慞owerShell锛夛細
powershell -NoProfile -ExecutionPolicy Bypass -File install-service.ps1
鏁堟灉锛氭敞鍐� Windows 鏈嶅姟 TrafficAuditBackend锛屽紑鏈鸿嚜鍔ㄥ惎鍔紙寤惰繜鍚姩锛屽厛绛� MySQL 灏辩华锛夛紝
涓嶉渶瑕佷换浣曠敤鎴风櫥褰曪紱java 杩涚▼寮傚父閫�鍑虹敱鏈嶅姟绠$悊鍣ㄨ嚜鍔ㄩ噸鍚紙10 绉� / 30 绉� / 60 绉掗�掑閲嶈瘯锛�
@@ -82,8 +100,9 @@
-NoStart 鍙敞鍐屼笉鍚姩 -JavaPath "D:\jdk8\bin\java.exe" 鎵嬪姩鎸囧畾 JDK
鏃ュ織锛歜ackend\logs\trafficAudit.out.log锛堣繍琛岃緭鍑猴級涓� trafficAudit.err.log锛堥敊璇緭鍑猴級锛�
鍗曚釜鏂囦欢 10MB锛屼繚鐣� 10 涓粴鍔ㄦ枃浠躲��
- 楠岃瘉锛氭祻瑙堝櫒鎵撳紑 http://<閮ㄧ讲鏈篒P>:8090 锛屾垨
- (Invoke-WebRequest http://127.0.0.1:8090 -UseBasicParsing).StatusCode
+ 楠岃瘉锛氳剼鏈瀹屼細鑷姩鎺㈡祴绔彛锛屾墦鍗� OK + 鏈満/瀵瑰缃戝潃锛涜捣涓嶆潵鏃剁洿鎺ユ墦鍗� logs\*.log 鏈�鍚� 15 琛岋紝
+ 鎸夋彁绀烘敼 application.yml 鍚庢墽琛� install-service.ps1 -Restart 鍗冲彲銆備篃鍙墜宸ョ敤娴忚鍣ㄦ墦寮�
+ http://<閮ㄧ讲鏈篒P>:8090 纭銆�
娉ㄦ剰锛�
- 寮�鏈鸿嚜鍚潬鏈嶅姟鐨勨�滆嚜鍔ㄢ�濆惎鍔ㄧ被鍨嬶紱濡傛灉鎶婂畠鏀规垚鈥滄墜鍔ㄢ�濓紝灏变笉浼氬啀闅忔満鍣ㄥ惎鍔ㄣ��
- 閲嶅鎵ц install-service.ps1 鏄畨鍏ㄧ殑锛氫細鍏堝仠鏈嶅姟鍐嶉噸鏂版敞鍐屽苟鍚姩銆�
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
diff --git a/deploy-templates/backend/install-service.ps1 b/deploy-templates/backend/install-service.ps1
index 16193e8..2b8f094 100644
--- a/deploy-templates/backend/install-service.ps1
+++ b/deploy-templates/backend/install-service.ps1
@@ -129,6 +129,23 @@
Get-Service -Name $serviceId -ErrorAction SilentlyContinue
}
+function Test-LocalPort {
+ param([int]$Port, [string]$TargetHost = '127.0.0.1')
+
+ # Probe TCP instead of HTTP: Invoke-WebRequest does not exist on Windows
+ # PowerShell 2 (Windows 7), and this works on every PowerShell version.
+ $client = New-Object System.Net.Sockets.TcpClient
+ try {
+ $async = $client.BeginConnect($TargetHost, $Port, $null, $null)
+ if ($async.AsyncWaitHandle.WaitOne(1000, $false) -and $client.Connected) { return $true }
+ return $false
+ } catch {
+ return $false
+ } finally {
+ $client.Close()
+ }
+}
+
# ---------- read-only status: no elevation needed ----------
if ($Status) {
$service = Get-ServiceState
@@ -180,6 +197,7 @@
if (-not (Test-Path $wrapper)) {
throw "Missing wrapper executable: $wrapper`nRebuild the deploy package with pack-deploy.ps1 (it provides WinSW), or copy WinSW-x64.exe here renamed to trafficAudit.exe."
}
+$passwordOk = $false
if (-not (Test-Path $appConfig)) {
Write-Host "WARN: application.yml is missing next to the jar."
Write-Host " The built-in password placeholder resolves to an empty string and startup will fail with"
@@ -195,6 +213,8 @@
} elseif ($value -match '[^\x00-\x7F]') {
Write-Host "WARN: the datasource password contains non-ASCII characters."
Write-Host " If it is still the Chinese placeholder text, replace it with the real MySQL password first."
+ } else {
+ $passwordOk = $true
}
}
}
@@ -218,18 +238,59 @@
if ($LASTEXITCODE -ne 0) { throw "WinSW install failed with exit code $LASTEXITCODE" }
if (-not $NoStart) {
- Write-Host "Starting service '$serviceId' (delayed auto-start is used at boot)..."
+ Write-Host "Starting service '$serviceId' (auto-start at boot is enabled)..."
& $wrapper start
- Start-Sleep -Seconds 8
+ Start-Sleep -Seconds 5
$service = Get-ServiceState
$service | Select-Object Name, DisplayName, Status, StartType | Format-List
- $serviceDir = Join-Path $root 'logs'
+
+ # Read the port from application.yml so the check matches the real config.
+ $port = 8090
+ if (Test-Path $appConfig) {
+ $portLine = Select-String -LiteralPath $appConfig -Pattern '^\s*port\s*:' | Select-Object -First 1
+ if ($portLine -and $portLine.Line -match '(\d{2,5})') { $port = [int]$matches[1] }
+ }
+
+ $ready = $false
+ for ($i = 1; $i -le 30; $i++) {
+ if (Test-LocalPort -Port $port) { $ready = $true; break }
+ Start-Sleep -Seconds 2
+ $state = Get-ServiceState
+ if ($state -and $state.Status -ne 'Running') { break }
+ }
+
+ $logDir = Join-Path $root 'logs'
Write-Host ''
- Write-Host "Logs : $serviceDir\trafficAudit.out.log / trafficAudit.err.log"
- Write-Host "Health check: (Invoke-WebRequest http://127.0.0.1:8090 -UseBasicParsing).StatusCode"
+ if ($ready) {
+ Write-Host "OK : the backend is listening on port $port."
+ Write-Host " On this server : http://127.0.0.1:$port"
+ Write-Host " For other people : http://<server-ip>:$port"
+ } else {
+ Write-Host "WARN: nothing is listening on port $port yet - startup is still running, or it failed."
+ Write-Host " Fix application.yml / MySQL, then run: .\install-service.ps1 -Restart"
+ foreach ($name in @('trafficAudit.err.log', 'trafficAudit.out.log')) {
+ $logFile = Join-Path $logDir $name
+ if (Test-Path -LiteralPath $logFile) {
+ Write-Host ''
+ Write-Host "---- last 15 lines of $name ----"
+ Get-Content -LiteralPath $logFile -Tail 15 -ErrorAction SilentlyContinue | ForEach-Object { Write-Host " $_" }
+ }
+ }
+ }
+
+ if (-not $passwordOk) {
+ Write-Host ''
+ Write-Host '=============================================================='
+ Write-Host ' IMPORTANT: backend\application.yml still looks unset.'
+ Write-Host ' Put the real MySQL url / username / password in it, then run'
+ Write-Host ' .\install-service.ps1 -Restart'
+ Write-Host '=============================================================='
+ }
+
Write-Host ''
- Write-Host "Manage it with: Stop-Service $serviceId | Start-Service $serviceId"
- Write-Host "Or: .\install-service.ps1 -Status | -Restart | -Remove"
+ Write-Host "Logs : $logDir\trafficAudit.out.log / trafficAudit.err.log"
+ Write-Host "Manage: .\install-service.ps1 -Status | -Restart | -Remove"
+ Write-Host " Stop-Service $serviceId | Start-Service $serviceId"
Write-Host ''
- Write-Host 'The service auto-starts on every boot (Automatic, delayed start).'
+ Write-Host 'This service starts automatically on every boot (Automatic + delayed start).'
}
diff --git "a/docs/\346\211\223\345\214\205\351\203\250\347\275\262\350\257\264\346\230\216.md" "b/docs/\346\211\223\345\214\205\351\203\250\347\275\262\350\257\264\346\230\216.md"
index b976c16..b095f22 100644
--- "a/docs/\346\211\223\345\214\205\351\203\250\347\275\262\350\257\264\346\230\216.md"
+++ "b/docs/\346\211\223\345\214\205\351\203\250\347\275\262\350\257\264\346\230\216.md"
@@ -58,7 +58,8 @@
鈹� 鈹溾攢 start-backend.cmd / start-backend.sh 鍚姩鑴氭湰锛堜汉宸ュ弻鍑�/鍛戒护琛岋級
鈹� 鈹溾攢 trafficAudit.exe WinSW 鏈嶅姟鍖呰鍣紙2.12.0 x64锛岃嚜鍖呭惈 .NET 6锛�
鈹� 鈹溾攢 trafficAudit.xml WinSW 鏈嶅姟閰嶇疆锛堣嚜鍔�/寤惰繜鍚姩銆佸け璐ラ噸鍚�佹棩蹇楁粴鍔級
-鈹� 鈹溾攢 install-service.ps1 娉ㄥ唽/鏌ョ湅/閲嶅惎/鍒犻櫎 Windows 鏈嶅姟锛堝紑鏈鸿嚜鍚紝鎺ㄨ崘锛�
+鈹� 鈹溾攢 install-service.cmd 鍙屽嚮鍏ュ彛锛氭敞鍐屽紑鏈鸿嚜鍚湇鍔★紙鑷姩璇锋眰绠$悊鍛樻潈闄愶級
+鈹� 鈹溾攢 install-service.ps1 涓婇潰閭d釜 cmd 瀹為檯璋冪敤鐨勮剼鏈紙娉ㄥ唽/鏌ョ湅/閲嶅惎/鍒犻櫎锛�
鈹� 鈹溾攢 start-backend-service.cmd 澶囬�夛細闈炰氦浜掑惎鍔ㄥ櫒锛堟棤 pause銆佸啓 app.log锛�
鈹� 鈹溾攢 install-autostart.ps1 澶囬�夛細娉ㄥ唽/鏌ョ湅/鍒犻櫎 Windows 寮�鏈鸿嚜鍚鍒掍换鍔�
鈹� 鈹斺攢 web/ 鍓嶇闈欐�佹枃浠讹紙鐢� dist 鑷姩鍚屾锛�8090 鍗曠鍙fā寮忓繀闇�锛�
@@ -171,12 +172,14 @@
### 5.4 Windows 寮�鏈鸿嚜鍚紙鎺ㄨ崘锛氭敞鍐屾垚 Windows 鏈嶅姟锛�
-鍦� `backend` 鐩綍涓嬬敤**绠$悊鍛�** PowerShell 鎵ц锛坄trafficAudit.exe` / `trafficAudit.xml` / `install-service.ps1` 宸查殢鍖呮彁渚涳級锛�
+鍦� `backend` 鐩綍閲�**鍙抽敭 `install-service.cmd` 鈫掋�屼互绠$悊鍛樿韩浠借繍琛屻��**鍗冲彲锛堢洿鎺ュ弻鍑讳篃琛岋紝瀹冧細鑷繁寮� UAC锛夈�傚畠瀹為檯璋冪敤鐨勫氨鏄悓鐩綍鐨� `install-service.ps1`锛岀瓑浠峰懡浠わ細
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File install-service.ps1
```
+鑴氭湰浼氳嚜鍔ㄥ畾浣� java銆佹敞鍐屾湇鍔°�佸惎鍔紝鐒跺悗鎺㈡祴绔彛鎵撳嵃缁撴灉锛涜捣涓嶆潵鏃剁洿鎺ユ墦鍗� `logs\*.log` 鐨勬渶鍚� 15 琛屻��
+
| 椤� | 鍊� |
|----|----|
| 鏈嶅姟鍚� | `TrafficAuditBackend`锛坰ervices.msc 閲屾樉绀轰负 TrafficAudit Backend锛� |
diff --git a/pack-deploy.ps1 b/pack-deploy.ps1
index 6a3dd55..0720fdc 100644
--- a/pack-deploy.ps1
+++ b/pack-deploy.ps1
@@ -173,6 +173,7 @@
Copy-Item -LiteralPath $winswSrc (Join-Path $dest 'backend\trafficAudit.exe') -Force
Copy-Item (Join-Path $tplDir 'backend\trafficAudit.xml') (Join-Path $dest 'backend') -Force
Copy-Item (Join-Path $tplDir 'backend\install-service.ps1') (Join-Path $dest 'backend') -Force
+ Copy-Item (Join-Path $tplDir 'backend\install-service.cmd') (Join-Path $dest 'backend') -Force
}
Copy-Item $webDist (Join-Path $dest 'frontend') -Recurse -Force
Copy-Item (Join-Path $tplDir 'frontend\nginx.conf.example') (Join-Path $dest 'frontend') -Force
--
Gitblit v1.9.1