无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 13119|回复: 16
打印 上一主题 下一主题

为WINPE插上MSI的翅膀

[复制链接]
跳转到指定楼层
1#
发表于 2009-6-12 15:52:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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,第二行自动生成系统服务项
  1. regsvr32.exe /s msi.dll
  2. msiexec.exe /regserver
复制代码
安装包我已经制作好,点击下载此文件

    下面是国外一些朋友通过读写注册表实现的INF文件内容,效果是一样的。
  1. [Version]
  2. Signature= "$Windows NT$"

  3. ;msiService.inf
  4. ;Created by yahooUK

  5. [PEBuilder]
  6. Name="Windows Installer Service"
  7. Enable=1

  8. [SourceDisksFiles]
  9. msi.dll=2
  10. msiexec.exe=2
  11. msihnd.dll=2
  12. msimsg.dll=2
  13. msisip.dll=2
  14. ieinfo5.ocx=2
  15. msimain.sdb=60

  16. [Software.AddReg]
  17. ; Sherpya RegExpander
  18. 0x7,"Sherpya\RegExpander\HKLM","SYSTEM\ControlSet001\Services\MSIServer","ImagePath"

  19. 0x0, "Classes\MSILink"
  20. 0x0, "Classes\MSILink\shellex"
  21. 0x0, "Classes\MSILink\shellex\ContextMenuHandlers"
  22. 0x1, "Classes\MSILink\shellex\ContextMenuHandlers\{a2a9545d-a0c2-42b4-9708-a0b2badd77c8}","@","Start Menu Pin"

  23. 0x1, "Classes\CLSID\{000C101C-0000-0000-C000-000000000046}","","Msi install server"
  24. 0x1, "Classes\CLSID\{000C101C-0000-0000-C000-000000000046}","AppId","{000C101C-0000-0000-C000-000000000046}"
  25. 0x1, "Classes\CLSID\{000C101C-0000-0000-C000-000000000046}\ProgId","","IMsiServer"

  26. 0x1, "Classes\CLSID\{000C103E-0000-0000-C000-000000000046}","","PSFactoryBuffer"
  27. 0x2, "Classes\CLSID\{000C103E-0000-0000-C000-000000000046}\InProcServer32","","msi.dll"
  28. 0x1, "Classes\CLSID\{000C103E-0000-0000-C000-000000000046}\InProcServer32","ThreadingModel","Both"

  29. 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}","","Microsoft Windows Installer"
  30. 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\InprocHandler32","","ole32.dll"
  31. 0x2, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\InprocServer32","","msi.dll"
  32. 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\InprocServer32","ThreadingModel","Apartment"
  33. 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\ProgId","","WindowsInstaller.Installer"
  34. 0x1, "Classes\CLSID\{000C1090-0000-0000-C000-000000000046}\TypeLib","","{000C1092-0000-0000-C000-000000000046}"

  35. 0x1, "Classes\CLSID\{000C1094-0000-0000-C000-000000000046}","",""
  36. 0x2, "Classes\CLSID\{000C1094-0000-0000-C000-000000000046}\InprocServer32","","msi.dll"
  37. 0x1, "Classes\CLSID\{000C1094-0000-0000-C000-000000000046}\InprocServer32","ThreadingModel","Apartment"

  38. 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}","","GenerateMSI Class"
  39. 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}\InprocServer32","","catsrvut.dll"
  40. 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}\InprocServer32","ThreadingModel","both"
  41. 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}\ProgID","","MSIGen.GenerateMSI.1"
  42. 0x1, "Classes\CLSID\{298942A3-C0FE-11D1-8D87-0060088F38C8}\VersionIndependentProgID","","MSIGen.GenerateMSI"

  43. 0x1, "Classes\.msi","","Msi.Package"
  44. 0x1, "Classes\.msp","","Msi.Patch"

  45. 0x3, "Classes\Msi.Package","EditFlags",\
  46. 00,00,10,00
  47. 0x2, "Classes\Msi.Package","FriendlyTypeName","@msi.dll,-34"
  48. 0x1, "Classes\Msi.Package","","Windows Installer Package"
  49. 0x2, "Classes\Msi.Package\DefaultIcon","","msiexec.exe,0"
  50. 0x1, "Classes\Msi.Package\shell","","Open,Repair,Uninstall"
  51. 0x1, "Classes\Msi.Package\shell\Open","","&Install"
  52. 0x2, "Classes\Msi.Package\shell\Open","MUIVerb","@msi.dll,-36"
  53. 0x2, "Classes\Msi.Package\shell\Open\command","","""msiexec.exe"" /i ""%1"" %*"
  54. 0x1, "Classes\Msi.Package\shell\Repair","","Re&pair"
  55. 0x2, "Classes\Msi.Package\shell\Repair","MUIVerb","@msi.dll,-37"
  56. 0x2, "Classes\Msi.Package\shell\Repair\command","","""msiexec.exe"" /f ""%1"" %*"
  57. 0x1, "Classes\Msi.Package\shell\Uninstall","","&Uninstall"
  58. 0x2, "Classes\Msi.Package\shell\Uninstall","MUIVerb","@msi.dll,-38"
  59. 0x2, "Classes\Msi.Package\shell\Uninstall\command","","""msiexec.exe"" /x ""%1"" %*"

  60. 0x1, "Classes\Msi.Patch","","Windows Installer Patch"
  61. 0x3, "Classes\Msi.Patch","EditFlags",\
  62. 00,00,10,00
  63. 0x2, "Classes\Msi.Patch","FriendlyTypeName","@msi.dll,-35"
  64. 0x2, "Classes\Msi.Patch\DefaultIcon","","msiexec.exe,0"
  65. 0x1, "Classes\Msi.Patch\shell","","Open"
  66. 0x1, "Classes\Msi.Patch\shell\Open","","&Apply Patch"
  67. 0x2, "Classes\Msi.Patch\shell\Open","MUIVerb","@msi.dll,-39"
  68. 0x2, "Classes\Msi.Patch\shell\Open\command","","""msiexec.exe"" /p ""%1"" %*"

  69. 0x1, "Classes\Applications\msiexec.exe","NoOpenWith",""

  70. 0x1, "Classes\AppID\{000C101C-0000-0000-C000-000000000046}","ServiceParameters",""
  71. 0x1, "Classes\AppID\{000C101C-0000-0000-C000-000000000046}","LocalService","MSIServer"

  72. 0x1, "Classes\Interface\{000C101C-0000-0000-C000-000000000046}","","IMsiServer"
  73. 0x1, "Classes\Interface\{000C101C-0000-0000-C000-000000000046}\NumMethods","","18"
  74. 0x1, "Classes\Interface\{000C101C-0000-0000-C000-000000000046}\ProxyStubClsid32","","{000C103E-0000-0000-C000-000000000046}"

  75. 0x1, "Classes\IMsiServer","","Msi install server"
  76. 0x1, "Classes\IMsiServer\CLSID","","{000C101C-0000-0000-C000-000000000046}"

  77. 0x1, "Classes\Interface\{000C1033-0000-0000-C000-000000000046}","","IMsiRemoteAPI"
  78. 0x1, "Classes\Interface\{000C1033-0000-0000-C000-000000000046}\NumMethods","","58"
  79. 0x1, "Classes\Interface\{000C1033-0000-0000-C000-000000000046}\ProxyStubClsid32","","{000C103E-0000-0000-C000-000000000046}"

  80. [SetupReg.AddReg]
  81. 0x4, "ControlSet001\Enum\Root\LEGACY_MSISERVER","NextInstance", 0x00000001
  82. 0x1, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","Service","MSIServer"
  83. 0x4, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","Legacy", 0x00000001
  84. 0x4, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","ConfigFlags", 0x00000000
  85. 0x1, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","Class","LegacyDriver"
  86. 0x1, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","ClassGUID","{8ECC055D-047F-11D1-A537-0000F8753ED1}"
  87. 0x1, "ControlSet001\Enum\Root\LEGACY_MSISERVER\0000","DeviceDesc","Windows Installer"

  88. 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."
  89. 0x4, "ControlSet001\Services\MSIServer","Type", 0x00000020
  90. ;0x4, "ControlSet001\Services\MSIServer","Start", 0x00000003
  91. 0x4, "ControlSet001\Services\MSIServer","Start", 0x00000002
  92. 0x4, "ControlSet001\Services\MSIServer","ErrorControl", 0x00000001
  93. 0x2, "ControlSet001\Services\MSIServer","ImagePath","msiexec.exe /V"
  94. 0x1, "ControlSet001\Services\MSIServer","DisplayName","Windows Installer"
  95. 0x7, "ControlSet001\Services\MSIServer","DependOnService","RpcSs"
  96. 0x7, "ControlSet001\Services\MSIServer","DependOnGroup"
  97. 0x1, "ControlSet001\Services\MSIServer","ObjectName","LocalSystem"
  98. 0x3, "ControlSet001\Services\MSIServer\Security","Security",\
  99. 01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
  100. 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,\
  101. 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,\
  102. 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,\
  103. 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,\
  104. 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,\
  105. 00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00

  106. 0x0,"Setup\AllowStart\MSISERVER"
