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

@@ -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
)