diff --git a/cmd/arcrun-app/build-mac.sh b/cmd/arcrun-app/build-mac.sh index 0ae242e..5e3bfc6 100755 --- a/cmd/arcrun-app/build-mac.sh +++ b/cmd/arcrun-app/build-mac.sh @@ -13,6 +13,24 @@ echo "🏷 版本:${VERSION}" echo "① 編 collector(同綑執行檔,純 stdlib、CGO_ENABLED=0)" ( cd ../.. && CGO_ENABLED=0 go build -ldflags "-s -w" -o "cmd/arcrun-app/arcrun-collector" . ) +# 🔴 2026-08-05(leo 開 DMG 檢查時抓到):Info.plist 的 CFBundleShortVersionString +# 是 **1.0.0**(Wails 預設),不是我們的版本號——因為 wails.json 沒有 info.productVersion, +# 而 `wails build` **沒有** CLI 旗標可指定。 +# ⇒ 建置前把版本寫進 wails.json 的 info,建完還原(不污染版控)。 +# 為什麼要修:使用者「關於」看到的、以及 Finder 顯示的版本都讀這個欄位; +# 永遠顯示 1.0.0 ⇒ 用戶無從判斷自己是不是新版(同 leo「版本號是唯一驗收介面」的病)。 +PLIST_VER="${VERSION#v}" +cp wails.json wails.json.bak +python3 - "$PLIST_VER" <<'PY' +import json, sys +c = json.load(open('wails.json')) +c.setdefault('info', {}) +c['info']['productVersion'] = sys.argv[1] +c['info']['productName'] = 'Arcrun' +json.dump(c, open('wails.json', 'w'), indent=2, ensure_ascii=False) +PY +trap 'mv -f wails.json.bak wails.json 2>/dev/null || true' EXIT + echo "② wails build" wails build -clean -ldflags "-X main.version=${VERSION}" diff --git a/cmd/arcrun-app/build-win.sh b/cmd/arcrun-app/build-win.sh index c9306b2..68c2c89 100755 --- a/cmd/arcrun-app/build-win.sh +++ b/cmd/arcrun-app/build-win.sh @@ -34,6 +34,20 @@ echo "① 編 collector.exe(同綑執行檔,純 stdlib、CGO_ENABLED=0)" ( cd ../.. && GOOS=windows GOARCH=amd64 CGO_ENABLED=0 \ go build -ldflags "-s -w" -o "cmd/arcrun-app/arcrun-collector.exe" . ) +# 🔴 同 build-mac.sh:wails.json 沒 info.productVersion ⇒ exe 內容資訊永遠是 1.0.0。 +# Windows 使用者在「內容→詳細資料」看到的版本讀這個欄位;MSIX 送審也會對照。 +PLIST_VER="${VERSION#v}" +cp wails.json wails.json.bak +python3 - "$PLIST_VER" <<'PY' +import json, sys +c = json.load(open('wails.json')) +c.setdefault('info', {}) +c['info']['productVersion'] = sys.argv[1] +c['info']['productName'] = 'Arcrun' +json.dump(c, open('wails.json', 'w'), indent=2, ensure_ascii=False) +PY +trap 'mv -f wails.json.bak wails.json 2>/dev/null || true' EXIT + echo "② wails build(windows/amd64,CGo 走 mingw)" CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc \ wails build -platform windows/amd64 -clean \