Windows 7 安裝 `.themepack` 主題包時,若檔名第 9 個字元為空格,會導致安裝靜默失敗 (無任何提示、無反應)。此為已知 Bug,微軟未修正。
$themepack = "path\to\theme.themepack"
Rename-Item $themepack ($themepack -replace '\.themepack$', '.cab')
Expand-Archive -Path ($themepack -replace '\.themepack$', '.cab') -DestinationPath "temp_theme"
$themeFile = Get-ChildItem "temp_theme\*.theme" | Select -First 1
$content = Get-Content $themeFile.FullName -Raw
$content = $content -replace '(?<=.{8})\s', '' # 移除第9字元空格
Set-Content $themeFile.FullName $content
# 重新封裝需 CabPack 或 makecab.exe
這個「第 9 字元空格 Bug」極具隱蔽性,無錯誤訊息、無日誌記錄,唯一徵兆是「雙擊無反應」。記住這個冷知識,下次遇到主題包安裝失敗,第一時間檢查檔名第 9 字元,秒解困擾。