windows: 通过文件检测是否有 sac 组件

This commit is contained in:
bin456789
2025-02-21 00:30:35 +08:00
parent 9732c3379a
commit 739c75c2d1
2 changed files with 20 additions and 7 deletions

View File

@ -5629,9 +5629,15 @@ install_windows() {
fi
fi
mkdir -p /wim
# 挂载 install.wim检查是否有 sac 组件
wimmount "$install_wim" "$image_name" /wim/
[ -f /wim/Windows/System32/sacsess.exe ] && has_sac=true || has_sac=false
wimunmount /wim/
# 挂载 boot.wim
info "mount boot.wim"
mkdir -p /wim
wimmountrw /os/boot.wim "$boot_index" /wim/
cp_drivers() {
@ -5697,6 +5703,11 @@ install_windows() {
sed -i 's/ForceOldSetup=0/ForceOldSetup=1/i' $system32_dir/startnet.cmd
fi
# 有 SAC 组件时,启用 EMS
if $has_sac; then
sed -i 's/EnableEMS=0/EnableEMS=1/i' $system32_dir/startnet.cmd
fi
# Windows Thin PC 有 Windows\System32\winpeshl.ini
# [LaunchApps]
# %SYSTEMDRIVE%\windows\system32\drvload.exe, %SYSTEMDRIVE%\windows\inf\sdbus.inf