feat(t77-lite): Windows 合併成單一 exe——go:embed 把 collector 吃進 tray

leo 07-28:「Windows 解開有 2 個 exe,被瀏覽器擋住,如果只有 1 個,
我還可以把 exe 改成 e_e 讓朋友改回來,但現在這樣完全不行」。
做法:build-windows.sh 先編 collector.exe 到 tray 目錄供 //go:embed,
tray 啟動時 ensureEmbeddedCollector() sha256 比對後解壓到 ~/.arcrun-rag/bin/,
失敗 fallback 同層(舊版相容);Mac 走 build-tag no-op 完全不動。
驗收(總管親跑):PE32+ GUI exe/zip 僅 1 檔 16.9MB<20MB jsDelivr 上限/
collector 特徵字串在 exe 肚裡(grep=1)/Mac go build+test 全綠/tray 測試綠。
(實作=子 CC;build+驗收+commit=總管)
This commit is contained in:
2026-07-28 12:15:13 +08:00
parent 0deef3dbd9
commit 5e122b47ec
4 changed files with 63 additions and 12 deletions
+6 -1
View File
@@ -176,8 +176,13 @@ func saveConfig(c *directConfig) error {
return os.WriteFile(configPath(), data, 0o600)
}
// collectorBinPath 找同綑的 collector 執行檔app bundle 內與托盤同層)
// collectorBinPath 找可用的 collector 執行檔。
// Windows 上先嘗試從內嵌位元組解壓到 ~/.arcrun-rag/bin/embed_windows.got77-lite),
// 解壓失敗才 fallback 同層目錄;Mac 直接走同層路徑,完全不受影響。
func collectorBinPath() string {
if p, err := ensureEmbeddedCollector(); err == nil && p != "" {
return p
}
exe, err := os.Executable()
if err != nil {
return "arcrun-collector"