core: cygwin EOL 统一使用 cygwin-archive x86 源

This commit is contained in:
bin456789
2024-03-15 00:01:34 +08:00
parent bec14c13c1
commit 8b3ba5c7d3
2 changed files with 39 additions and 22 deletions

View File

@ -856,7 +856,7 @@ is_efi() {
is_secure_boot_enabled() {
if is_efi; then
if is_in_windows; then
reg query 'HKLM\SYSTEM\CurrentControlSet\Control\SecureBoot\State' /v UEFISecureBootEnabled | grep 0x1
reg query 'HKLM\SYSTEM\CurrentControlSet\Control\SecureBoot\State' /v UEFISecureBootEnabled 2>/dev/null | grep 0x1
else
# localhost:~# mokutil --sb-state
# SecureBoot disabled
@ -1497,9 +1497,25 @@ EOF
}
# 脚本入口
if is_in_windows; then
# win系统盘
c=$(echo $SYSTEMDRIVE | cut -c1)
# 64位系统 + 32位cmd/cygwin需要添加 PATH否则找不到64位系统程序例如bcdedit
sysnative=$(cygpath -u $WINDIR\\Sysnative)
if [ -d $sysnative ]; then
PATH=$PATH:$sysnative
fi
# 更改 windows 命令输出语言为英文
# chcp.com 437 # 会清屏
mode.com con cp select=437 >/dev/null
fi
# 检查 root
if is_in_windows; then
if ! openfiles >/dev/null 2>&1; then
# 64位系统 + 32位cmd/cygwin运行 openfiles 报错:目标系统必须运行 32 位的操作系统
if ! fltmc >/dev/null 2>&1; then
error_and_exit "Please run as administrator."
fi
else
@ -1566,15 +1582,6 @@ if is_secure_boot_enabled; then
error_and_exit "Not Supported with secure boot enabled."
fi
if is_in_windows; then
# win系统盘
c=$(echo $SYSTEMDRIVE | cut -c1)
# 更改 windows 命令输出语言为英文
# chcp.com 437 # 会清屏
mode.com con cp select=437 >/dev/null
fi
# 必备组件
install_pkg curl grep