Windows 更新包解析:自解压、安装引擎与补丁 API
附录 A:感知 IPD 的更新包
参考:US 2005/0022175 A1 - 2005 年 1 月 27 日
参考:KB 828030 - 无法查看或提取 Windows 产品更新包中的更新文件
示例:WindowsXP-KB824146-x86-ENU.exe
- 自解压模块:31,744 字节 (SFXCAB 5.3.18.6)
- CAB 文件:1,504,547 字节 (附加 5 字节, crc32 0xFFFFFFFF, 对齐至 0x16F600)
- Authenticode 签名:6,944 字节
- 结构:
_sfx_manifest_<-_sfx_.dll(mspatcha.dll 5.2.9354.0)
示例:WindowsServer2003-KB828035-x86-ENU.exe
- 自解压模块:33,792 字节 (SFXCAB 5.4.1.0)
- CAB 文件:334,195 字节
- Authenticode 签名:6,760 字节
- 结构:
_sfx_manifest_<-_sfx_.dll(mspatcha.dll 5.2.3790.83)
附录 B:自解压压缩文件 (SFX CAB)
注意:CABSDK (Cabinet Software Development Kit)
SFXCAB (Self-Extracting Cabinet)
示例:WindowsXP-KB824105-x86-ENU.exe (参考:2F0rq9sJ)
- SFX 模块:31,744 字节 (SFXCAB 5.3.18.6)
- CAB 文件:307,456 字节
- Authenticode 签名:6,944 字节
- 执行流程:
xpsp1hfm.exe(5.3.0018.6) ->update.exe(5.3.0018.6),spuninst.exe(5.3.0018.6) <-update.inf,updater.ver,KBnnn.cat
示例:Q320206_W2K_SP4_X86_EN.exe
- SFX 模块:23,040 字节 (1.16.118.0)
- CAB 文件:164,884 字节
- Authenticode 签名:6,672 字节
- 执行流程:
update.exe(5.2.0002.2) <-update.inf,updater.ver,Qnnn.cat
示例:Q315000_WXP_SP1_x86_ENU.exe
- SFX 模块:23,040 字节 (1.16.118.0)
- CAB 文件:568,929 字节
- Authenticode 签名:6,760 字节
- 执行流程:
update.exe(5.1.2600.22) <-update.inf,update.ver,sp1.cat
示例:Q249599_W2K_SP1_X86_en.EXE
- SFX 模块:22,016 字节 (1.10.101.0)
- CAB 文件:242,438 字节
- Authenticode 签名:5,142 字节
- 执行流程:
hotfix.exe(5.0.2195.1093) <-hotfix.inf
IExpress:WEXTRACT (Win32 Cabinet Self-Extractor)
示例:274548USA8.EXE,CAB 文件位于 .rsrc/RCDATA/CABINET,运行程序 274548UP.INF + ADVPACK.DLL。
; 使用 rundll32.exe 调用 setupx.dll 的 InstallHinfSection 函数
; InstallHinfSection <节名> <重启模式>
; 高级 INF 包安装程序 (ADVPACK)
rundll32.exe %s,InstallHinfSection %s 128 %s
rundll32.exe %sadvpack.dll,DelNodeRunDLL32 "%s"
注意:IEAK (Internet Explorer Administration Kit)
注意:涉及的 DLL 包括 ADVPACK.DLL, SETUPAPI.DLL, SETUPX.DLL。
附录 C:安装程序引擎
- KB 184305:如何使用 Hotfix.exe 安装和移除热修复
- KB 197147:IExpress 软件更新包的命令行开关
- KB 262841:Windows 软件更新包的命令行开关
- KB 814411:热修复包不包含调试符号文件
- KB 816915:Microsoft Windows 软件更新包的新文件名方案
- 格式:
ProductName-KBArticleNumber-Option-Language.exe,发布于 2003 年 4 月
- 格式:
- KB 824687:Microsoft 软件更新包的命令行开关
- KB 902093:如何读取 Windowsupdate.log 文件 (2005 年版)
- KB 934307:Windows 更新独立安装程序 (wusa.exe) 详解
update.exe 命令行参数
版本 5.1.2600.22 (xpclnt_qfe.010827-1803)
版本 5.3.24.3
/help, /passive, /quiet, /norestart, /forcerestart, /verbose, /extract
版本 5.4.15.0
/forceappsclose, /integrate:path
版本 6.1.22.0
/warnrestart, /promptrestart, /nobackup, /overwriteoem, /log
附录 D:PA19 - PatchAPI
参考:MSDN 链接 1
参考:MSDN 链接 2
头文件:patchapi.h
- 包含于 Windows Platform SDK, Microsoft Installer SDK
DLL:mspatcha.dll
- MS Office 2000, INSTMSI.EXE (1.0.5104.0), mspatcha.dll (1.94.319.0)
- Windows 2000, MSI.DLL (1.10.1029.0), mspatcha.dll (1.94.319.0)
DLL:mspatchc.dll
- Windows Installer 1.0 SDK, MsPatchC.dll (1.94.319.0), MsPatchC.lib, MPatch.exe, APatch.exe
- Windows Installer 1.2 SDK, MsPatchC.dll (1.97.324.0), MsPatchC.lib, MPatch.exe (1.94.319.0), APatch.exe (1.94.319.0)
- Windows Server 2003 SP1 Platform SDK, MsPatchC.dll (5.2.3760.0), MsPatchC.lib
附录 E:PA30 - MSDELTA
参考:MSDN 链接 1
参考:MSDN 链接 2
参考:Vista 操作系统
参考:KB 927374:适用于 Windows XP 和 Windows Server 2003 的 Microsoft 压缩客户端包 1.0
DLL:msdelta.dll
- 版本:6.0.6000.16386 (文件标识:3PQMtVDh)
- 版本:6.0.6001.18000
注意:ApplyDeltaA/W 函数:如果指定的差量是通过 PatchAPI 创建的,并且设置了 DELTA_APPLY_FLAG_ALLOW_PA19 标志,MSDelta 将调用 PatchAPI 来应用该差量。
资源链接
- Every Windows XP "Windows Update" in one download - 2015
- Sunet 镜像存档