windows: 处理 24h2 新版安装程序不会自动设置虚拟内存,导致 1g 内存安装失败

This commit is contained in:
bin456789 2024-05-30 22:53:35 +08:00
parent ad295473bc
commit 1fb1a26dd4
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
5 changed files with 39 additions and 14 deletions

View File

@ -215,14 +215,15 @@ bash reinstall.sh windows \
- Massgrave
- <https://massgrave.dev/genuine-installation-media.html> (Recommended, iso sourced from official channels, updated monthly, includes the latest patches)
- Microsoft
- <https://www.microsoft.com/software-download/indows8>
- <https://www.microsoft.com/software-download/indows10> (Need to open it with a mobile User-Agent)
- <https://www.microsoft.com/software-download/indows11>
- <https://www.microsoft.com/evalcenter/ownload-windows-10-enterprise>
- <https://www.microsoft.com/evalcenter/ownload-windows-11-enterprise>
- <https://www.microsoft.com/evalcenter/ownload-windows-server-2012-r2>
- <https://www.microsoft.com/evalcenter/ownload-windows-server-2016>
- <https://www.microsoft.com/evalcenter/ownload-windows-server-2019>
- <https://www.microsoft.com/software-download/windows8>
- <https://www.microsoft.com/software-download/windows10> (Need to open it with a mobile User-Agent)
- <https://www.microsoft.com/software-download/windows11>
- <https://www.microsoft.com/evalcenter/download-windows-10-enterprise>
- <https://www.microsoft.com/evalcenter/download-windows-11-enterprise>
- <https://www.microsoft.com/evalcenter/download-windows-11-iot-enterprise-ltsc>
- <https://www.microsoft.com/evalcenter/download-windows-server-2012-r2>
- <https://www.microsoft.com/evalcenter/download-windows-server-2016>
- <https://www.microsoft.com/evalcenter/download-windows-server-2019>
- <https://www.microsoft.com/evalcenter/download-windows-server-2022>
</details>

View File

@ -221,10 +221,12 @@ bash reinstall.sh windows \
- <https://www.microsoft.com/software-download/windows11>
- <https://www.microsoft.com/evalcenter/download-windows-10-enterprise>
- <https://www.microsoft.com/evalcenter/download-windows-11-enterprise>
- <https://www.microsoft.com/evalcenter/download-windows-11-iot-enterprise-ltsc>
- <https://www.microsoft.com/evalcenter/download-windows-server-2012-r2>
- <https://www.microsoft.com/evalcenter/download-windows-server-2016>
- <https://www.microsoft.com/evalcenter/download-windows-server-2019>
- <https://www.microsoft.com/evalcenter/download-windows-server-2022>
- <https://www.microsoft.com/evalcenter/download-windows-server-2025>
</details>

View File

@ -489,7 +489,7 @@ is_have_arm_version() {
11)
case "$edition" in
pro | education | enterprise | 'pro education' | 'pro for workstations') return ;;
'iot enterprise') return ;;
'iot enterprise' | 'iot enterprise subscription') return ;;
'enterprise ltsc 2024' | 'iot enterprise ltsc 2024' | 'iot enterprise ltsc 2024 subscription') return ;;
esac
;;
@ -535,7 +535,7 @@ get_windows_iso_links() {
esac
;;
'2012 r2' | \
2016 | 2019 | 2022)
2016 | 2019 | 2022 | 2025)
case "$edition" in
serverstandard | serverstandardcore) echo _ ;;
serverdatacenter | serverdatacentercore) echo _ ;;
@ -594,7 +594,7 @@ get_windows_iso_links() {
case "$edition" in
home | 'home single language') echo consumer ;;
pro | education | enterprise | 'pro education' | 'pro for workstations') echo business ;;
'iot enterprise') echo 'iot enterprise' ;;
'iot enterprise' | 'iot enterprise subscription') echo 'iot enterprise' ;;
'enterprise ltsc 2024') echo 'enterprise ltsc 2024' ;;
'iot enterprise ltsc 2024' | 'iot enterprise ltsc 2024 subscription') echo 'iot enterprise ltsc 2024' ;;
esac

View File

@ -1304,7 +1304,8 @@ create_part() {
size_bytes=$((7 * 1024 * 1024 * 1024))
fi
# 按iso容量计算分区大小200m用于驱动和文件系统自身占用
# 按iso容量计算分区大小
# 200m 用于驱动/文件系统自身占用 + pagefile (手动 dism 释放镜像时使用)
part_size="$((size_bytes / 1024 / 1024 + 200))MiB"
apk add ntfs-3g-progs

View File

@ -40,8 +40,13 @@ for /f "tokens=2" %%a in ('echo list vol ^| diskpart ^| find "installer"') do (
rem 将 installer 分区设为 Y 盘
(echo select vol %VolIndex% & echo assign letter=Y) | diskpart
rem 设置虚拟内存,好像没必要,安装时会自动在 C 盘设置虚拟内存
rem wpeutil CreatePageFile /path=Y:\pagefile.sys
rem 旧版安装程序会自动在 C 盘设置虚拟内存
rem 新版安装程序(24h2)不会自动设置虚拟内存
rem 在 installer 分区创建虚拟内存,不用白不用
call :createPageFile
rem 查看虚拟内存
rem wmic pagefile
rem 获取主硬盘 id
rem vista pe 没有 wmic因此用 diskpart
@ -107,7 +112,13 @@ rem 运行 X:\setup.exe 的话
rem vista 会找不到安装源
rem server 23h2 会无法运行
rem Y:\setup.exe /emsport:COM1 /emsbaudrate:115200
rem 旧版安装程序
rem Y:\sources\setup.exe
rem 新版安装程序
Y:\setup.exe
exit /b
:sleep
@ -117,3 +128,13 @@ echo wscript.sleep(%~1) > X:\sleep.vbs
cscript //nologo X:\sleep.vbs
del X:\sleep.vbs
exit /b
:createPageFile
rem 尽量填满空间pagefile 默认 64M
for /l %%i in (1, 1, 10) do (
wpeutil CreatePageFile /path=Y:\pagefile%%i.sys 2>nul
if errorlevel 1 (
exit /b
)
)
exit /b