Skip to content

Commit

Permalink
windows: 支持 install.esd
Browse files Browse the repository at this point in the history
fixes: #196
  • Loading branch information
bin456789 committed Nov 7, 2024
1 parent 5e9cc84 commit 66136ad
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions trans.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4059,10 +4059,11 @@ install_windows() {

if [ -e /iso/sources/install.esd ]; then
iso_install_wim=/iso/sources/install.esd
install_wim=/os/installer/sources/install.esd
else
iso_install_wim=/iso/sources/install.wim
install_wim=/os/installer/sources/install.wim
fi
install_wim=/os/installer/sources/install.wim

# 匹配映像版本
# 需要整行匹配,因为要区分 Windows 10 Pro 和 Windows 10 Pro for Workstations
Expand Down Expand Up @@ -4171,23 +4172,24 @@ install_windows() {
rsync -rv \
--exclude=/sources/boot.wim \
--exclude=/sources/install.wim \
--exclude=/sources/install.esd \
/iso/* /os/installer/
else
(
cd /iso
find . -type f \
-not -name boot.wim \
-not -name install.wim \
-not -name install.esd \
-exec cp -r --parents {} /os/installer/ \;
)
fi

# 优化 install.wim
# 优点1: 可以节省 200M~600M 空间,用来创建虚拟内存
# (意义不大,因为已经删除了 boot.wim 用来创建虚拟内存)
# 优点2: 可以将 esd 转为 wim,但要提前预留更多空间
# 优点: 可以节省 200M~600M 空间,用来创建虚拟内存
# (意义不大,因为已经删除了 boot.wim 用来创建虚拟内存,vista 除外)
# 缺点: 如果 install.wim 只有一个镜像,则只能缩小 10M+
if false; then
if true; then
time wimexport --threads "$(get_build_threads 512)" "$iso_install_wim" "$image_name" "$install_wim"
echo "Original: $(get_filesize_mb "$iso_install_wim")"
echo "Optimized: $(get_filesize_mb "$install_wim")"
Expand Down Expand Up @@ -4777,8 +4779,7 @@ install_windows() {
# windows 7 没有 invoke-webrequest
# installer分区盘符不一定是D盘
# 所以复制 resize.bat 到 install.wim
# TODO: 由于esd文件无法修改,要将resize.bat放到boot.wim
if [[ "$install_wim" = '*.wim' ]]; then
if true; then
info "mount install.wim"
wimmountrw $install_wim "$image_name" /wim/
if false; then
Expand Down

0 comments on commit 66136ad

Please sign in to comment.