打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
利用Dism向Win7映像内添加驱动 | 大D综合研究院 | 简单易懂的现代魔法|Build my ...

背景

HX的Z总最近搞了一台imac me088ch/a,坑爹的上家将MAC OS删除之后安装了个Windows,发货到手之后,遭遇蓝屏。。

结果大D当时正好在HX,被逮了个正着。。。。

又赶上坑爹的远程恢复时间巨长。。

Dism简介

进入NT6.0之后,Windows开始采用映像的方式进行安装,使其可定制性以及安装速度都有一定的提高。

安装映像后缀名为.wim,通常位于安装光盘的sources目录下。

通常情况下,安装补丁、安装驱动等操作一般都是安装好操作系统,进入桌面后进行的操作,但是也会遇到一些情况,比如磁盘控制器、USB3.0的驱动没有被Win7集成,且机身上没有USB2.0的接口。

这种情况下,微软提供了一个名为Deployment Image Servicing and Management(DISM,部署镜像服务和管理工具)。

部署映像服务和管理 (DISM.exe) 是一个命令行工具,可用于处理 Windows(R) 映像或准备 Windows 预安装环境 (Windows PE) 映像。DISM 可用于处理 Windows 映像 (.wim) 文件或虚拟硬盘驱动器(.vhd 或 .vhdx)。

可以使用 DISM 执行下列操作:

  • 添加、删除和枚举程序包。
  • 添加、删除和枚举驱动程序。
  • 启用或禁用 Windows 功能。
  • 应用基于 Unattend.xml 答案文件的 offlineServicing 部分的更改。
  • 配置国际设置。
  • 将 Windows 映像升级到其他版本。
  • 准备 Windows PE 3.0 映像。
  • 利用更好的日志记录。
  • 处理早期版本的 Windows,如 Windows Vista SP2、带 SP1 的 Windows Vista 和 Windows Server 2008。
  • 处理所有的平台(32 位、64 位和 Itanium)。
  • 处理 64 位主机中的 32 位映像,以及处理 32 位主机中的 64 位映像。
  • 使用旧的程序包管理器脚本。

注意,Dism的操作需要在Win 7及以上操作系统上操作。

向Win7映像添加USB3.0以及磁盘控制器驱动