复制代码
原创网址:鸿越软件http://xbdsoft.kmip.net/blogedit.asp?id=90

点评

破天武神www.gmwxw.com/book/974.html 绝世武神www.aoswx.com/book/1076.html  发表于 2014-9-4 20:40

评分

参与人数 1无忧币 +10 收起 理由
wangpeng + 10 精品文章

查看全部评分

2#
发表于 2009-6-12 16:27:06 | 只看该作者
原帖由 HUNRYBECKY 于 2009-6-12 15:52 发表
WINPE的技术档案中申明在WINPE中不支持MSI安装包,这限制了WINPE的功能,如何让WINPE如同WINXP一样可以安装MSI安装程序呢?经过一天时间的研究,终于搞定。
    这里说说明下为什么要增加找个功能,其实很简单, ...

原帖由 沙漠之子 于 2007-10-27 15:56 发表
很早之前就有了
在我的网盘中找把
名为Windows Installer服务组件的文件夹中


沙发。。。。。。。。。。。。。。。。。。。。。。。。。
回复

使用道具 举报

3#
发表于 2009-6-12 17:19:27 | 只看该作者
谢谢分享。。。。。。。。。。
回复

使用道具 举报

4#
发表于 2009-6-12 17:35:35 | 只看该作者
这东东好,msi都让偶搞的头痛了,下载楼主的方案测试下。。
回复

