chore(collector): 下架死碼 arcrun-tray——但先把還活著的兩塊搬出來(D95 第一輪①)
`collector/cmd/arcrun-tray/`(fyne 版舊桌面殼)自 t193 換 Wails 後退役, t215 已明文記錄是死碼:三支打包腳本全部只裝 `arcrun-app`。 🔴 **但它不是「整個都死」——複驗發現兩塊還在被現役腳本用:** ① `assets/store/*.png`(12 顆 Store 圖示) ← `arcrun-app/build-msix.sh:75` 每次打 msix 都 `cp` 它們。 整個 `git rm` 掉 ⇒ 下一次打 msix 直接斷。 ② `build-msix.sh --setup`(在 Mac 上建 makemsix 的一次性流程) ← `arcrun-app/build-msix.sh:34` 的錯誤訊息就是叫人去跑它。 刪掉 ⇒ 新機器再也照不出 makemsix,而錯誤訊息會指向不存在的檔案。 ⇒ 先把這兩塊逐字搬進 `arcrun-app/`(不重寫),再刪整個目錄。 死碼下架最容易犯的錯就是「連還活著的那一塊一起丟掉」。 ⚠️ **`.git` 不會因此變小**:772 MB 裡的 524 MB 是那三顆二進位 (`ArcrunRAG-mac-unsigned.zip` 16 MB/`arcrun-collector` 15 MB/ `dist-mac/ArcrunRAG-v0.15.7.dmg`)**留在歷史裡**,`git rm` 只停止追蹤。 真正瘦身要重寫歷史(filter-repo)=第三輪,需 leo 親自拍板。 順手更新:`.gitignore` 的三條 tray 路徑(換成 arcrun-app 的 dist-msix)、 `landing/worker.js` 與 `docs/store-submission.md` 裡指向舊素材位置的路徑。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@@ -0,0 +1,38 @@
|
||||
# Microsoft Store 圖示素材(msix)
|
||||
|
||||
這裡的 PNG 是 **產物**,但**隨 repo 版控**——因為 `build-msix.sh` 打包時只做 `cp`,
|
||||
不在打包當下重算(打包機不一定拿得到 CIS 素材)。
|
||||
|
||||
## 真身在哪
|
||||
|
||||
品牌素材真身=`InkStoneCo/arcrun-cis/`(leo 的 CIS,2026-07-31)。
|
||||
**不要在這裡改圖**;要改品牌就改 CIS,然後重跑產生器。
|
||||
|
||||
## 重新產生
|
||||
|
||||
```bash
|
||||
python3 gen-store-assets.py # 需要 Pillow
|
||||
# CIS 不在預設位置時:
|
||||
ARCRUN_CIS=/path/to/arcrun-cis python3 gen-store-assets.py
|
||||
```
|
||||
|
||||
## 每個檔案是什麼
|
||||
|
||||
| 檔案 | 尺寸 | 用途 | 取材 |
|
||||
|---|---|---|---|
|
||||
| `Square44x44Logo.png` | 44×44 | 應用程式清單、工作列 | 方形 icon |
|
||||
| `StoreLogo.png` | 50×50 | Store 頁面小圖 | 方形 icon |
|
||||
| `Square71x71Logo.png` | 71×71 | 小磚 | 方形 icon |
|
||||
| `Square150x150Logo.png` | 150×150 | 中磚(預設磚) | 方形 icon |
|
||||
| `Square310x310Logo.png` | 310×310 | 大磚 | 方形 icon |
|
||||
| `Wide310x150Logo.png` | 310×150 | 寬磚 | **橫式 lockup** |
|
||||
| `Square44x44Logo.targetsize-{16,24}.png` | 16/24 | 工作列小圖 | **雙 chevron** |
|
||||
| `Square44x44Logo.targetsize-{32,48,256}.png` | 32/48/256 | 檔案總管各檢視 | 方形 icon |
|
||||
|
||||
## 兩條「為什麼不是直接縮」的理由(別再改回去)
|
||||
|
||||
1. **寬磚不能用方形 icon 硬拉**。舊版寫 `sips -z 150 310 icon.png`,
|
||||
`sips -z` 會**照給定的長寬直接拉扁**——實測產出的字符明顯變形,
|
||||
違反 CIS 的 Don't「never skew or stretch」。寬磚要用橫式 lockup。
|
||||
2. **16/24px 不能用完整方形 icon**。CIS 明寫「26px 以下降級成 chevron」:
|
||||
方形 icon 裡的字符只佔畫面高度約 28%,16px 下只剩約 4px 高,糊成一團。
|
||||
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 538 B |
|
After Width: | Height: | Size: 718 B |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 834 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
@@ -0,0 +1,108 @@
|
||||
#!/usr/bin/env python3
|
||||
"""重新產生 Microsoft Store(msix)的圖示素材。
|
||||
|
||||
素材真身=leo 的 CIS(`InkStoneCo/arcrun-cis/`),本腳本只做「等比縮 + 置中合成」。
|
||||
|
||||
守 CIS 的 Don't:**不拉扁、不歪斜、不加第二個顏色**。
|
||||
- 方形磚 → 用方形 icon(`arcrun-icon-ink-1024.png`)等比縮。
|
||||
- 寬磚 310×150 → 用**橫式 lockup**(`arcrun-lockup-h-paper-on-ink.png`)置中於墨底。
|
||||
不能拿方形 icon 硬拉成 310×150——舊版 `sips -z 150 310` 就是這樣把方形字符拉扁的。
|
||||
- targetsize-16/24(工作列小圖)→ CIS 規定 26px 以下降級成 chevron,
|
||||
完整字符在這尺寸只剩約 4px 高,會糊掉。
|
||||
|
||||
用法(需要 Pillow):
|
||||
python3 gen-store-assets.py
|
||||
產物寫回本目錄、隨 repo 版控;`build-msix.sh` 只負責 cp 進包裡。
|
||||
"""
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
# CIS 住在 InkStoneCo 頂層。預設往上找,找不到時用 ARCRUN_CIS 指過去。
|
||||
CIS = Path(os.environ["ARCRUN_CIS"]) if os.environ.get("ARCRUN_CIS") else None
|
||||
if CIS is None:
|
||||
for parent in HERE.parents:
|
||||
cand = parent / "arcrun-cis"
|
||||
if cand.is_dir():
|
||||
CIS = cand
|
||||
break
|
||||
|
||||
INK = (23, 24, 26, 255)
|
||||
PAPER = (253, 252, 251, 255)
|
||||
|
||||
|
||||
def load(name: str) -> Image.Image:
|
||||
if CIS is None or not (CIS / name).exists():
|
||||
raise SystemExit(
|
||||
f"❌ 找不到 CIS 素材 {name}(找過 {CIS})\n"
|
||||
f" 指過去:ARCRUN_CIS=/path/to/arcrun-cis python3 {Path(__file__).name}")
|
||||
return Image.open(CIS / name).convert("RGBA")
|
||||
|
||||
|
||||
def chevron_on_ink(size: int, inset: float = 0.20) -> Image.Image:
|
||||
"""雙 chevron(paper)置中於墨底——給 26px 以下的小尺寸用。
|
||||
|
||||
幾何與 CIS `chevron-double.svg` 同一組座標(24-grid、stroke 2.8)。
|
||||
先超取樣畫再縮,邊緣才不會鋸齒。
|
||||
"""
|
||||
ss = size * 16
|
||||
unit = ss / 24.0
|
||||
layer = Image.new("RGBA", (ss, ss), (0, 0, 0, 0))
|
||||
d = ImageDraw.Draw(layer)
|
||||
w = max(1, round(2.8 * unit))
|
||||
for dx in (0, 7):
|
||||
d.line([((5 + dx) * unit, 5 * unit),
|
||||
((12 + dx) * unit, 12 * unit),
|
||||
((5 + dx) * unit, 19 * unit)],
|
||||
fill=PAPER, width=w, joint="curve")
|
||||
|
||||
art = layer.crop(layer.split()[3].getbbox())
|
||||
target = ss * (1 - 2 * inset)
|
||||
scale = target / max(art.size)
|
||||
nw, nh = max(1, round(art.size[0] * scale)), max(1, round(art.size[1] * scale))
|
||||
art = art.resize((nw, nh), Image.LANCZOS)
|
||||
|
||||
out = Image.new("RGBA", (ss, ss), INK)
|
||||
out.paste(art, ((ss - nw) // 2, (ss - nh) // 2), art)
|
||||
return out.resize((size, size), Image.LANCZOS)
|
||||
|
||||
|
||||
def wide_tile(w: int, h: int, pad_ratio: float = 0.14) -> Image.Image:
|
||||
"""寬磚:橫式 lockup 等比 fit 進墨底,四周留白(CIS clear space)。"""
|
||||
lock = load("arcrun-lockup-h-paper-on-ink.png")
|
||||
canvas = Image.new("RGBA", (w, h), INK)
|
||||
lw, lh = lock.size
|
||||
scale = min(w * (1 - 2 * pad_ratio) / lw, h * (1 - 2 * pad_ratio) / lh)
|
||||
nw, nh = max(1, round(lw * scale)), max(1, round(lh * scale))
|
||||
art = lock.resize((nw, nh), Image.LANCZOS)
|
||||
canvas.paste(art, ((w - nw) // 2, (h - nh) // 2), art)
|
||||
return canvas
|
||||
|
||||
|
||||
def main() -> None:
|
||||
square = load("arcrun-icon-ink-1024.png")
|
||||
made = []
|
||||
|
||||
for name, s in [("Square44x44Logo", 44), ("StoreLogo", 50),
|
||||
("Square71x71Logo", 71), ("Square150x150Logo", 150),
|
||||
("Square310x310Logo", 310)]:
|
||||
square.resize((s, s), Image.LANCZOS).save(HERE / f"{name}.png")
|
||||
made.append((f"{name}.png", s, s))
|
||||
|
||||
# 工作列 / 開始功能表多尺寸:26px 以下用 chevron(CIS 規定),其餘用方形 icon
|
||||
for s in (16, 24, 32, 48, 256):
|
||||
img = chevron_on_ink(s) if s <= 26 else square.resize((s, s), Image.LANCZOS)
|
||||
img.save(HERE / f"Square44x44Logo.targetsize-{s}.png")
|
||||
made.append((f"Square44x44Logo.targetsize-{s}.png", s, s))
|
||||
|
||||
wide_tile(310, 150).save(HERE / "Wide310x150Logo.png")
|
||||
made.append(("Wide310x150Logo.png", 310, 150))
|
||||
|
||||
for n, w, h in made:
|
||||
print(f"✅ {n}: {w}x{h}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -7,17 +7,18 @@
|
||||
# 靠微軟自家開源跨平台工具 msix-packaging 的 `makemsix`。
|
||||
#
|
||||
# ⚠️ **不必自購簽章憑證**:送 Store 的 msix 不用簽——微軟過審後會用自己的憑證重簽。
|
||||
# 但**側載**(不走 Store)就必須自己簽。(官方說明見 ../arcrun-tray/docs/store-submission.md §2)
|
||||
# 但**側載**(不走 Store)就必須自己簽。
|
||||
#
|
||||
# 與舊 fyne 版(../arcrun-tray/build-msix.sh)的差別:
|
||||
# 舊版是單一 exe(collector 用 //go:embed 吃進去);
|
||||
# 沿革:舊 fyne 版(`../arcrun-tray/`)是單一 exe(collector 用 //go:embed 吃進去);
|
||||
# (2026-08-06 起改回一個 exe:collector 編進 Arcrun.exe,`--collector` 換身分。
|
||||
# 以下敘述保留為沿革)**Wails 版曾是兩個 exe**(見 supervise.go 的
|
||||
# os.Executable() 同層查找)⇒ 兩個都要進 msix root,缺一個就「裝了不會同步」。
|
||||
# 🔴 2026-08-18(D95 第一輪):`arcrun-tray/` 已整個下架,
|
||||
# 它的 `--setup`(建 makemsix)與 Store 圖示都已搬進本目錄——見下方 --setup 段與 assets/store/。
|
||||
#
|
||||
# 前置(一次就好):
|
||||
# brew install mingw-w64 cmake icu4c
|
||||
# bash ../arcrun-tray/build-msix.sh --setup # 建 makemsix(約 5-10 分鐘)
|
||||
# bash build-msix.sh --setup # 建 makemsix(約 5-10 分鐘)
|
||||
#
|
||||
# 用法:
|
||||
# IDENTITY_NAME=<Partner Center 的 Name> \
|
||||
@@ -29,9 +30,41 @@ cd "$(dirname "$0")"
|
||||
|
||||
MSIX_SDK_DIR="${MSIX_SDK_DIR:-$HOME/.cache/msix-packaging}"
|
||||
MAKEMSIX="$MSIX_SDK_DIR/.vs/bin/makemsix"
|
||||
|
||||
# ── --setup:建 makemsix(一次性)────────────────────────────────────────
|
||||
# 🔴 2026-08-18:**逐字取自 `arcrun-tray/build-msix.sh`**(512ea9f 之後未再改動),不是重寫。
|
||||
# 那個目錄是死碼要下架,但**這一段不是死的**——本腳本原本第 34 行就叫人去跑它。
|
||||
# 死碼下架時最容易犯的錯是「連還活著的那一塊一起丟掉」,所以先搬過來再刪。
|
||||
if [[ "${1:-}" == "--setup" ]]; then
|
||||
echo "① clone msix-packaging(微軟開源,匿名讀取,不碰 GitHub 寫入)"
|
||||
[[ -d "$MSIX_SDK_DIR" ]] || git clone --depth 1 https://github.com/microsoft/msix-packaging.git "$MSIX_SDK_DIR"
|
||||
|
||||
echo "② 修 C++ 標準:14 → 17"
|
||||
# 為什麼要修:這套 SDK 停在 2022 年、寫死 C++14,但 Homebrew 現在的 ICU 標頭
|
||||
# 用了 std::is_same_v 等 C++17 語法 ⇒ 不修必炸 'no template named is_same_v'。
|
||||
# **兩個檔都要改**——頂層改了還會被 xerces 子專案的設定蓋回去(實際踩過的坑)。
|
||||
for f in "$MSIX_SDK_DIR/CMakeLists.txt" "$MSIX_SDK_DIR/lib/xerces/CMakeLists.txt"; do
|
||||
sed -i.bak 's/set(CMAKE_CXX_STANDARD 14)/set(CMAKE_CXX_STANDARD 17)/' "$f"
|
||||
done
|
||||
|
||||
ICU_PREFIX="$(brew --prefix icu4c@77 2>/dev/null || brew --prefix icu4c)"
|
||||
[[ -f "$ICU_PREFIX/include/unicode/uset.h" ]] || { echo "❌ 找不到 ICU 標頭。先跑:brew install icu4c" >&2; exit 1; }
|
||||
|
||||
echo "③ cmake 配置(--pack 才會有打包功能,預設是關的)"
|
||||
mkdir -p "$MSIX_SDK_DIR/.vs" && cd "$MSIX_SDK_DIR/.vs"
|
||||
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DXML_PARSER=xerces -DSKIP_BUNDLES=off \
|
||||
-DUSE_VALIDATION_PARSER=on -DMSIX_PACK=on -DMSIX_SAMPLES=off -DMSIX_TESTS=off \
|
||||
-DCMAKE_OSX_ARCHITECTURES="$(uname -m)" -DCMAKE_TOOLCHAIN_FILE=../cmake/macos.cmake \
|
||||
-DUSE_MSIX_SDK_ZLIB=on -DMACOS=on -DCMAKE_CXX_FLAGS="-I$ICU_PREFIX/include" ..
|
||||
echo "④ 編(約 5-10 分鐘)"
|
||||
make -j"$(sysctl -n hw.ncpu)"
|
||||
echo "✅ makemsix 完成:$MAKEMSIX"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
[[ -x "$MAKEMSIX" ]] || {
|
||||
echo "❌ 找不到 makemsix:$MAKEMSIX"
|
||||
echo " 先跑一次:bash ../arcrun-tray/build-msix.sh --setup"
|
||||
echo " 先跑一次:bash build-msix.sh --setup"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -72,7 +105,8 @@ rm -rf "$OUT" && mkdir -p "$OUT/root/Assets"
|
||||
cp build/bin/arcrun-app.exe "$OUT/root/Arcrun.exe"
|
||||
|
||||
echo "② 複製 Store 圖示(沿用 CIS 版,不重產——sips 縮放會把方形拉扁)"
|
||||
cp ../arcrun-tray/assets/store/*.png "$OUT/root/Assets/"
|
||||
# 2026-08-18(D95 第一輪):素材從 `../arcrun-tray/assets/store/` 搬到本目錄底下。
|
||||
cp assets/store/*.png "$OUT/root/Assets/"
|
||||
|
||||
echo "③ 寫 AppxManifest.xml(能力宣告誠實且最小化)"
|
||||
cat > "$OUT/root/AppxManifest.xml" <<EOF
|
||||
|
||||