From d16630265047658277a95c98290ed1371b8b7995 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Thu, 6 Jul 2023 21:52:48 +0800 Subject: [PATCH] windows: workaround install.esd --- Autounattend.xml | 12 +++++++++--- trans.sh | 10 ++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Autounattend.xml b/Autounattend.xml index b0d83af..0df9542 100644 --- a/Autounattend.xml +++ b/Autounattend.xml @@ -93,16 +93,22 @@ + - net user Administrator /active:yes 1 + net user Administrator /active:yes + 2 + cmd /c type nul >>C:\resize.bat + + + 3 C:\resize.bat - - 3 + + 4 cmd /c "del C:\resize.bat" diff --git a/trans.sh b/trans.sh index 5f8b763..0fa49b4 100644 --- a/trans.sh +++ b/trans.sh @@ -516,10 +516,12 @@ EOF # windows 7 没有 invoke-webrequest # installer分区盘符不一定是D盘 # 所以复制 resize.bat 到 install.wim - image_name=$(wiminfo $install_wim | grep -ix "Name:[[:blank:]]*$image_name" | cut -d: -f2 | xargs) - wimmountrw $install_wim "$image_name" /wim/ - download $confhome/resize.bat /wim/resize.bat - wimunmount --commit /wim/ + # TODO: 由于esd文件无法修改,要将resize.bat放到boot.wim + if [[ "$install_wim" = "*.wim" ]]; then + wimmountrw $install_wim "$image_name" /wim/ + download $confhome/resize.bat /wim/resize.bat + wimunmount --commit /wim/ + fi # 添加引导 if [ -d /sys/firmware/efi/ ]; then