使用道具 举报

5#
发表于 2009-6-12 18:54:25 | 只看该作者
LZ强啊,这都被你搞定了,我就拿现成的了
回复

使用道具 举报

6#
发表于 2009-6-12 18:54:45 | 只看该作者
之前,有过一个 msi 补丁包,是 3 个文件的

多了 msihnd.dll,但是 msi.dll没有注册,我没测试,不知道 和你这个有什么区别。
回复

使用道具 举报

7#
发表于 2009-6-12 22:15:11 | 只看该作者
原帖由 mapeimapei 于 2009-6-12 17:35 发表
这东东好,msi都让偶搞的头痛了,下载楼主的方案测试下。。

等待小马的测试结果,谢谢
回复

使用道具 举报

8#
发表于 2009-6-12 22:52:28 | 只看该作者
沙漠之子以前发过一个,不知楼主实现的原理是不是一样的
回复

使用道具 举报

9#
 楼主| 发表于 2009-6-12 23:52:24 | 只看该作者
原帖由 pseudo 于 2009-6-12 16:27 发表




沙发。。。。。。。。。。。。。。。。。。。。。。。。。



郁闷, 你不早贴出来,害的我整了一天时间好才搞定。下次有好东西,先拿出来分享哈,你的网盘我怎么找不到连接。
回复

使用道具 举报

10#
 楼主| 发表于 2009-6-12 23:53:27 | 只看该作者
原帖由 dvd008 于 2009-6-12 18:54 发表
之前,有过一个 msi 补丁包,是 3 个文件的

多了 msihnd.dll,但是 msi.dll没有注册,我没测试,不知道 和你这个有什么区别。


我没有使用msihnd.dll,一样正常。我没有使用注册表,注册DLL和服务既可。
回复

使用道具 举报

11#
发表于 2009-6-12 23:57:40 | 只看该作者
原帖由 tzxinqing 于 2009-6-12 22:15 发表

等待小马的测试结果,谢谢



两个文件不大,已经内置了。。
回复

使用道具 举报

12#
 楼主| 发表于 2009-6-13 14:30:59 | 只看该作者
MSI文件我主要是压缩了,原来又2M多,我压缩后只有800K好像。
回复

使用道具 举报

13#
发表于 2010-1-12 17:05:07 | 只看该作者
仅适用于NT5系统而已
回复

使用道具 举报

14#
发表于 2010-1-14 06:56:01 | 只看该作者
谢谢分享。。。。。。。。。。
回复

使用道具 举报

15#
发表于 2010-4-20 15:16:06 | 只看该作者
  我安装后出现的状况,望大大指导,感谢!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-11-28 02:14

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表