mirror of
https://github.com/bin456789/reinstall.git
synced 2025-03-13 23:24:43 +08:00
windows: 通过文件检测是否有 sac 组件
This commit is contained in:
parent
9732c3379a
commit
739c75c2d1
13
trans.sh
13
trans.sh
@ -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
|
||||
|
@ -49,9 +49,9 @@ echo list vol | diskpart | find "efi" && (
|
||||
)
|
||||
|
||||
rem 获取 ProductType
|
||||
for /f "tokens=3" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v ProductType') do (
|
||||
set "ProductType=%%a"
|
||||
)
|
||||
rem for /f "tokens=3" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v ProductType') do (
|
||||
rem set "ProductType=%%a"
|
||||
rem )
|
||||
|
||||
rem 获取 BuildNumber
|
||||
for /f "tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentBuildNumber') do (
|
||||
@ -155,6 +155,7 @@ for %%a in (RAM TPM SecureBoot) do (
|
||||
rem 设置
|
||||
set ForceOldSetup=0
|
||||
set EnableUnattended=1
|
||||
set EnableEMS=0
|
||||
|
||||
rem 运行 ramdisk X:\setup.exe 的话
|
||||
rem vista 会找不到安装源
|
||||
@ -190,9 +191,10 @@ if %BuildNumber% GEQ 26040 if "%ForceOldSetup%"=="0" (
|
||||
set ResizeRecoveryPartition=/ResizeRecoveryPartition Disable
|
||||
)
|
||||
|
||||
rem 为 windows server 打开 EMS
|
||||
rem 普通 windows 没有自带 EMS 组件,暂不处理
|
||||
if "%ProductType%"=="ServerNT" (
|
||||
rem 为 windows server 打开 EMS/SAC
|
||||
rem 普通 windows 没有自带 SAC 组件,暂不处理
|
||||
rem 现在通过 trans.sh 准确检测系统是否有 SAC 组件,有则修改 EnableEMS 变量打开 EMS
|
||||
if "%EnableEMS%"=="1" (
|
||||
rem set EMS=/EMSPort:UseBIOSSettings /EMSBaudRate:115200
|
||||
set EMS=/EMSPort:COM1 /EMSBaudRate:115200
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user