这里以在无mac os的imac me088ch/a上安装Win7为例。(imac用户遭遇类似情况又暂时不想使用远程恢复的可以参考本节

这一步开始前,需要准备以下文件:

准备工作

这一步是面向使用Windows 7安装光盘制作安装U盘的。

将上面下载到的dism工具解压缩到G:\Temp文件夹下。

将上面下载到的USB3.0驱动打开,单独解压压缩文件中的Drivers目录到G:\Temp\Drv目录下。

将磁盘控制器驱动解压到G:\Temp\Drv\SATA目录下。

一定要注意存放SATA驱动的文件夹名。

以管理员身份运行命令提示符。

处理boot.wim

首先在Temp文件夹下新建挂载文件夹image,再在image文件夹下新建boot文件夹用于挂载boot.wim。

在命令提示符输入:

1
2
cd /d g:\Temp\DISM_6.1.7600.16385_x86
dism /mount-wim /wimfile:g:\Temp\boot.wim /index:2 /mountdir:g:\Temp\image\boot

随后:

1
2
3
4
5
6
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Mounting image
[==========================100.0%==========================]
The operation completed successfully.

表示挂载完成。

向boot.wim添加USB3.0驱动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\boot /add-driver:g:\temp\drv\Drivers\HCSwitch\x64\iusb3hcs.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\Drivers\HCSwitch\x64\iusb3hcs.inf: 驱动程序包已成功安装。
The operation completed successfully.
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\boot /add-driver:g:\temp\drv\Drivers\Win7\x64\iusb3hub.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\Drivers\Win7\x64\iusb3hub.inf: 驱动程序包已成功安装。
The operation completed successfully.
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\boot /add-driver:g:\temp\drv\Drivers\Win7\x64\iusb3xhc.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\Drivers\Win7\x64\iusb3xhc.inf: 驱动程序包已成功安装。
The operation completed successfully.

向boot.wim添加磁盘控制器驱动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\boot /add-driver:g:\temp\drv\SATA\iaahcic.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\SATA\iaahcic.inf: 驱动程序包已成功安装。
The operation completed successfully.
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\boot /add-driver:g:\temp\drv\SATA\iastorac.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\SATA\iastorac.inf: 驱动程序包已成功安装。
The operation completed successfully.

查看已添加第三方驱动程序:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\boot /get-drivers
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
正在从驱动程序存储中获得第三方驱动程序列表...
驱动程序包列表:
已发布的名称 : oem0.inf
原始文件名 : iusb3hcs.inf
内置驱动程序 :
类名称 : System
提供程序名称 : 英特尔
日期 : 2014/8/8
版本 : 3.0.1.41
已发布的名称 : oem1.inf
原始文件名 : iusb3hub.inf
内置驱动程序 :
类名称 : USB
提供程序名称 : Intel(R) Corporation
日期 : 2014/8/8
版本 : 3.0.1.41
已发布的名称 : oem2.inf
原始文件名 : iusb3xhc.inf
内置驱动程序 :
类名称 : USB
提供程序名称 : Intel(R) Corporation
日期 : 2014/8/8
版本 : 3.0.1.41
已发布的名称 : oem3.inf
原始文件名 : iaahcic.inf
内置驱动程序 :
类名称 : HDC
提供程序名称 : Intel Corporation
日期 : 2014/7/25
版本 : 13.2.4.1000
已发布的名称 : oem4.inf
原始文件名 : iastorac.inf
内置驱动程序 :
类名称 : SCSIAdapter
提供程序名称 : Intel Corporation
日期 : 2014/7/25
版本 : 13.2.4.1000
The operation completed successfully.
g:\Temp\DISM_6.1.7600.16385_x86>

保存并卸载映像。

1
2
3
4
5
6
7
8
9
10
11
12
g:\Temp\DISM_6.1.7600.16385_x86>dism /unmount-wim /mountdir:g:\temp\image\boot /commit
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image File : g:\Temp\boot.wim
Image Index : 2
Saving image
[==========================100.0%==========================]
Unmounting image
[==========================100.0%==========================]
The operation completed successfully.

向install.wim添加驱动

挂载install.wim到g:\Temp\image\win7,照例先新建win7文件夹。

1
2
3
4
5
6
7
8
g:\Temp\DISM_6.1.7600.16385_x86>dism /mount-wim /wimfile:g:\temp\install.wim /index:4 /mountdir:g:\temp\image\win7
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Mounting image
[==========================100.0%==========================]
The operation completed successfully.

向install.wim添加usb3.0驱动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\win7 /add-driver /driver:g:\temp\drv\Drivers\HCSwitch\x64\iusb3hcs.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\Drivers\HCSwitch\x64\iusb3hcs.inf: 驱动程序包已成功安装。
The operation completed successfully.
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\win7 /add-driver /driver:g:\temp\drv\Drivers\Win7\x64\iusb3hub.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\Drivers\Win7\x64\iusb3hub.inf: 驱动程序包已成功安装。
The operation completed successfully.
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\win7 /add-driver /driver:g:\temp\drv\Drivers\Win7\x64\iusb3xhc.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\Drivers\Win7\x64\iusb3xhc.inf: 驱动程序包已成功安装。
The operation completed successfully.

向install.wim添加磁盘控制器驱动。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\win7 /add-driver /driver:g:\temp\drv\sata\iaahcic.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\sata\iaahcic.inf: 驱动程序包已成功安装。
The operation completed successfully.
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\win7 /add-driver /driver:g:\temp\drv\sata\iastorac.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\sata\iastorac.inf: 驱动程序包已成功安装。

保存并卸载映像。

1
2
3
4
5
6
7
8
9
10
11
12
g:\Temp\DISM_6.1.7600.16385_x86>dism /unmount-wim /mountdir:g:\temp\image\win7 /commit
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image File : g:\temp\install.wim
Image Index : 4
Saving image
[==========================100.0%==========================]
Unmounting image
[==========================100.0%==========================]
The operation completed successfully.

完成后就可以将boot.wim和install.wim复制掩盖到USB启动盘,也可以使用Winpe进行安装了。

有可能遇到的问题

如果遇到如下的情况:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
g:\Temp\DISM_6.1.7600.16385_x86>dism /image:g:\temp\image\win7 /add-driver /driver:g:\temp\drv\sata\
iaahcic.inf
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
找到 1 个要安装的驱动程序包。
正在安装第 1 个,共有 1 - g:\temp\drv\sata\iaahcic.inf: 错误 - 发生错误。无法安装驱动程序包。
有关详细信息,请检查目标映像的 windir>\inf 文件夹中的日志文件。
Error: 5
拒绝访问。
The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

则有可能是Windows将文件锁定了,需要在驱动文件上右键,属性,解除锁定。

 

小贴士

如何使用dism直接在Win8/8.1下安装.Net Framework 3.5

.Net Framework 3.5、4都是Win8的系统组件之一,直接通过离线包安装会遇到问题。通过添加程序安装则需要下载,如果手里有Win8/8.1的映像,可以通过dism进行安装。

假设Win8/8.1 ISO加载在X:(光驱插入光盘或者虚拟光驱)

1
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:x:\sources\sxs

/source参数指定路径,将Win8的ISO解压缩然后路径输入上去也OK。

最后说明,要用管理员身份运行。

 

版权声明
转载保留版权: 大D综合研究院 | 《利用Dism向Win7映像内添加驱动》
本文链接地址:https://www.dadclab.com/archives/4987.jiecao
本文版权采取:BY-NC-SA 协议进行授权,除特别标注,本站所有文章均为原创。
转载须知:如果您需要转载本文,请将版权信息,版权授权方式,以及本文的链接地址注明,多谢合作。
本文被贴上了: , , 标签
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
解决B150主板安装win7操作系统USB设备无法读取故障
新Macbook 安装WIN7 失败 的USB 3.0驱动问题
Macbook Air 2013 Bootcamp Win7 安装卡死的解决方法(MD711 MD712 MD760 MD761)
为Win7PE增加驱动支持
win7 x64系统 添加nvme ssd补丁,xhci驱动
WIN8.1补丁更新失败的解决办法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服