mirror of
https://github.com/bin456789/reinstall.git
synced 2026-10-03 22:17:46 +08:00
windows: 支持查找 32 位 iso
This commit is contained in:
@@ -361,6 +361,7 @@ bash reinstall.sh netboot.xyz
|
|||||||
#### Method 1: Let the Script Automatically Search for ISO
|
#### Method 1: Let the Script Automatically Search for ISO
|
||||||
|
|
||||||
- The script will search for ISOs from <https://ntriver.org/download-windows-office>, a site that collects official ISOs.
|
- The script will search for ISOs from <https://ntriver.org/download-windows-office>, a site that collects official ISOs.
|
||||||
|
- Searches for 64-bit system images by default, unless `--bit 32` is specified.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash reinstall.sh windows \
|
bash reinstall.sh windows \
|
||||||
|
|||||||
@@ -361,6 +361,7 @@ bash reinstall.sh netboot.xyz
|
|||||||
#### 方法 1: 让脚本自动查找 ISO
|
#### 方法 1: 让脚本自动查找 ISO
|
||||||
|
|
||||||
- 脚本会从 <https://ntriver.org/download-windows-office> 查找 ISO,该网站专门收集官方 ISO 镜像
|
- 脚本会从 <https://ntriver.org/download-windows-office> 查找 ISO,该网站专门收集官方 ISO 镜像
|
||||||
|
- 默认查找 64 位系统镜像,除非指定了 `--bit 32`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash reinstall.sh windows \
|
bash reinstall.sh windows \
|
||||||
|
|||||||
+42
-3
@@ -944,6 +944,26 @@ is_have_arm64_version() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_have_32_bit_version() {
|
||||||
|
case "$version" in
|
||||||
|
2008)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
vista | 7 | 8 | 8.1)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
10)
|
||||||
|
# iot enterprise 曾经有 32 位版本
|
||||||
|
# en_windows_10_iot_enterprise_version_1909_x86_dvd_b62f9c12.iso
|
||||||
|
case "$edition" in
|
||||||
|
'iot enterprise ltsc 2021') return 1 ;;
|
||||||
|
*) return ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
find_windows_iso() {
|
find_windows_iso() {
|
||||||
parse_windows_image_name || error_and_exit "--image-name wrong: $image_name"
|
parse_windows_image_name || error_and_exit "--image-name wrong: $image_name"
|
||||||
if ! { [ "$version" = 8 ] || [ "$version" = 8.1 ]; } && [ -z "$edition" ]; then
|
if ! { [ "$version" = 8 ] || [ "$version" = 8.1 ]; } && [ -z "$edition" ]; then
|
||||||
@@ -963,8 +983,14 @@ find_windows_iso() {
|
|||||||
full_langs="$(lang_convert full_language) $(lang_convert fallback_full_language)"
|
full_langs="$(lang_convert full_language) $(lang_convert fallback_full_language)"
|
||||||
full_langs=$(xargs -n 1 <<<"$full_langs" | awk '!seen[$0]++' | xargs)
|
full_langs=$(xargs -n 1 <<<"$full_langs" | awk '!seen[$0]++' | xargs)
|
||||||
|
|
||||||
case "$basearch" in
|
# 默认 64 位,除非指定了 32 位
|
||||||
x86) # 备用,查找功能目前不支持 32 位
|
iso_arch_to_find=$basearch
|
||||||
|
if [ "$bit" = 32 ]; then
|
||||||
|
iso_arch_to_find=x86
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$iso_arch_to_find" in
|
||||||
|
x86)
|
||||||
arch_win=x86
|
arch_win=x86
|
||||||
arch_win_vlsc='32-?bit'
|
arch_win_vlsc='32-?bit'
|
||||||
;;
|
;;
|
||||||
@@ -1193,6 +1219,7 @@ get_windows_iso_link() {
|
|||||||
echo "Label vlsc: $label_vlsc"
|
echo "Label vlsc: $label_vlsc"
|
||||||
echo "Page: $page_url"
|
echo "Page: $page_url"
|
||||||
echo "Languages: $langs $full_langs"
|
echo "Languages: $langs $full_langs"
|
||||||
|
echo "Arch: $arch_win"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# 先判断是否能自动查找该版本
|
# 先判断是否能自动查找该版本
|
||||||
@@ -1204,10 +1231,14 @@ get_windows_iso_link() {
|
|||||||
error_and_exit "Not support find this iso. Check if --image-name is wrong. Or set --iso manually."
|
error_and_exit "Not support find this iso. Check if --image-name is wrong. Or set --iso manually."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$basearch" = aarch64 ] && ! is_have_arm64_version; then
|
if [ "$arch_win" = arm64 ] && ! is_have_arm64_version; then
|
||||||
error_and_exit "No ARM64 iso for this Windows Version or Edition."
|
error_and_exit "No ARM64 iso for this Windows Version or Edition."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$arch_win" = x86 ] && ! is_have_32_bit_version; then
|
||||||
|
error_and_exit "No 32-bit iso for this Windows Version or Edition."
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$label_msdl" ]; then
|
if [ -n "$label_msdl" ]; then
|
||||||
iso=$(curl -L "$page_url" | grep -ioP 'https://[^ ]+?#[0-9]+' | head -1 | grep .)
|
iso=$(curl -L "$page_url" | grep -ioP 'https://[^ ]+?#[0-9]+' | head -1 | grep .)
|
||||||
else
|
else
|
||||||
@@ -4877,6 +4908,7 @@ for o in ci installer debug minimal no-cloud-kernel no-auto-drivers allow-ping f
|
|||||||
hold: sleep: \
|
hold: sleep: \
|
||||||
iso: \
|
iso: \
|
||||||
image-name: \
|
image-name: \
|
||||||
|
bit: \
|
||||||
boot-wim: \
|
boot-wim: \
|
||||||
img: \
|
img: \
|
||||||
cloud-data: \
|
cloud-data: \
|
||||||
@@ -5199,6 +5231,13 @@ EOF
|
|||||||
lang=$(echo "$2" | to_lower)
|
lang=$(echo "$2" | to_lower)
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
--bit)
|
||||||
|
if ! { [ "$2" = 32 ] || [ "$2" = 64 ]; }; then
|
||||||
|
error_and_exit "Invalid $1 value: $2"
|
||||||
|
fi
|
||||||
|
bit=$2
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user