From 5b5cba7030b7f4dd519868fe310bb4fce893bf91 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Tue, 30 Jun 2026 03:52:02 +0800
Subject: [PATCH] Add Windows QA command launcher

---
 privatevoice.src/scripts/RUN-WINDOWS-QA.cmd       |   18 ++++++++++++++++++
 privatevoice.src/scripts/build-windows-preview.sh |    5 +++--
 CHANGELOG.md                                      |    1 +
 CODEGRAPH.md                                      |    3 ++-
 4 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7b8f291..e4e5fda 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,7 @@
 
 - **新增 Windows 预览构建脚本**:`privatevoice.src/scripts/build-windows-preview.sh` 可生成 Windows x64 预览目录和 zip。
 - **内置 Windows 真机 QA 采集脚本**:预览包包含 `QA-WINDOWS-PREVIEW.ps1`,用于采集 WebView2 / 音频端点预检信息、启动 App、打开 Notepad 目标文件、提示完成一次听写,并收集日志和目标文本证据。
+- **新增双击 QA 启动器**:预览包包含 `RUN-WINDOWS-QA.cmd`,便于 Windows 测试者直接启动 QA 流程。
 - **新增 Windows QA 证据验证脚本**:`privatevoice.src/scripts/verify-windows-qa-evidence.sh` 可检查返回的 `qa-evidence-*.zip` 是否证明启动、引擎、录音、识别和上屏。
 - **预览版只开放 SenseVoice**:Windows build 中其他模型仍可见但置灰禁用,避免用户选择尚未验证的模型导致启动或识别失败。
 - **打包 sherpa/onnxruntime 运行时 DLL**:预览包包含 `onnxruntime.dll`、`sherpa-onnx-c-api.dll`、`sherpa-onnx-cxx-api.dll`。
diff --git a/CODEGRAPH.md b/CODEGRAPH.md
index 29cf5d2..ca9cb6d 100644
--- a/CODEGRAPH.md
+++ b/CODEGRAPH.md
@@ -42,6 +42,7 @@
   - `onnxruntime.dll`
   - `sherpa-onnx-c-api.dll`
   - `sherpa-onnx-cxx-api.dll`
+  - `RUN-WINDOWS-QA.cmd`
   - `QA-WINDOWS-PREVIEW.ps1`
   - `README-WINDOWS-PREVIEW.txt`
 
@@ -60,7 +61,7 @@
 ## Known Gaps
 
 - Windows runtime QA must still be performed on Windows 10/11 hardware.
-- Run `QA-WINDOWS-PREVIEW.ps1` from the extracted preview package to collect WebView2/audio preflight, startup, engine, recording, recognition, paste, and Notepad target text evidence.
+- Run `RUN-WINDOWS-QA.cmd` from the extracted preview package to collect WebView2/audio preflight, startup, engine, recording, recognition, paste, and Notepad target text evidence.
 - After evidence is returned, run `verify-windows-qa-evidence.sh` and require `WINDOWS_QA_EVIDENCE_PASS` before claiming the goal complete.
 - The Windows preview zip is unsigned and not an installer.
 - SmartScreen / Defender prompts are expected for local testing.
diff --git a/privatevoice.src/scripts/RUN-WINDOWS-QA.cmd b/privatevoice.src/scripts/RUN-WINDOWS-QA.cmd
new file mode 100644
index 0000000..ca6d5c8
--- /dev/null
+++ b/privatevoice.src/scripts/RUN-WINDOWS-QA.cmd
@@ -0,0 +1,18 @@
+@echo off
+setlocal
+cd /d "%~dp0"
+echo PrivateVoice Dictation Windows Preview QA
+echo.
+echo This will run QA-WINDOWS-PREVIEW.ps1 and collect evidence files.
+echo.
+powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0QA-WINDOWS-PREVIEW.ps1"
+set EXITCODE=%ERRORLEVEL%
+echo.
+if not "%EXITCODE%"=="0" (
+  echo QA script exited with code %EXITCODE%.
+) else (
+  echo QA script finished.
+)
+echo.
+pause
+exit /b %EXITCODE%
diff --git a/privatevoice.src/scripts/build-windows-preview.sh b/privatevoice.src/scripts/build-windows-preview.sh
index 2ed1fdf..680afe1 100755
--- a/privatevoice.src/scripts/build-windows-preview.sh
+++ b/privatevoice.src/scripts/build-windows-preview.sh
@@ -56,6 +56,7 @@
 cp "$SHERPA_DLL_DIR/sherpa-onnx-c-api.dll" "$OUT_DIR/"
 cp "$SHERPA_DLL_DIR/sherpa-onnx-cxx-api.dll" "$OUT_DIR/"
 cp "$ROOT_DIR/scripts/QA-WINDOWS-PREVIEW.ps1" "$OUT_DIR/"
+cp "$ROOT_DIR/scripts/RUN-WINDOWS-QA.cmd" "$OUT_DIR/"
 
 cat >"$OUT_DIR/README-WINDOWS-PREVIEW.txt" <<EOF
 PrivateVoice Dictation Windows Preview
@@ -71,8 +72,8 @@
 How to run:
 1. Extract the whole folder.
 2. Keep the EXE and DLL files in the same directory.
-3. Right-click "QA-WINDOWS-PREVIEW.ps1" and choose "Run with PowerShell".
-4. If PowerShell blocks scripts, run this command from the extracted folder:
+3. Double-click "RUN-WINDOWS-QA.cmd".
+4. If Windows blocks the command file, right-click "QA-WINDOWS-PREVIEW.ps1" and choose "Run with PowerShell", or run this command from the extracted folder:
    powershell -ExecutionPolicy Bypass -File .\\QA-WINDOWS-PREVIEW.ps1
 5. Follow the on-screen checklist. It will collect WebView2/audio preflight data, launch the app, open a Notepad target file, ask you to dictate once, and collect logs plus the saved target text.
 6. You can also run "PrivateVoice Dictation.exe" directly after QA.

--
Gitblit v1.9.3