visionA/local-agent/installer/windows/visiona-agent.iss
jim800121chen 3f0175f1a9 feat(local-agent): Phase 0.5 visionA Agent — Wails 桌面 + tunnel client + 配對 UI
從 local-tool 複製出獨立的「visionA Agent」桌面應用(A3 純橋樑:
tunnel client + 配對 UI + 設定,不開 HTTP port、不做本機裝置/推論 UI)。
Bundle ID 與 local-tool 不同(com.innovedus.visiona-agent vs visiona-local),
雙 app 可共存。fork 後不主動 sync,需要時手動 cherry-pick。

Backend / Wails Go(AB1-AB13):
- internal/tunnel:6 狀態機(Idle/Connecting/Connected/Reconnecting/Failed/Stopped)
  + Pair/Unpair/Reconnect/Disconnect binding + ClientHooks event
- internal/auth:encrypted file token store(AES-GCM + scrypt + machineID
  fallback salt + 13 tests)
- internal/config:YAML validation + atomic write + 11 tests
- internal/log:ring buffer + ExportLog 升級 zip
- visionA-backend /api/pairing/exchange:SessionTokenStore + 17 new tests
- 三平台 build 驗證(macOS DMG 160 MB / Windows EXE / Linux AppImage)
- end-to-end 5 milestone 全綠(pairing → tunnel → forward → reuse 防護
  → tunnel drop failover)

Frontend / Next.js(AF1-AF7,沿用 visionA-frontend 基礎):
- AppShell + Header + TabNav(StatusView / PairView / SettingsView 三 tab)
- ConnectionStatusBadge 5 種狀態
- TokenInput regex 驗證 + 7 種錯誤 + 0.5s auto-switch 到狀態頁
- 設定頁 4 區塊(含重新配對 AlertDialog)
- agent-api.ts 封裝 Wails bindings(mock/real 雙實作)+ 90 tests

Phase 0.7 review-driven fix(Round 2):
- A1 Session fixation 防護(RotateSessionID)
- A3 mock pairing 預設改 false(必須明確 opt-in)+ startup log
- A4 Pair 失敗後 state 清理矩陣(exchange/Save/Start fail 各自終態)
- A5 Pair/Unpair/Reconnect lifecycleMu + 50 goroutine race test
- F1 重新配對次按鈕 / F2 PairView Esc cancel / F3 Wails BrowserOpenURL
  / F4 Settings draft 持久 + 未儲存 badge

驗證:agent backend go test -race -count=3 ./... 4 packages 全綠 /
agent frontend pnpm test 119 tests 全綠

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 11:22:01 +08:00

122 lines
6.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

