标题: 一次升级Intel Wireless Driver的经历 创建: 2006-02-25 23:00 链接: https://scz.617.cn/misc/200602252300.txt 最近用microsoftupdate(不是windowsupdate)在线升级时,检测到"Intel Wireless 2200BG"网卡驱动有一个更新存在,这个更新属于硬件更新,不是安全补丁。我发神 经地选中了它,结果更新失败,错误代码0x01,再无其它信息。升级日志里的帮助再 次玩弄微软惯用把戏,什么先这一步,然后那一步,每一步都是大实话,也是大白话, 整个就是忽悠我来着。上Google搜索没有找到更多有帮助的信息。 我重复在线升级了三次,每次都报同样的错误,而且升级日志里出现了三次失败的记 录。当然后两次升级前,会报告已经下载等待安装,不需要再次去微软站点下载。于 是想到这些升级过程在本地维护有一批文件,我现在只想去删除已下载的更新包,然 后修改相关文件使得在线升级时回复到我第一次选中这个硬件更新之前的状态。这么 做的目的完全出于我变态的完美主义倾向,反正不能升级了,不想每次看见它躺在我 的硬盘上,还每次告诉我升级失败。 当时懒得自己去找这批想像中的文件,就上网去搜索去问它们在哪里,终究等不及现 成答案出现,自己去找了。先在文件夹选项中设置一下,使得可以查看所有文件、系 统文件什么的,省得因这个原因啥也找不到。先去看了两个文件: %systemroot%\setupapi.log %systemroot%\WindowsUpdate.log 看前者是因为安装驱动时会更新这个日志,想从中找到升级失败的原因。看后者是因 为在线升级时会更新这个日志。结果在WindowsUpdate.log中找到这样一些信息: Title = Intel Wireless Driver Update UpdateId = {E16FC4A4-1234-4F37-8A25-CD023945047B}.100 Downloading from http://www.download.windowsupdate.com/msdownload/update/v3-19990518/cabpool/se_setup3_67b2c0a5148e2fa7327b401ea9264e47cb966123.cab to X:\WINDOWS\SoftwareDistribution\Download\S-1-5-18\90ae81579ed9ff7cb0e4a0cd7273b247\67b2c0a5148e2fa7327b401ea9264e47cb966123 (full file). 开始还想手工下载se_setup3_67b2c0a5148e2fa7327b401ea9264e47cb966123.cab,后 来觉得太傻,去找X:\WINDOWS\SoftwareDistribution\Download\S-1-5-18\...,居 然说目录不存在,于是层层回溯,直至定位到%systemroot%\SoftwareDistribution\。 回过头来看: ... ...\S-1-5-18\90ae81579ed9ff7cb0e4a0cd7273b247\67b2c0a5148e2fa7327b401ea9264e47cb966123 S-1-5-18是WellKnownGroup,即"NT AUTHORITY\SYSTEM"。想必根据当前下载进程的 不同身份临时存放在不同SID命名的子目录下。不管了,反正最终找到一个: %systemroot%\SoftwareDistribution\Download\67b2c0a5148e2fa7327b401ea9264e47cb966123 还找到一个日志文件: %systemroot%\SoftwareDistribution\ReportingEvents.log 在这个日志文件中倒是看到稍微详细一点的升级失败说明: Windows failed to install the following update with error 0x80070643: Intel Wireless Driver Update. 用Google搜索0x80070643只找到一些对我这个问题没啥用的东西: How to enable Windows Installer logging http://support.microsoft.com/kb/223300/ You cannot install some updates or programs http://support.microsoft.com/kb/822798/ 看来得换条路走。将67b2c0a5148e2fa7327b401ea9264e47cb966123复制出来并改名为 x.cab,用winrar将之解开,得到一个SE_Setup.exe。双击执行没反应。又双击执行 还是没反应。郁闷了,打开Process Explorer,双击执行SE_Setup.exe,发现还是有 反应的,只不过很快结束了。还好Process Explorer有个Suspend进程的功能,再次 双击执行SE_Setup.exe后将它挂起,注意到它向%temp%\sefFE2E.tmp\目录释放了一 些文件,但当进程结束时这个临时子目录被自动删除了。我现在需要在所有的临时文 件被释放出来后挂起进程,然后复制出这些文件继续研究。 开始想省点事,就用Process Explorer挂起进程,结果挂起的时机不好把握,要么还 没释放完,要么已经被删除了。不得已准备动用一个调试器来拦截删除操作。以前没 拦截过删除操作,猛地有这么一个需求,还真是蛮讨嫌的。 在%temp%下找到一个SE_Setup.log,居然是SE_Setup.exe产生的日志: [SE_Setup.exe(318)] [4]CSEFile::ExtractFirstBlob(): Successfully Extracted. Group=4660, DataSize=4 [SE_Setup.exe(318)] [4]IsDriverInstalledByINF(): Driver Installed By INF [SE_Setup.exe(318)] [4]INF installed=1, MSI install=0 [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Apps\Instmsiw.exe [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Apps\iProData\iconvrtr.exe [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Apps\iProData\mCore.msi [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Apps\iProData\mDriver.msi ... ... [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Apps\iProInst.exe [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Apps\iProInst.ini [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Apps\iProLang\CHS\iProInst.dll ... ... [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Autorun.exe [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Autorun.inf [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Drivers\SetupWLD.EXE [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\Drivers\SetupWLD.ini ... ... [SE_Setup.exe(318)] [4]Successfully Extracted :%temp%\sefFE2E.tmp\verfile.tic [SE_Setup.exe(318)] [4]Launching %temp%\sefFE2E.tmp\Drivers\SetupWld.exe -silent [SE_Setup.exe(318)] [4]Executing:%temp%\sefFE2E.tmp\Drivers\SetupWld.exe, [SE_Setup.exe(318)] [4]Successfully launched: %temp%\sefFE2E.tmp\Drivers\SetupWld.exe -silent [SE_Setup.exe(318)] [4]Drivers\SetupWld.exe returned 1 注意到最后那个返回码是1,想必对应了更新失败错误代码0x01吧。虽然对我没有更 多帮助,总算弄明白了一些事情。从这份日志中看到释放临时文件结束后会执行其中 的一个程序,既然如此,我没有必要拦截删除操作,直接拦截创建进程操作即可。这 次就用cdb.exe吧。 > set _NT_SYMBOL_PATH=... ... > cdb.exe -hd -o SE_Setup.exe 0:000> bp kernel32!CreateProcessW 0:000> g [SE_Setup.exe(30c)] [4]Error in CSEFile::ExtractAllFiles(). Error 32 on CreateFile ntdll!KiFastSystemCallRet: 7c82ed54 c3 ret 0:000> 没想到这样调试执行SE_Setup.exe与双击执行还有区别,这次因其它原因结束进程了, 同时SE_Setup.log也被更新: [SE_Setup.exe(30c)] [4]Error in CSEFile::ExtractAllFiles(). Error 32 on CreateFile 我只好先双击执行SE_Setup.exe,然后立即用Process Explorer挂起进程,然后用调 试器关联上去: > cdb.exe -hd -o -pn SE_Setup.exe 0:002> bp kernel32!CreateProcessW 0:002> g 接下来在Process Explorer中Resume进程,在cdb.exe中可以看到如下输出: [SE_Setup.exe(550)] [4]Successfully Extracted :%temp%\sefC660.tmp\Apps\iProData\mHelp.msi ... ... [SE_Setup.exe(550)] [4]Successfully Extracted :%temp%\sefC660.tmp\verfile.tic [SE_Setup.exe(550)] [4]Launching %temp%\sefC660.tmp\Drivers\SetupWld.exe -silent [SE_Setup.exe(550)] [4]Executing:%temp%\sefC660.tmp\Drivers\SetupWld.exe, [SE_Setup.exe(550)] [4]Successfully launched: %temp%\sefC660.tmp\Drivers\SetupWld.exe -silent [SE_Setup.exe(550)] [4]Drivers\SetupWld.exe returned 1 ntdll!KiFastSystemCallRet: 7c82ed54 c3 ret 0:000> 所设断点没有被命中。换个断点: 0:000> x kernel32!CreateProcess* 77e51052 kernel32!CreateProcessInternalW = 77e423b7 kernel32!CreateProcessA = 77e42382 kernel32!CreateProcessW = 77e45db9 kernel32!CreateProcessInternalA = 我这是Windows 2003 SP1,想必应该拦截kernel32!CreateProcessInternalW。重新 来过,只是换个断点: > cdb.exe -hd -o -pn SE_Setup.exe 0:002> bp kernel32!CreateProcessInternalW 0:002> g [SE_Setup.exe(2b8)] [4]Successfully Extracted :%temp%\sef1F27.tmp\Apps\iProData\mXML.msi ... ... [SE_Setup.exe(2b8)] [4]Successfully Extracted :%temp%\sef1F27.tmp\Drivers\WLDMLRES.DLL [SE_Setup.exe(2b8)] [4]Successfully Extracted :%temp%\sef1F27.tmp\verfile.tic [SE_Setup.exe(2b8)] [4]Launching %temp%\sef1F27.tmp\Drivers\SetupWld.exe -silent [SE_Setup.exe(2b8)] [4]Executing:%temp%\sef1F27.tmp\Drivers\SetupWld.exe, Breakpoint 0 hit kernel32!CreateProcessInternalW: 77e51052 68dc070000 push 0x7dc 0:000> 果然,这次创建进程操作被拦截住了,现在去看%temp%\sef1F27.tmp\目录,最终要 找的新驱动、新应用软件都在里面,赶紧复制出来: > tree.com /F /A . | Autorun.exe | Autorun.inf | verfile.tic | +---Apps | | Instmsiw.exe | | iProInst.bmp | | iProInst.exe | | iProInst.ini | | | +---iProData | | iconvrtr.exe | | mCore.msi | | mDriver.msi | | mDrWiFi.msi | | mEOU.msi | | mGina.msi | | mHelp.msi | | mIWA.msi | | mIWCA.msi | | mLogView.msi | | mMHouse.msi | | mPfMgr.msi | | mPfWiz.msi | | mProSafe.msi | | mSSO.msi | | mToolkit.msi | | mWlsSafe.msi | | mXML.msi | | mZConfig.msi | | verfile.tic | | | \---iProLang | +---CHS | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---CHT | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---DAN | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---DEU | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---ENU | | iProLang.ini | | License.rtf | | | +---ESN | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---FIN | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---FRA | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---ITA | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---JPN | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---KOR | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---NLD | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---NOR | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---PLK | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---PTB | | iProInst.dll | | iProLang.ini | | License.rtf | | | +---RUS | | iProInst.dll | | iProLang.ini | | License.rtf | | | \---SVE | iProInst.dll | iProLang.ini | License.rtf | \---Drivers SetupWLD.EXE SetupWLD.ini verfile.tic W29MLRES.DLL w29n50.sys w29n51.cat w29n51.INF w29n51.sys W29NCPA.DLL WLDMLRES.DLL 那个Autorun.inf内容如下: [autorun] ICON=apps\iProInst.exe OPEN=apps\iProInst.exe 看来实际上就是双击执行Apps\iProInst.exe。当我这样做了之后,得到一个错误提 示"错误-INI文件中未找到OS Section[iProInst.ini]"。于是我打开iProInst.ini, 发现这里面只有Win2K、WinXP,根本就没有2003。试着修改了一下iProInst.ini,企 图欺骗iProInst.exe,未能成功。用UltraEdit简单看了看iProInst.exe,想必应该 是二进制文件中就有限制,不是简单修改iProInst.ini就可以得逞的。双击直接执行 那堆.msi文件,报告说必须用iProInst.exe安装,靠,反正是应用软件,不装也罢。 至于新驱动么,好办,右键选中相应的无线网卡,更新驱动,从磁盘安装即可。我原 来那个驱动是2004年3月8日的8.0.12.20000版,好老,这次来自微软更新包的是2005 年4月29日的9.0.2.25版。 用Google搜索"iProInst.ini",发现一堆人在问执行iProInst.exe或Autorun.exe时 碰上前述提示,怎么办,也有人在问如何修改iProInst.ini,但都没有正面回答。倒 是有个人问了之后,自问自答说他直接去Intel的站点下载了相应网卡的最新驱动, 手工升级成功了。于是我也去Intel站点看了看,发现我这款网卡驱动还有一个更新 的2006年1月17日的9.0.4.8版: ftp://aiedownload.intel.com/df-support/10112/ENG/Intel(R)PROSetWirelessSoftwareVer9.0.4.exe 下载回来,再次更新网卡驱动成功。但仍无法执行iProInst.exe。从Google搜索结果 以及Intel的介绍看,这款网卡驱动本来就没有提供2003版的,但XP版的用于2003也 可以。 Intel提供给微软的是一个打包处理过的SE_Setup.exe,它会先安装应用软件再安装 驱动,结果安装应用软件时因操作系统版本不对而失败,从而根本没有机会安装驱动。 我手工删除了%systemroot%\SoftwareDistribution\Download\67b2...。停止自动升 级服务(net stop wuauserv),手工编辑ReportingEvents.log,删除其中关于这个硬 件更新的条目。再次用microsoftupdate在线升级,不再提示有硬件更新存在了。 妈的,回过来想想,这整个过程很不爽。先是微软更新失败后显示在WWW页面上的错 误信息太少,为什么不能将%systemroot%\WindowsUpdate.log中的信息在WWW界面上 显示一些呢。其次Intel提供的这个SE_Setup.exe既然只官方支持2000、XP,为什么 会出现在2003的更新列表里,是Intel的错还是微软的错,肯定没测试过嘛。无论哪 家出问题,都应该尽可能有帮助地提供信息,微软神经病一样地临时展开、临时执行、 过后删除,谁他妈的知道到底本来是什么程序出了什么错啊,一个错误代码0x01有个 鬼用。最后,既然有9.0.4.8版了,为什么Intel不向微软提供更新版本。都有病。 记录备忘,希望对某些碰上类似问题的人有点帮助。