From 619671f77c1a80425329be137fbbdd1e72c6b630 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Thu, 31 Oct 2024 18:15:07 +0800 Subject: [PATCH] =?UTF-8?q?windows:=20win7=20=E6=88=96=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E5=88=A0=E9=99=A4=20boot.wim=20=E5=8D=B7=201=20=E4=BB=A5?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=86=85=E5=AD=98=E5=8D=A0=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/trans.sh b/trans.sh index 5a9caf9..6eb2bd3 100644 --- a/trans.sh +++ b/trans.sh @@ -4700,15 +4700,22 @@ install_windows() { wimunmount --commit /wim/ # 优化 boot.wim 大小 - # vista 删除镜像1 会报错 - # Windows cannot access the required file Drive:\Sources\Boot.wim. - # Make sure all files required for installation are available and restart the installation. - # Error code: 0x80070491 - du -h /iso/sources/boot.wim - du -h /os/boot.wim - # wimdelete /os/boot.wim 1 - wimoptimize /os/boot.wim - du -h /os/boot.wim + echo "boot.wim size:" + echo "Original: $(du -h /iso/sources/boot.wim | cut -f1)" + echo "Original + Drivers: $(du -h /os/boot.wim | cut -f1)" + if is_nt_ver_ge 6.1 && [ "$boot_index" = 2 ]; then + # win7 或以上删除 boot.wim 镜像 1 不会报错 + # 因为 win7 winre 镜像在 install.wim Windows\System32\Recovery\winRE.wim + wimdelete /os/boot.wim 1 + else + # vista 删除 boot.wim 镜像 1 会报错 + # Windows cannot access the required file Drive:\Sources\Boot.wim. + # Make sure all files required for installation are available and restart the installation. + # Error code: 0x80070491 + # vista install.wim 没有 Windows\System32\Recovery\winRE.wim + wimoptimize /os/boot.wim + fi + echo "Original + Drivers + Optimized: $(du -h /os/boot.wim | cut -f1)" # 将 boot.wim 放到正确的位置 if is_efi; then