WINPE的技术档案中申明在WINPE中不支持MSI安装包,这限制了WINPE的功能,如何让WINPE如同WINXP一样可以安装MSI安装程序呢?经过一天时间的研究,终于搞定。
这里说说明下为什么要增加找个功能,其实很简单,现在很多软件需要VC2005/VC2009运行库支持包,如绿色QQ2009,OFFICE2007,UGNX6等都需要这些共同的基础包,如果没有这些基础包,那么程序就根本无法打开,提示是不是正确的应用程序。
经过我测试,在WINPE中增加MSI安装包后大多数小型MSI程序都可以安装成功。有些大型MSI包因为额外需要其他系统文件支持,所以无法安装成功。另外,非常注意的是VC支持包必须在压缩包中安装,我也非常郁闷,否则提示插入磁盘,经过多次测试,才发现如果直接点击MSI安装的话,会在临时目录自动生成另外一个名称的MSI程序,而在压缩包中则不会在临时文件夹产生多余的MSI安装包,估计是MSI无法调用新生成的MSI包造成的。
下面是制作方法:复制系统中的MSI.DLL和msiexec.exe文件到WINPE的SYSTEM32目录,然后运行下面的批处理代码即可,别小看这两行代码,第一行注册DLL文件,自动生成CLSID,第二行自动生成系统服务项- regsvr32.exe /s msi.dll
- msiexec.exe /regserver
复制代码 安装包我已经制作好,点击下载此文件
下面是国外一些朋友通过读写注册表实现的INF文件内容,效果是一样的。- [Version]
- Signature= "$Windows NT$"
- ;msiService.inf
- ;Created by yahooUK
- [PEBuilder]
- Name="Windows Installer Service"
- Enable=1
- [SourceDisksFiles]
- msi.dll=2
- msiexec.exe=2
- msihnd.dll=2
- msimsg.dll=2
- msisip.dll=2
- ieinfo5.ocx=2
- msimain.sdb=60
- [Software.AddReg]
- ; Sherpya RegExpander
- 0x7,"Sherpya\RegExpander\HKLM","SYSTEM\ControlSet001\Services\MSIServer","ImagePath"
- 0x0, "Classes\MSILink"
- 0x0, "Classes\MSILink\shellex"
- 0x0, "Classes\MSILink\shellex\ContextMenuHandlers"
- 0x1, "Classes\MSILink\shellex\ContextMenuHandlers\{a2a9545d-a0c2-42b4-9708-a0b2badd77c8}","@","Start Menu Pin"
- 0x1, "Classes\CLSID\{000C101C-0000-0000-C000-000000000046}","","Msi install server"
- 0x1, "Classes\CLSID\{000C101C-0000-0000-C000-000000000046}","AppId","{000C101C-0000-0000-C000-000000000046}"
- 0x1, "Classes\CLSID\{000C101C-0000-0000-C000-000000000046}\ProgId","","IMsiServer"
- 0x1, "Classes\CLSID\{000C103E-0000-0000-C000-000000000046}","","PSFactoryBuffer"
- 0x2, "Classes\CLSID\{000C103E-0000-0000-C000-000000000046}\InProcServer32","","msi.dll"
- 0x1, "Classes\CLSID\{000C103E-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel","Both"
- 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}","","Microsoft Windows Installer"
- 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\InprocHandler32","","ole32.dll"
- 0x2, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\InprocServer32","","msi.dll"
- 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\InprocServer32","ThreadingModel","Apartment"
- 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\ProgId","","WindowsInstaller.Installer"
- 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\TypeLib","","{000C1092-0000-0000-C000-000000000046}"
- 0x1, "Classes\CLSID\{000C1094-0000-0000-C000-000000000046}","",""
- 0x2, "Classes\CLSID\{000C1094-0000-0000-C000-000000000046}\InprocServer32","","msi.dll"
- 0x1, "Classes\CLSID\{000C1094-0000-0000-C000-000000000046}\InprocServer32","ThreadingModel","Apartment"
- 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}","","GenerateMSI Class"
- 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}\InprocServer32","","catsrvut.dll"
- 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}\InprocServer32","ThreadingModel","both"
- 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}\ProgID","","MSIGen.GenerateMSI.1"
- 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}\VersionIndependentProgID","","MSIGen.GenerateMSI"
- 0x1, "Classes\.msi","","Msi.Package"
- 0x1, "Classes\.msp","","Msi.Patch"
- 0x3, "Classes\Msi.Package","EditFlags",\
- 00,00,10,00
- 0x2, "Classes\Msi.Package","FriendlyTypeName","@msi.dll,-34"
- 0x1, "Classes\Msi.Package","","Windows Installer Package"
- 0x2, "Classes\Msi.Package\DefaultIcon","","msiexec.exe,0"
- 0x1, "Classes\Msi.Package\shell","","Open,Repair,Uninstall"
- 0x1, "Classes\Msi.Package\shell\Open","","&Install"
- 0x2, "Classes\Msi.Package\shell\Open","MUIVerb","@msi.dll,-36"
- 0x2, "Classes\Msi.Package\shell\Open\command","","""msiexec.exe"" /i ""%1"" %*"
- 0x1, "Classes\Msi.Package\shell\Repair","","Re&pair"
- 0x2, "Classes\Msi.Package\shell\Repair","MUIVerb","@msi.dll,-37"
- 0x2, "Classes\Msi.Package\shell\Repair\command","","""msiexec.exe"" /f ""%1"" %*"
- 0x1, "Classes\Msi.Package\shell\Uninstall","","&Uninstall"
- 0x2, "Classes\Msi.Package\shell\Uninstall","MUIVerb","@msi.dll,-38"
- 0x2, "Classes\Msi.Package\shell\Uninstall\command","","""msiexec.exe"" /x ""%1"" %*"
- 0x1, "Classes\Msi.Patch","","Windows Installer Patch"
- 0x3, "Classes\Msi.Patch","EditFlags",\
- 00,00,10,00
- 0x2, "Classes\Msi.Patch","FriendlyTypeName","@msi.dll,-35"
- 0x2, "Classes\Msi.Patch\DefaultIcon","","msiexec.exe,0"
- 0x1, "Classes\Msi.Patch\shell","","Open"
- 0x1, "Classes\Msi.Patch\shell\Open","","&Apply Patch"
- 0x2, "Classes\Msi.Patch\shell\Open","MUIVerb","@msi.dll,-39"
- 0x2, "Classes\Msi.Patch\shell\Open\command","","""msiexec.exe"" /p ""%1"" %*"
- 0x1, "Classes\Applications\msiexec.exe","NoOpenWith",""
- 0x1, "Classes\AppID\{000C101C-0000-0000-C000-000000000046}","ServiceParameters",""
- 0x1, "Classes\AppID\{000C101C-0000-0000-C000-000000000046}","LocalService","MSIServer"
- 0x1, "Classes\Interface\{000C101C-0000-0000-C000-000000000046}","","IMsiServer"
- 0x1, "Classes\Interface\{000C101C-0000-0000-C000-000000000046}\NumMethods","","18"
- 0x1, "Classes\Interface\{000C101C-0000-0000-C000-000000000046}\ProxyStubClsid32","","{000C103E-0000-0000-C000-000000000046}"
- 0x1, "Classes\IMsiServer","","Msi install server"
- 0x1, "Classes\IMsiServer\CLSID","","{000C101C-0000-0000-C000-000000000046}"
- 0x1, "Classes\Interface\{000C1033-0000-0000-C000-000000000046}","","IMsiRemoteAPI"
- 0x1, "Classes\Interface\{000C1033-0000-0000-C000-000000000046}\NumMethods","","58"
- 0x1, "Classes\Interface\{000C1033-0000-0000-C000-000000000046}\ProxyStubClsid32","","{000C103E-0000-0000-C000-000000000046}"
- [SetupReg.AddReg]
- 0x4, "ControlSet001\Enum\Root\LEGACY_MSISERVER","NextInstance", 0x00000001
- 0x1, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","Service","MSIServer"
- 0x4, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","Legacy", 0x00000001
- 0x4, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","ConfigFlags", 0x00000000
- 0x1, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","Class","LegacyDriver"
- 0x1, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","ClassGUID","{8ECC055D-047F-11D1-A537-0000F8753ED1}"
- 0x1, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","DeviceDesc","Windows Installer"
- 0x1, "ControlSet001\Services\MSIServer","Description","Adds, modifies, and removes applications provided as a Windows Installer (*.msi) package. If this service is disabled, any services that explicitly depend on it will fail to start."
- 0x4, "ControlSet001\Services\MSIServer","Type", 0x00000020
- ;0x4, "ControlSet001\Services\MSIServer","Start", 0x00000003
- 0x4, "ControlSet001\Services\MSIServer","Start", 0x00000002
- 0x4, "ControlSet001\Services\MSIServer","ErrorControl", 0x00000001
- 0x2, "ControlSet001\Services\MSIServer","ImagePath","msiexec.exe /V"
- 0x1, "ControlSet001\Services\MSIServer","DisplayName","Windows Installer"
- 0x7, "ControlSet001\Services\MSIServer","DependOnService","RpcSs"
- 0x7, "ControlSet001\Services\MSIServer","DependOnGroup"
- 0x1, "ControlSet001\Services\MSIServer","ObjectName","LocalSystem"
- 0x3, "ControlSet001\Services\MSIServer\Security","Security",\
- 01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
- 00,1C,00,01,00,00,00,02,80,14,00,FF,01,0F,00,01,01,00,00,00,00,00,01,00,00,\
- 00,00,02,00,60,00,04,00,00,00,00,00,14,00,FD,01,02,00,01,01,00,00,00,00,00,\
- 05,12,00,00,00,00,00,18,00,FF,01,0F,00,01,02,00,00,00,00,00,05,20,00,00,00,\
- 20,02,00,00,00,00,14,00,8D,01,02,00,01,01,00,00,00,00,00,05,0B,00,00,00,00,\
- 00,18,00,FD,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
- 00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
- 0x0,"Setup\AllowStart\MSISERVER"
复制代码 原创网址:鸿越软件http://xbdsoft.kmip.net/blogedit.asp?id=90 |