Files
windows-unattend/DEPLOY.md
Timmy e106d749c7 修正兩處實機部署失敗的 XML bug;新增 DEPLOY.md 紀錄本機 USB 部署
- 根元素加上 xmlns:wcm / xmlns:xsi 命名空間宣告,否則全檔 wcm:action 無法解析(第 27 行第 9 欄即炸)
- ComputerName 改用 *,隨機後綴改由 FirstLogonCommands 的 Rename-Computer 產生;原本 PC-%RAND:5% 並非 Windows Setup 內建巨集,字面送入導致 specialize 階段 Shell-Setup 失敗
- 同步更正 CLAUDE.md / SUMMARY.md 對 %RAND:5% 的錯誤說明
- 新增 DEPLOY.md:/Volumes/Ventoy 的實際檔案佈局與重建步驟

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 18:59:35 +08:00

102 lines
3.6 KiB
Markdown
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.
# DEPLOY — 本機 Ventoy USB 部署紀錄
這份文件記錄本機 Ventoy USB`/Volumes/Ventoy`)上 `unattend.xml``ventoy.json` 的實際部署方式,供下次換機、換 ISO、或刷新 USB 內容時照著做。
概念與疑難排解請看 `QUICKSTART.md`;這份只寫「這顆 USB 目前的樣子」和「怎麼重建它」。
---
## 目前 USB 內容
掛載點:`/Volumes/Ventoy`
USB 根目錄兩個 ISO
| 檔名 | 用途 |
|---|---|
| `Windows 11_25H2_Chinese_Traditional_x64v1.iso` | Win11 25H2 繁中 x64 |
| `Windows 10_22H2_Chinese_Traditional_x64v1.iso` | Win10 22H2 繁中 x64 |
注入檔案佈局:
```
/Volumes/Ventoy/
├── Windows 11_25H2_Chinese_Traditional_x64v1.iso
├── Windows 10_22H2_Chinese_Traditional_x64v1.iso
└── ventoy/
├── ventoy.json ← 對應兩個 ISO都指向同一份 template
└── script/
└── unattend.xml ← 與 repo 根目錄的 unattend.xml 相同
```
---
## USB 上的 `ventoy.json`
**與 repo 根目錄的 `ventoy.json` 不同** —— repo 版本保留通用示範路徑 `/Win11.iso`USB 版本則綁定本機這兩個 ISO 的實際檔名:
```json
{
"auto_install": [
{
"image": "/Windows 11_25H2_Chinese_Traditional_x64v1.iso",
"template": "/ventoy/script/unattend.xml"
},
{
"image": "/Windows 10_22H2_Chinese_Traditional_x64v1.iso",
"template": "/ventoy/script/unattend.xml"
}
]
}
```
- `image` 路徑以 `/` 開頭,相對 USB 根目錄,**完整檔名必須跟 USB 上一字不差**(含空格、底線、版本號)。
- 兩個 ISO 共用同一份 `unattend.xml`;該 XML 目前以 UEFI+GPT 全碟清除方式部署,兩個版本皆適用。
- 若日後只想其中一個 ISO 走自動安裝、另一個保留互動安裝刪掉對應的物件即可Ventoy 找不到對應 `image` 時會走一般安裝流程。
---
## 重新部署步驟macOS
插入 Ventoy USB 後:
```bash
# 從 repo 根目錄執行
mkdir -p /Volumes/Ventoy/ventoy/script
cp unattend.xml /Volumes/Ventoy/ventoy/script/unattend.xml
# 寫 ventoy.json見上一節內容或直接手編
# 注意image 檔名必須跟 USB 上的 ISO 檔名完全一致
# 清掉 macOS 複製過程產生的 ._ AppleDouble metadata
dot_clean /Volumes/Ventoy/ventoy
```
驗證:
```bash
ls /Volumes/Ventoy/ventoy/ /Volumes/Ventoy/ventoy/script/
diff unattend.xml /Volumes/Ventoy/ventoy/script/unattend.xml # 應無輸出
cat /Volumes/Ventoy/ventoy/ventoy.json
```
---
## 換 ISO 時要改什麼
1. 把新 ISO 丟到 USB 根目錄。
2. 編輯 `/Volumes/Ventoy/ventoy/ventoy.json`,把對應條目的 `image` 換成新檔名(或新增一條)。
3. **不用**動 `/Volumes/Ventoy/ventoy/script/unattend.xml`,除非要改 Windows 版本特有設定。
4. 若 repo 裡的 `unattend.xml` 有更新,重跑一次 `cp``dot_clean` 即可。
---
## 本次部署已知限制
沿用 repo 預設值,下列情況會失敗,改用前要先處理:
- **目標機若是 BIOS/MBR**`<DiskConfiguration>` 目前寫死 UEFI+GPT分割階段會報錯。
- **ARM64 機器**:所有 `<component>``processorArchitecture="amd64"` 要改成 `arm64`
- **`C:\Scripts\Setup.ps1` 未提供**`FirstLogonCommands` 會在首次登入時報「找不到檔案」。解法:在 `FirstLogonCommands` 前段加一條從 USB 複製的指令,或另外烘進 image或乾脆刪掉 `Order=1` 那條 `SynchronousCommand`
- **密碼是明碼**`<PlainText>true</PlainText>`):僅適合測試用途;正式部署請用 Windows SIM 產 Base64。