From 6341c21d0b5b2e90f8121a73a7cc12795e2b3ae8 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 25 Apr 2026 23:16:53 +0800 Subject: [PATCH] =?UTF-8?q?windows:=20=E5=9B=BD=E5=86=85=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E8=AE=BF=E9=97=AE=20intel.cn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/trans.sh b/trans.sh index bc2c1b0..457d59d 100644 --- a/trans.sh +++ b/trans.sh @@ -5812,6 +5812,22 @@ get_windows_arch_from_windows_drive() { apk del hivex } +get_intel_download_url() { + local id=$1 + local file_regex=$2 + + if is_in_china; then + local url=https://www.intel.cn/content/www/cn/zh/download/$id.html + else + local url=https://www.intel.com/content/www/us/en/download/$id.html + fi + + # 在每个双引号前和后添加换行符,使每个链接占一行 + # intel 禁止了 wget 下载网页 + wget -U curl/7.54.1 "$url" -O- | sed 's,",\n"\n,g' | + grep -Eio -m1 "https://.+/$file_regex" | grep . +} + install_windows() { get_wim_prop() { wim=$1 @@ -6377,9 +6393,7 @@ install_windows() { 2025) echo 838943 ;; esac ) - # intel 禁止了 wget 下载网页 - wget -U curl/7.54.1 https://www.intel.com/content/www/us/en/download/$id.html -O- | - grep -Eio -m1 "\"https://.+/(Wired_driver|prowin).*${arch_intel}(legacy)?\.(zip|exe)\"" | tr -d '"' | grep . + get_intel_download_url "$id" "(Wired_driver|prowin).*${arch_intel}(legacy)?\.(zip|exe)" ;; esac ;; esac @@ -7063,6 +7077,8 @@ EOF } add_driver_vmd() { + info "Add drivers: VMD" + # RST v20 不支持 11代 PCI\VEN_8086&DEV_9A0B support_v19=false support_v20=false @@ -7080,18 +7096,16 @@ EOF fi done - local page= + local id if $support_v20 && [ "$build_ver" -ge 19041 ]; then - page=https://www.intel.com/content/www/us/en/download/849936.html + id=849936 elif $support_v19 && [ "$build_ver" -ge 15063 ]; then - page=https://www.intel.com/content/www/us/en/download/849933.html + id=849933 fi - if [ -n "$page" ]; then - # intel 禁止了 wget 下载网页 + if [ -n "$id" ]; then local url - url=$(wget -U curl/7.54.1 "$page" -O- | - grep -Eio -m1 "\"https://.+/SetupRST\.exe\"" | tr -d '"' | grep .) + url=$(get_intel_download_url "$id" "SetupRST\.exe") # 注意 intel 禁止了 aria2 下载 download $url $drv/SetupRST.exe