From 85637edc5ba029a9e85e7dcee2b6d1551f90b674 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Fri, 31 Oct 2025 07:50:43 +0800 Subject: [PATCH] =?UTF-8?q?windows:=20=E4=BC=98=E5=8C=96=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E6=9F=A5=E6=89=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/reinstall.sh b/reinstall.sh index 26a15eb..1d7afc6 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -830,18 +830,13 @@ is_have_arm_version() { case "$version" in 10) case "$edition" in - pro | education | enterprise | 'pro education' | 'pro for workstations') return ;; + home | 'home single language' | pro | education | enterprise | 'pro education' | 'pro for workstations') return ;; 'iot enterprise') return ;; + # arm ltsc 只有 2021 有 iso 'enterprise ltsc 2021' | 'iot enterprise ltsc 2021') return ;; esac ;; - 11) - case "$edition" in - pro | education | enterprise | 'pro education' | 'pro for workstations') return ;; - 'iot enterprise' | 'iot enterprise subscription') return ;; - 'enterprise ltsc 2024' | 'iot enterprise ltsc 2024' | 'iot enterprise ltsc 2024 subscription') return ;; - esac - ;; + 11) return ;; esac return 1 } @@ -851,9 +846,6 @@ find_windows_iso() { if ! [ "$version" = 8.1 ] && [ -z "$edition" ]; then error_and_exit "Edition is not set." fi - if [ "$basearch" = 'aarch64' ] && ! is_have_arm_version; then - error_and_exit "No ARM iso for this Windows Version." - fi if [ -z "$lang" ]; then lang=en-us @@ -929,7 +921,13 @@ get_windows_iso_link() { 10) case "$edition" in home | 'home single language') echo consumer ;; - pro | education | enterprise | 'pro education' | 'pro for workstations') echo business ;; + pro | enterprise) echo business ;; + education | 'pro education' | 'pro for workstations') + case "$arch_win" in + arm64) echo consumer ;; + x64) echo business ;; # iso 更小 + esac + ;; # iot 'iot enterprise') echo 'iot enterprise' ;; # iot ltsc @@ -946,13 +944,23 @@ get_windows_iso_link() { esac ;; 11) + # arm business iso 都没有 education, pro education, pro for workstations + # 即使它的名字包含 EDU + # SW_DVD9_Win_Pro_10_22H2.31_Arm64_English_Pro_Ent_EDU_N_MLF_X24-05074.ISO + # en-us_windows_11_business_editions_version_25h2_arm64_dvd_8afc9b39.iso case "$edition" in home | 'home single language') echo consumer ;; - pro | education | enterprise | 'pro education' | 'pro for workstations') echo business ;; + pro | enterprise) echo business ;; + education | 'pro education' | 'pro for workstations') + case "$arch_win" in + arm64) echo consumer ;; + x64) echo business ;; # iso 更小 + esac + ;; # iot 'iot enterprise' | 'iot enterprise subscription') echo 'iot enterprise' ;; # iot ltsc - 'iot enterprise ltsc 2024' | 'iot enterprise ltsc 2024 subscription') echo 'iot enterprise ltsc 2024' ;; + 'iot enterprise ltsc 2024' | 'iot enterprise subscription ltsc 2024') echo 'iot enterprise ltsc 2024' ;; # ltsc 'enterprise ltsc 2024') # arm64 的 enterprise ltsc 2024 要下载 iot enterprise ltsc 2024 iso @@ -1035,8 +1043,17 @@ get_windows_iso_link() { echo "List: $page_url" echo + # 先判断是否能自动查找该版本 + # 再判断是否支持 arm + # 这样可以在输入错误 Edition 时例如 windows 11 enterprise ltsc 2021 + # 显示名称错误,而不是显示该版本不支持 arm + if [ -z "$page" ] || { [ -z "$label_msdn" ] && [ -z "$label_msdl" ] && [ -z "$label_vlsc" ]; }; then - error_and_exit "Not support find this iso. Check if --image-name is wrong. If not, set --iso manually." + error_and_exit "Not support find this iso. Check if --image-name is wrong. Or set --iso manually." + fi + + if [ "$basearch" = aarch64 ] && ! is_have_arm_version; then + error_and_exit "No ARM iso for this Windows Version and Edition." fi if [ -n "$label_msdl" ]; then