; visionA Agent Windows installer
; Inno Setup 6.x compatible
;
; 此檔案在 macOS 上只做語法檢視,實際編譯必須在 Windows runner 上跑:
; iscc installer\windows\visiona-agent.iss
;
; 前置作業(在 Windows runner 上):
; 1. make payload-windows — 準備 payload/windows/
; 2. make wails-windows — build visiona-agent/build/bin/visiona-agent.exe
; 3. go build server/ — build payload/windows/bin/visiona-agent-server.exe
; 4. make exe — 執行 iscc 編譯本檔
;
; 所有路徑相對於本 .iss 所在目錄 (installer/windows/)
; 因此 ..\.. 會指回專案根目錄 (local-agent/)
#define MyAppName "visionA Agent"
#define MyAppVersion "0.1.0"
#define MyAppPublisher "Innovedus"
#define MyAppURL "https://github.com/Innovedus/visiona-agent"
#define MyAppExeName "visiona-agent.exe"
#define MyAppIcon "..\..\branding\icon.ico"
[Setup]
; AppId 固定 GUID產品識別用未來升級時不可更動
AppId={{8671343F-815C-4AA5-891F-1C453CE14E82}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\visiona-agent
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
; 需要管理員權限安裝 WinUSB driver
PrivilegesRequired=admin
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=..\..\dist
OutputBaseFilename=visiona-agent-{#MyAppVersion}-windows-x64
Compression=lzma2/ultra
SolidCompression=yes
WizardStyle=modern
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
; Installer 自身 icon
SetupIconFile={#MyAppIcon}
; 解除安裝程式在「設定 > 應用程式」顯示的 icon
UninstallDisplayIcon={app}\{#MyAppExeName}
; Windows 10 1809 以上WinUSB / pnputil 需求)
MinVersion=10.0.17763
; 不需要 code signing使用者決策 Q2=C
; 解除安裝時不清使用者 %APPDATA% 資料
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
; 繁體中文語系Inno Setup 6.3+ 官方只內建簡體中文ChineseSimplified.isl
; 繁體中文需額外從 https://jrsoftware.org/files/istrans/ 下載放到 Languages/
; 若存在則載入,不存在就只用英文(透過 -d 或環境變數 override 也可)
; 使用 /DWITH_TRAD_CHINESE=1 並確認 Languages\ChineseTraditional.isl 存在才啟用
#ifdef WITH_TRAD_CHINESE
Name: "tradchinese"; MessagesFile: "compiler:Languages\ChineseTraditional.isl"
#endif
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
; ── Wails app binary ──────────────────────────────────────────────
Source: "..\..\visiona-agent\build\bin\visiona-agent.exe"; DestDir: "{app}"; Flags: ignoreversion
; ── Server binaryGo build必須在 Windows runner 上 GOOS=windows go build──
Source: "..\..\payload\windows\bin\visiona-agent-server.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
; ── ffmpeg + ffprobe ─────────────────────────────────────────────
; ffmpeg 為 LGPL v3 buildBtbN n7.1v2 TDD §3附上 LGPL 授權條款
Source: "..\..\payload\windows\bin\ffmpeg.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
Source: "..\..\payload\windows\bin\ffprobe.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
Source: "..\..\payload\windows\bin\ffmpeg-LICENSE.txt"; DestDir: "{app}\bin"; Flags: ignoreversion skipifsourcedoesntexist
Source: "..\..\payload\windows\bin\ffmpeg-COPYING.LGPLv3"; DestDir: "{app}\bin"; Flags: ignoreversion skipifsourcedoesntexist
; ── Python runtime tarball + wheels ───────────────────────────────
Source: "..\..\payload\windows\python\python.tar.gz"; DestDir: "{app}\python"; Flags: ignoreversion
Source: "..\..\payload\windows\wheels\*"; DestDir: "{app}\wheels"; Flags: ignoreversion recursesubdirs createallsubdirs
; ── 預置模型與 scripts ────────────────────────────────────────────
Source: "..\..\payload\windows\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\..\payload\windows\scripts\*"; DestDir: "{app}\scripts"; Flags: ignoreversion recursesubdirs createallsubdirs
; ── WinUSB driverKneron KL520/KL720────────────────────────────
Source: "..\..\payload\windows\scripts\drivers\kneron_winusb.inf"; DestDir: "{app}\drivers"; Flags: ignoreversion
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
; 注意WinUSB driver 安裝**不在 installer 階段做**。
; 原因inf-based 安裝需要 .cat + Microsoft attestation signing未簽章的 .inf 會被
; Windows 10/11 的 driver signing enforcement 擋掉。
; 改為Wails app 首次啟動時(或使用者手動點「安裝 driver」按鈕時透過
; KneronPLUS SDK 的 kp.core.install_driver_for_windows() 呼叫 libwdi 完成,
; libwdi 會自動處理臨時自簽憑證,不需要 .cat 檔。
; 需要 UAC elevationWails app 會彈提權對話框。
; 安裝完畢選擇性啟動 app
Filename: "{app}\{#MyAppExeName}"; \
Description: "{cm:LaunchProgram,{#MyAppName}}"; \
Flags: nowait postinstall skipifsilent
[UninstallDelete]
; 解除安裝時清掉 Python 解壓後的目錄(首次啟動會重建)
; 但不動 %APPDATA%\visiona-agent使用者資料
Type: filesandordirs; Name: "{app}\python\extracted"
[Code]
// 目前保留空殼,未來若要偵測舊版 edge-ai-platform 並建議移除可在此擴充
function InitializeSetup(): Boolean;
begin
Result := True;
end;