Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

324 lines
14 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Out Of Band Component Installer</TITLE>
  4. <META content="text/html; charset=windows-1252" http-equiv=Content-Type>
  5. <META content="Microsoft FrontPage 5.0" name=GENERATOR>
  6. <style>
  7. <!--
  8. DIV.Section1 {
  9. page: Section1
  10. }
  11. -->
  12. </style>
  13. </HEAD>
  14. <BODY link=#0000ff><FONT face=Verdana size=5>
  15. <H2>Out Of Band Component Installer</H2></FONT>
  16. <FONT face=Arial size=2 color="#FF0000">
  17. <P>(</FONT><FONT face=Verdana size=2><SPAN style="COLOR: #ff0000; FONT-FAMILY: Arial; FONT-SIZE: 10pt">Microsoft
  18. Confidential)</SPAN></P>
  19. <H3>SUMMARY</H3>
  20. This document describes how to use &quot;MSOOBCI.DLL&quot; for exception pack
  21. installation. MSOOBCI.DLL has been designed for use on Windows 2000 and XP. It
  22. will also run on NT4 with reduced functionality <font color="#FF0000"><i>
  23. Untested</i></font>.<p>MSOOBCI.DLL will simplify installation of exception
  24. packages to ensure that the correct registration occurs as outlined in
  25. </FONT><a href="http://wfp/excp.doc">System Components Redistribution
  26. Specification</a> (<a href="http://wfp/excp.doc">http://wfp/excp.doc</a>). In
  27. particular it ensures that a package does version checking correctly, is copied
  28. to the registered component directory correctly and is registered correctly.<p>
  29. MSOOBCI.DLL also works as a device co-installer to ensure that one or more
  30. components are installed when a device dependent upon them is installed. In this
  31. mode, it may install exception packages or QFE's.<FONT face=Verdana size=2><H3>
  32. General</H3>
  33. <p>A component INF must have the following entries in it's Version section:</p>
  34. <p><b>[Version]<br>
  35. </b>signature = &quot;$Windows NT$&quot;<br>
  36. Class = %ExceptionClassDesc% ; <font color="#FF0000">Short descriptive name of
  37. exception pack (no more than 63 chars)</font><br>
  38. ClassGUID = {F5776D81-AE53-4935-8E84-B0B283D8BCEF} ; <font color="#FF0000">
  39. Indicates exception pack</font><br>
  40. Provider = %Msft%<br>
  41. CatalogFile = delta.cat ; <font color="#FF0000">substitute name of catalog file</font><br>
  42. ComponentId = {E34D1BDE-2AEB-4bc1-94F7-9D4D8387F1EE} ; <font color="#FF0000">
  43. your component ID</font><br>
  44. DriverVer = 12/17/2001,5.1.2.0 ; <font color="#FF0000">Not required by spec, but
  45. used by msoobci.dll - date &amp; version of exception pack</font><br>
  46. &nbsp;</p>
  47. <p>A component INF must use <b>[DefaultInstall]</b> as it's installation
  48. section, and must be completely installable by right-clicking on the INF (this
  49. means you need to be aware of the differences between SetupAPI syntax and
  50. AdvPack extended syntax).</p>
  51. <p>The ComponentId and descriptive names should be chosen when an exception pack
  52. is first created. You may use uuidgen or guidgen to obtain a ComponentId. The
  53. ComponentId must remain the same in future exception packs.</p>
  54. <p>Files specified in <b>[SourceDisksFiles] </b>in this exception pack must not
  55. appear in any other exception packs.</p>
  56. <p>Exception pack changes must be cumulative and the version must increase.
  57. For example, an exception pack created today cannot be targeted at just Win2k,
  58. it must also work on WinXP. It must contain all the files and fixes of previous
  59. versions of the same exception pack.</p>
  60. <p>The catalog must be signed with the explicit operating systems it is targeted
  61. at. For example, an exception pack created today may contain both 5.0+5.1
  62. version tags, or just 5.1 version tag. It cannot contain 5.x version tag.</p>
  63. <p>MSOOBCI.DLL does not do OS relevance checks. That must be done by the caller
  64. or by using OS version decorations for driver INF's.</p>
  65. <H3>RunDll32 Invocation</H3>
  66. <p><b>rundll32 </b>&lt;path&gt;<b>\msoobci.dll,DoInstall</b> &lt;path&gt;<b>\</b>comp<b>.INF</b>;&lt;flags&gt;;&lt;compId&gt;;&lt;ver&gt;;&lt;name&gt;<p>
  67. Example:<p>rundll32 Z:\mypath\msoobci.dll,DoInstall Z:\mypath\expacktest.inf;0x22;{E34D1BDE-2AEB-4bc1-94F7-9D4D8387F1EE<br>
  68. };5.1.2;Foo Bar<br>
  69. rundll32 Z:\mypath\msoobci.dll,DoInstall Z:\mypath\expacktest.inf<p>All but the
  70. INF path is optional. No success/failure feedback is given.<p>Refer to <b>
  71. InstallComponent</b> for discussion of flags.<p>&nbsp;<h3>InstallComponent API</h3>
  72. <p>HRESULT<br>
  73. WINAPI<br>
  74. InstallComponent(<br>
  75. IN LPCTSTR InfPath,<br>
  76. IN DWORD Flags,<br>
  77. IN const GUID * CompGuid, OPTIONAL<br>
  78. IN INT VerMajor, OPTIONAL<br>
  79. IN INT VerMinor, OPTIONAL<br>
  80. IN INT VerBuild, OPTIONAL<br>
  81. IN INT VerQFE, OPTIONAL<br>
  82. IN LPCTSTR Name OPTIONAL<br>
  83. );<p>(defined in msoobci.h)<h4 dir="ltr">Description</h4>
  84. <p dir="ltr">Installs an exception package specified in <i>InfPath</i>. The
  85. exception package is verified as valid. Version of this exception pack is
  86. checked against any existing exception pack installed for the component. If the
  87. install is successful, the exception package will be registered and copied to
  88. the registered components directory as well as installed into the final
  89. destination.<h4 dir="ltr">Return</h4>
  90. <p dir="ltr">S_FALSE if same or better exception pack already installed.<br>
  91. S_OK if exception pack installed (no boot required).<br>
  92. INST_S_REBOOT if exception pack installed but a reboot is required.<br>
  93. INST_S_REBOOTING if exception pack installed and machine is rebooting.<br>
  94. various errors may be returned as a HRESULT.<h4 dir="ltr">Parameters</h4>
  95. <p dir="ltr">InfPath - full path to INF<p dir="ltr">Flags:<ul>
  96. <li dir="ltr">
  97. <p dir="ltr">COMP_FLAGS_NOINSTALL - use if you wish to register an exception
  98. pack for installation at a future date. Usually passed in when installing on pre
  99. Win2k OS.</li>
  100. <li dir="ltr">
  101. <p dir="ltr">COMP_FLAGS_NOUI - do not show progress UI.</li>
  102. <li dir="ltr">
  103. <p dir="ltr">COMP_FLAGS_NOPROMPTREBOOT - reboot if needed without prompting.</li>
  104. <li dir="ltr">
  105. <p dir="ltr">COMP_FLAGS_PROMPTREBOOT - prompt for reboot if needed.</li>
  106. <li dir="ltr">
  107. <p dir="ltr">COMP_FLAGS_NEEDSREBOOT - force the fact that a reboot is needed
  108. (same as Reboot key in INF).</li>
  109. <li dir="ltr">
  110. <p dir="ltr">COMP_FLAGS_FORCE - don't do version checking, overwrite existing
  111. exception pack.</li>
  112. </ul>
  113. <p dir="ltr">CompGuid - if specified (non-NULL) verified against ComponentId
  114. entry in INF.<p dir="ltr">VerMajor/VerMinor/VerBuild/VerQFE - if -1, read the
  115. version information from DriverVer entry in INF. If specified and
  116. DriverVer entry specified in INF, check against DriverVer. Used
  117. along with DriverVer to determine if exception pack is better than
  118. whatever is previously installed. Version must either be specified here or in
  119. INF.<p dir="ltr">Name - short name (no more than 64 characters including NULL)
  120. describing the package. If specified, overrides &quot;CLASS&quot; entry specified in INF.<p dir="ltr">&nbsp;<h3 dir="ltr">
  121. InstallInfSection API</h3>
  122. <p dir="ltr">HRESULT<br>
  123. WINAPI<br>
  124. InstallInfSection(<br>
  125. IN LPCTSTR InfPath,<br>
  126. IN LPCTSTR SectionName, OPTIONAL<br>
  127. IN DWORD Flags<br>
  128. );<p>(defined in msoobci.h)<h4 dir="ltr">Description</h4>
  129. <p dir="ltr">Installs a Section within an INF (cf InstallHinfSection in SetupAPI).<h4 dir="ltr">
  130. Return</h4>
  131. <p dir="ltr">S_OK if section installed (no boot required).<br>
  132. INST_S_REBOOT if section installed but a reboot is required.<br>
  133. INST_S_REBOOTING if section installed and machine is rebooting.<br>
  134. various errors may be returned as a HRESULT.<h4 dir="ltr">Parameters</h4>
  135. <p dir="ltr">InfPath - full path to INF<p dir="ltr">SectionName - fully
  136. qualified name of section. If <i>SectionName</i> is NULL then [DefaultInstall]
  137. or decorated variant will be used.<p dir="ltr">Flags:<ul>
  138. <li dir="ltr">
  139. <p dir="ltr">COMP_FLAGS_NOUI - do not show progress UI.</li>
  140. <li dir="ltr">
  141. <p dir="ltr">COMP_FLAGS_NOPROMPTREBOOT - reboot if needed without prompting.</li>
  142. <li dir="ltr">
  143. <p dir="ltr">COMP_FLAGS_PROMPTREBOOT - prompt for reboot if needed.</li>
  144. <li dir="ltr">
  145. <p dir="ltr">COMP_FLAGS_NEEDSREBOOT - force the fact that a reboot is needed
  146. (same as Reboot key in INF).</li>
  147. </ul>
  148. <p dir="ltr">&nbsp;<h3 dir="ltr">IsUserAdmin API</h3>
  149. <p>BOOL<br>
  150. WINAPI<br>
  151. IsUserAdmin(<br>
  152. VOID<br>
  153. );<p>(defined in msoobci.h)<h4 dir="ltr">Description</h4>
  154. <p dir="ltr">Checks if current user has administrator privileges. Caller is <b>
  155. NOT</b> expected to be impersonating anyone and <b>IS</b> expected to be able to
  156. open their own process and process token.<h4 dir="ltr">Return</h4>
  157. <p dir="ltr">TRUE if current user has administrator privileges. FALSE otherwise.<p dir="ltr">&nbsp;<h3 dir="ltr">
  158. IsInteractiveWindowStation API</h3>
  159. <p>BOOL<br>
  160. WINAPI<br>
  161. IsInteractiveWindowStation(<br>
  162. VOID<br>
  163. );<p>(defined in msoobci.h)<h4 dir="ltr">Description</h4>
  164. <p dir="ltr">Checks if current user is running in an interactive window station
  165. (i.e., they can respond to dialogs).<h4 dir="ltr">Return</h4>
  166. <p dir="ltr">TRUE if running in an interactive window station. FALSE otherwise.<p dir="ltr">&nbsp;<h3 dir="ltr">
  167. DriverInstallComponents API</h3>
  168. <p dir="ltr">DWORD<br>
  169. CALLBACK<br>
  170. DriverInstallComponents (<br>
  171. IN DI_FUNCTION InstallFunction,<br>
  172. IN HDEVINFO DeviceInfoSet,<br>
  173. IN PSP_DEVINFO_DATA DeviceInfoData,<br>
  174. IN OUT PCOINSTALLER_CONTEXT_DATA Context<br>
  175. );<p>(defined in msoobci.h)<h4 dir="ltr">Description</h4>
  176. <p dir="ltr">Co-Installer callback entry to handle &quot;Components&quot; keyword in INF.<h4 dir="ltr">
  177. Return</h4>
  178. <p dir="ltr">Refer to co-installers description in DDK.<h4 dir="ltr">Parameters</h4>
  179. <p>Refer to co-installers description in DDK.</p>
  180. <p>&nbsp;</p>
  181. <h3>Driver INF Component Installation</h3>
  182. <p>A driver INF must register the DriverInstallComponents co-installer callback
  183. to be able to use the Components syntax in an INF. The INF must be designed so
  184. that the components section is only processed for the relevant target platforms.
  185. The co-installer must be given a unique name for the specific version of
  186. msoobci.dll.</p>
  187. <p>With this co-installer, one or more</p>
  188. <p><b>Components=</b>&lt;compsection&gt;[,&lt;compsection&gt;...]</p>
  189. <p>entries can be specified in the [DDInstall] section. The compoent section has
  190. the form:</p>
  191. <p>[compsection]<br>
  192. &lt;component&gt;,0x0001xxxx,&lt;componentId&gt;,&lt;version&gt;[,&lt;name&gt;[,&lt;osver&gt;[<b>-</b>&lt;osver]]]<font color="#FF0000">
  193. ; exception pack</font><br>
  194. &lt;component&gt;,0x0002xxxx,&lt;osver&gt;,&lt;sp&gt;,&lt;qfe&gt;<font color="#FF0000">
  195. ; service pack<br>
  196. </font>&lt;component&gt;,&lt;flags&gt;,...<br>
  197. ...<br>
  198. ; <font color="#FF0000">multiple entries allowed, a component must only be
  199. listed once</font></p>
  200. <p>Where:</p>
  201. <p>&lt;component&gt; - full pathname to INF that contains the exception pack or full
  202. path to self-extracting executable to install QFE.</p>
  203. <p>&lt;flags&gt;:</p>
  204. <ul>
  205. <li>0x00010000 indicates this is an exception pack.</li>
  206. <li>0x00020000 indicates this is a QFE</li>
  207. <li>+ 0x00000001 indicates device needs re-installing if component was
  208. installed.</li>
  209. <li>+ 0x00000002 indicates machine needs rebooting if component was
  210. installed.</li>
  211. </ul>
  212. <h4>Exception Packs:</h4>
  213. <p>&lt;componentId&gt; - value of ComponentId in component INF (for version check).</p>
  214. <p>&lt;version&gt; - version of component in component INF. In Major.Minor.Build.QFE
  215. format.</p>
  216. <p>&lt;name&gt; - name of component. If not specified, will be obtained from INF. Also
  217. used if media prompt is required.</p>
  218. <p>&lt;osver&gt; - format &lt;major&gt;.&lt;minor&gt;[.&lt;build&gt;]. If single version specified, will
  219. only install component on that version of NT. If version-range specified, will
  220. only install on that range of versions. Eg 5.0-5.1 will install on Win2k and XP
  221. only.</p>
  222. <h4>QFEs:</h4>
  223. <p>&lt;osver&gt; - version of operating system QFE is for (e.g. 5.1).</p>
  224. <p>&lt;sp&gt; - service pack that QFE will first appear in (e.g. 1).</p>
  225. <p>&lt;qfe&gt; - QFE number starting with &quot;Q&quot; (e.g. Q315000).</p>
  226. <p>&nbsp;</p>
  227. <p>An example INF is as follows:</p>
  228. <pre><font face="Verdana">[Version]
  229. Signature=&quot;$Windows NT$&quot;
  230. </font>Class=Unknown ; <font color="#FF0000">Replace with device class</font>
  231. ClassGuid={4D36E97E-E325-11CE-BFC1-08002BE10318} ; <font color="#FF0000">Replace with device class Guid</font>
  232. Provider=%MSFT%</pre>
  233. <pre>[DestinationDirs]
  234. MSOOBCI.CopyFiles = 11 ; <font color="#FF0000">copying MSOOBCI DLL to system32. </font>
  235. [SourceDisksNames.x86]
  236. 1 = %DiskName%,mytag,,\i386</pre>
  237. <pre>[SourceDisksNames.ia64]
  238. 1 = %DiskName%,mytag,,\ia64
  239. [SourceDisksFiles]
  240. msoobci.dll=1 ; <font color="#FF0000">Source name</font>
  241. [Manufacturer]
  242. %MSFT% = Microsoft,NT.5.1 ; <font color="#FF0000">Install is targeted at NT 5.1 and above</font>
  243. [Microsoft]
  244. ; <font color="#FF0000">NT4/2k/9x/ME install - probably not supported
  245. </font>[Microsoft.NT.5.1]
  246. ; <font color="#FF0000">XP install
  247. </font>%DeviceDesc% = Device.Comp,HwId
  248. [Device.Comp.CoInstallers]
  249. AddReg = MSOOBCI.AddReg
  250. CopyFiles = MSOOBCI.CopyFiles
  251. [Device.Comp]
  252. Components = MyComponents
  253. ; <font color="#FF0000">add other installation steps here</font></pre>
  254. <pre>[Device.Comp.Services]
  255. AddService = ,2 ; <font color="#FF0000">or other service entries</font>
  256. [MyComponents]
  257. ;<font color="#FF0000"> actual component reference</font>
  258. %1%\pack\expacktest.inf,0x10001,&quot;{E34D1BDE-2AEB-4bc1-94F7-9D4D8387F1EE}&quot;,5.1.2.0,&quot;ExPack Test&quot;,5.1
  259. </FONT>%1%\qfe\Q315000_WXP_SP1_x86_ENU.exe,5.1,1,Q315000
  260. <FONT face=Verdana size=2>
  261. [MSOOBCI.AddReg]
  262. ; <font color="#FF0000">same name as used in MSOOBCI.CopyFiles</font>
  263. HKR,,CoInstallers32,0x10000,&quot;msoobci01.DLL,DriverInstallComponents&quot;
  264. [MSOOBCI.CopyFiles]
  265. ; <font color="#FF0000">copy to a name apropriate for this version of co-installer</font>
  266. msoobci01.dll,msoobci.dll,,0x10</pre>
  267. <p dir="ltr">&nbsp;</FONT><P align=center><FONT face=Verdana size=2><A href="#top">Top of page</A></P></FONT>
  268. <TABLE border=0" cellSpacing="0" width="624">
  269. <TR>
  270. <TD bgColor="#00ffff" height="2" vAlign="middle"></TD></TR></TABLE>
  271. <FONT face="MS Sans Serif" size=1>
  272. <P>&copy; Microsoft Corporation 2001</FONT><FONT face=Verdana size=2> (Internal)</P></FONT>
  273. </BODY>