IsaacZ 发表于 2019-1-15 19:17:23

installl.esd修改方法简谈

ESD格式简介

  ESD是一种高度压缩的映像文件格式,可以称为一键重置映像,其不能被装载和处理,要更新映像,请处理 .wim 文件,然后重新转换该文件。如果你的部署过程需要在每台单独的电脑上更新一键重置映像,你应该继续使用采用标准压缩的 .wim 文件格式。 使用这些映像时,完成 一键重置 过程所需的时间更长,毕竟压缩率更高。可以使用dism /export-image命令/Compress参数的recovery选项导出 一键重置 映像。生成的文件显著缩小,磁盘空间占用更小,必须使用 .esd 扩展名指定目标文件。

参见微软Technet网站

先来看看install.esd里面都有哪些东西?

命令:
pushd F:\8.1China    (install.esd所在目录)
dism /get-wiminfo /wimfile:install.esd

索引: 1
名称: Windows Setup Media
描述: Windows Setup Media
大小: 468,527,657 个字节

索引: 2
名称: Microsoft Windows PE (x64)
描述: Microsoft Windows PE (x64)
大小: 1,522,371,241 个字节

索引: 3
名称: Microsoft Windows Setup (x64)
描述: Microsoft Windows Setup (x64)
大小: 1,622,050,530 个字节

索引: 4
名称: Windows 8.1 China
描述: Windows 8.1 China
大小: 12,801,197,097 个字节

从上面可以看出,微软的install.esd包含四个索引,第四个才是Windows 8.1中文版

再来简单看一下文件内容

命令:
dism /list-image /imagefile:install.esd /index:1

\
\autorun.inf
\bootmgr
\bootmgr.efi
\MediaMeta.xml
\setup.exe
\boot\
……略
\efi\
……略
\sources\
……略
\support\
……略

再依次看完其它几个索引,嗯,是不是觉得这个esd看起来有点像个完整的安装光盘哈,有兴趣的可以研究下~

提取Windows 8.1 China

  众所周知,esd文件不支持Mount-wim及Mount-image命令,连微软都这么说,既然不让直接改,我们就绕着走。创建一个vhdx虚拟硬盘,将索引4应用到该盘再重新捕获为wim不就结了,这样做会导致部分文件夹及文件(比如Windows)的创建时间发生变化,不过exe和dll等绝大部分还是原来的创建时间,install.wim的大小和网上8.1China光盘中的大小几乎相同。经vhdx安装实机测试,提取出来的wim安装的系统和原映像安装的看不出有什么区别(相当于裸机测试)。

  右击桌面的这台电脑、管理、磁盘管理,在这里创建一个9G的vhdx虚拟硬盘,初始化并格式化,让其显示在这台电脑中,应用8.1 China至少需要7.24G磁盘空间,所以创建的虚拟硬盘必须大于这个值,否则会应用失败。

命令:
应用dism /apply-image /imagefile:install.esd /index:4 /applydir:X:\
捕获dism /capture-image /imagefile:install.wim /capturedir:X:\ /descriptition:"Windows 8.1 China" /name:"Windows 8.1 China" /compress:max /verify /checkintegrity

esd转换及合并

将wim重新转为esd格式
dism /export-image /sourceimagefile:install.wim /sourceindex:1 /destinationimagefile:install.esd /compress:recovery /checkintegrity

wim合并到esd
dism /export-image /sourceimagefile:install.wim /sourceindex:1 /destinationimagefile:install.esd /compress:recovery /checkintegrity

esd合并到esd
dism /export-image /sourceimagefile:install.esd /sourceindex:1 /destinationimagefile:install.esd /compress:recovery /checkintegrity

比如要将一个包含核心版和专业版的install.wim转换为install.esd,假设有两个索引

dism /export-image /sourceimagefile:install.wim /sourceindex:1 /destinationimagefile:install.esd /compress:recovery /checkintegrity
dism /export-image /sourceimagefile:install.wim /sourceindex:2 /destinationimagefile:install.esd /compress:recovery /checkintegrity

转换后的install.esd仍然包括两个索引。说白了,输出文件不变就可以了。

话说,esd支持这么多操作,就是不能Mount,怎么感觉微软在故意限制着,还是说目前没有找到方法……


转贴自:http://bbs.pcbeta.com/viewthread-1488433-1-1.html

511747971 发表于 2019-1-16 16:22:49

:(这个学习哈,感谢楼主分享!
页: [1]
查看完整版本: installl.esd修改方法简谈