Source code of Windows XP (NT5)
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.

772 lines
22 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNXPNB.INF
  4. ;
  5. ; NBF network SETUP INF file.
  6. ;
  7. ; History:
  8. ; davidhov 00-Feb-1992 Created
  9. ; terryk 27-Feb-1992 Reorganize section location
  10. ; added comment
  11. ; terryk 03-Mar-1992 Changed to NBF setup
  12. ; terryk 02-Apr-1992 Code review changed
  13. ; davidhov 03-Apr-1992 Enhanced to use new INF section
  14. ; structure from SunilP, et al.
  15. ; terryk 06-Jul-1993 Removed Size parameter
  16. ;
  17. ;***********************************************************************
  18. ;-----------------------------------------------------------------------
  19. ; OPTION TYPE
  20. ; -----------
  21. ; This identifies the Option type we are dealing with. The different
  22. ; possible types are:
  23. ;
  24. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  25. ;
  26. ; Types specific to networking:
  27. ;
  28. ; NetAdapter, a netcard / adapter combination or just a netcard
  29. ; NetDriver, just a netcard driver
  30. ; NetTransport, a complete NDIS-compliant TDI transport stack
  31. ; NetService, an NT networking service
  32. ; NetWork, a complete network ensemble.
  33. ; NetProvider a complete network which supports NT MPR protocol
  34. ;-----------------------------------------------------------------------
  35. [Identification]
  36. OptionType = NetTransport
  37. ;-----------------------------------------------------------------------
  38. ; OPTION LIST
  39. ; -----------
  40. ; This section lists the OEM Option key names. These keys are locale
  41. ; independent and used to represent the option in a locale independent
  42. ; manner.
  43. ;
  44. ;-----------------------------------------------------------------------
  45. [Options]
  46. NBF
  47. ;***********************************************************************
  48. ; CONSTANTS FOR USING DIALOGS
  49. ;***********************************************************************
  50. [FileConstants]
  51. ;
  52. ; File names, etc.
  53. ;
  54. UtilityInf = "UTILITY.INF"
  55. subroutineinf = "SUBROUTN.INF"
  56. SoftwareType = "transport"
  57. Exit_Code = 0
  58. ;ShellCode = 0
  59. ;
  60. ; EventLog Message File
  61. ;
  62. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  63. ;
  64. ; Product Info
  65. ;
  66. Manufacturer = "Microsoft"
  67. ProductMajorVersion = "4"
  68. ProductMinorVersion = "0"
  69. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  70. ;
  71. ; Software
  72. ;
  73. ProductSoftwareName = "Nbf"
  74. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\nbf.sys"
  75. NetRuleSoftwareType = "nbf netBiosTransport rasCapableTransport"
  76. NetRuleSoftwareClass = {"rasCapableTransport netBiosTransport"}
  77. NetRuleSoftwareUse = $(SoftwareType)" none none"
  78. NetRuleSoftwareBindForm = """Nbf"" yes yes simple"
  79. ProductOpSupport = 132 ; 0x0084 ; Display,Removable,No Properties,Not Updatable
  80. ;
  81. ; Registry Key
  82. ;
  83. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  84. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)"\Parameters"
  85. ServiceKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)
  86. NetRuleKeyName = $(ProductKeyName)"\NetRules"
  87. [GeneralConstants]
  88. ;
  89. ; Program flow control variables.
  90. ;
  91. from = ""
  92. to = ""
  93. ;
  94. ; Return codes; Exit_Code is set to one of these
  95. ;
  96. ExitCodeOk = 0
  97. ExitCodeCancel = 1
  98. ExitCodeFatal = 2
  99. KeyNull = ""
  100. MAXIMUM_ALLOWED = 33554432
  101. RegistryErrorIndex = NO_ERROR
  102. KeyProduct = ""
  103. KeyParameters = ""
  104. TRUE = 1
  105. FALSE = 0
  106. NoTitle = 0
  107. ExitState = "Active"
  108. OldVersionExisted = $(FALSE)
  109. DriverPath = $(!STF_NTPATH)\drivers
  110. [date]
  111. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  112. ; Minute, Second }
  113. Now = {} ? $(!LIBHANDLE) GetSystemDate
  114. ;---------------------------------------------------------------------------
  115. ; 1. Identify
  116. ;
  117. ; DESCRIPTION: To verify that this INF deals with the same type of options
  118. ; as we are choosing currently.
  119. ;
  120. ; INPUT: None
  121. ;
  122. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  123. ; $($R1): Option Type (COMPUTER ...)
  124. ; $($R2): Diskette description
  125. ;---------------------------------------------------------------------------
  126. [Identify]
  127. ;
  128. ;
  129. read-syms Identification
  130. set Status = STATUS_SUCCESSFUL
  131. set Identifier = $(OptionType)
  132. set Media = #("Source Media Descriptions", 1, 1)
  133. Return $(Status) $(Identifier) $(Media)
  134. ;------------------------------------------------------------------------
  135. ; 2. ReturnOptions:
  136. ;
  137. ; DESCRIPTION: To return the option list supported by this INF and the
  138. ; localised text list representing the options.
  139. ;
  140. ;
  141. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  142. ;
  143. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  144. ; STATUS_NOLANGUAGE
  145. ; STATUS_FAILED
  146. ;
  147. ; $($R1): Option List
  148. ; $($R2): Option Text List
  149. ;------------------------------------------------------------------------
  150. [ReturnOptions]
  151. ;
  152. ;
  153. set Status = STATUS_FAILED
  154. set OptionList = {}
  155. set OptionTextList = {}
  156. ;
  157. ; Check if the language requested is supported
  158. ;
  159. set LanguageList = ^(LanguagesSupported, 1)
  160. Ifcontains(i) $($0) in $(LanguageList)
  161. goto returnoptions
  162. else
  163. set Status = STATUS_NOLANGUAGE
  164. goto finish_ReturnOptions
  165. endif
  166. ;
  167. ; form a list of all the options and another of the text representing
  168. ;
  169. returnoptions = +
  170. set OptionList = ^(Options, 1)
  171. set OptionTextList = ^(OptionsText$($0), 1)
  172. set Status = STATUS_SUCCESSFUL
  173. finish_ReturnOptions = +
  174. Return $(Status) $(OptionList) $(OptionTextList)
  175. ;----------InstallOption-------------------------------------------------
  176. ;
  177. ; InstallOption:
  178. ;
  179. ; This section is shelled to by main installation processing
  180. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  181. ;
  182. ;
  183. ; FUNCTION: To copy files representing Options
  184. ; To configure the installed option
  185. ; To update the registry for the installed option
  186. ;
  187. ; INPUT: $($0): Language to use
  188. ; $($1): OptionID to install
  189. ; $($2): SourceDirectory
  190. ; $($3): AddCopy (YES | NO)
  191. ; $($4): DoCopy (YES | NO)
  192. ; $($5): DoConfig (YES | NO)
  193. ;
  194. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  195. ; STATUS_NOLANGUAGE |
  196. ; STATUS_USERCANCEL |
  197. ; STATUS_FAILED
  198. ;
  199. ;------------------------------------------------------------------------
  200. [InstallOption]
  201. ;
  202. ; extract parameters
  203. ;
  204. set Option = $($1)
  205. set SrcDir = $($2)
  206. set AddCopy = $($3)
  207. set DoCopy = $($4)
  208. set DoConfig = $($5)
  209. ;
  210. ; Check if the language requested is supported
  211. ;
  212. set LanguageList = ^(LanguagesSupported, 1)
  213. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  214. Return STATUS_NOLANGUAGE
  215. endif
  216. Debug-Output "OEMNXPNB.INF: STF_CWDDIR is: "$(!STF_CWDDIR)
  217. Debug-Output "OEMNXPNB.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  218. ; define all the constants
  219. set-subst LF = "\n"
  220. read-syms GeneralConstants
  221. read-syms FileConstants
  222. read-syms DialogConstants$(!STF_LANGUAGE)
  223. ifstr(i) $(!NTN_Origination) == "NCPA"
  224. set Continue = $(OK)
  225. endif
  226. read-syms FileConstants$(!STF_LANGUAGE)
  227. detect date
  228. set-title $(FunctionTitle)
  229. set to = Begin
  230. set from = Begin
  231. ;
  232. ; Assume all is well.
  233. ;
  234. set CommonStatus = STATUS_SUCCESSFUL
  235. EndWait
  236. ;
  237. ; Set up the operation-mode-based variables and gaily welcome
  238. ; the user. If the "install mode" variable is improperly set,
  239. ; assume this is a new installation.
  240. ;
  241. Begin = +
  242. Ifstr(i) $(!NTN_InstallMode) == deinstall
  243. set StartLabel = removeadapter
  244. else-Ifstr(i) $(!NTN_InstallMode) == Update
  245. set StartLabel = UpgradeSoftware
  246. else-Ifstr(i) $(!NTN_InstallMode) == bind
  247. set StartLabel = bindingadapter
  248. else-Ifstr(i) $(!NTN_InstallMode) == configure
  249. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  250. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  251. Debug-Output "OEMNXPNB.INF: ShellCode error: cannot get an error string."
  252. goto ShellCodeError
  253. endif
  254. set Error = $($R0)
  255. set from = end
  256. set to = end
  257. goto nonfatalinfo
  258. else
  259. set StartLabel = installadapter
  260. endif
  261. ;
  262. ; set up default parameter
  263. ;
  264. set RadioDefault = 2
  265. set RadioIn = {$(RadioDefault)}
  266. set from = $(fatal)
  267. set to = $(fatal)
  268. goto $(StartLabel)
  269. ;-----------------------------------------------
  270. ; Installation Section
  271. ;-----------------------------------------------
  272. installadapter = +
  273. ;
  274. ; First, check whether the same version of the software exists
  275. ;
  276. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  277. Ifstr $(KeyProduct) != $(KeyNull)
  278. ;
  279. ; Same version already existed in the local machine
  280. ; Popup the dialog and ask the user whether he wants to continue
  281. ;
  282. CloseRegKey $(KeyProduct)
  283. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  284. $(ProductVersion)
  285. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  286. Debug-Output "ShellCode error: cannot get an error string."
  287. goto ShellCodeError
  288. endif
  289. goto end
  290. endif
  291. CloseRegKey $(KeyProduct)
  292. goto installproduct
  293. ;
  294. ; If installing, go create the necessary keys;
  295. ; if configuring, they're already open.
  296. ;
  297. installproduct = +
  298. StartWait
  299. ;
  300. ; Now nbf is to be installed
  301. ;
  302. ifint $(OldVersionExisted) == $(FALSE)
  303. Ifstr(i) $(DoCopy) == "YES"
  304. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  305. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  306. Goto ShellCodeError
  307. Else-Ifstr(i) $($R0) == STATUS_FAILED
  308. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  309. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  310. goto ShellCodeError
  311. endif
  312. set Error = $($R0)
  313. Goto fatal
  314. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  315. Goto successful
  316. Endif
  317. Set SrcDir = $($R1)
  318. Endif
  319. install "Install-Option"
  320. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  321. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  322. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  323. goto ShellCodeError
  324. endif
  325. set Error = $($R0)
  326. goto fatal
  327. endif
  328. set OEM_ABANDON_ON = TRUE
  329. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  330. $(ProductSoftwareName), +
  331. $(ProductSoftwareName), +
  332. $(ProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
  333. $(ProductSoftwareImagePath), "kernel", "PNP_TDI", {}, "",+
  334. $(NetEventDLL)
  335. set RegistryErrorIndex = $($R0)
  336. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  337. EndWait
  338. CloseRegKey $($R1)
  339. CloseRegKey $($R2)
  340. CloseRegKey $($R3)
  341. CloseRegKey $($R4)
  342. CloseRegKey $($R5)
  343. goto fatalRegistry
  344. endif
  345. ;
  346. ; At this point:
  347. ; $R1 contains the product version key handle;
  348. ; $R2 contains the NetRules subkey handle;
  349. ; $R3 contains the new Services key handle; and
  350. ; $R4 contains the Parameters key
  351. ; $R5 contains the Linkage Key
  352. ;
  353. Set SoftProductKey = $($R1)
  354. Set SoftNetRuleKey = $($R2)
  355. Set SoftServiceKey = $($R3)
  356. set KeyParameters = $($R4)
  357. Set SoftLinkageKey = $($R5)
  358. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  359. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  360. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  361. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  362. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  363. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  364. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  365. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  366. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  367. set RegistryErrorIndex = $($R0)
  368. Ifstr $(RegistryErrorIndex) != NO_ERROR
  369. CloseRegKey $(SoftProductKey)
  370. CloseRegKey $(SoftNetRuleKey)
  371. CloseRegKey $(SoftServiceKey)
  372. CloseRegKey $(SoftLinkageKey)
  373. CloseRegKey $(KeyParameters)
  374. goto fatalRegistry
  375. endif
  376. set NewValueList = {{type ,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)}, +
  377. {use ,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  378. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  379. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  380. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  381. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  382. set RegistryErrorIndex = $($R0)
  383. Ifstr $(RegistryErrorIndex) != NO_ERROR
  384. CloseRegKey $(SoftProductKey)
  385. CloseRegKey $(SoftNetRuleKey)
  386. CloseRegKey $(SoftServiceKey)
  387. CloseRegKey $(SoftLinkageKey)
  388. CloseRegKey $(KeyParameters)
  389. goto fatalRegistry
  390. endif
  391. ;
  392. ; Write the RPC protocol string token.
  393. ;
  394. Set NewValueList = {{NbProvider,$(NoTitle),$(!REG_VT_SZ),"_nb"}}
  395. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  396. Ifstr $(RegistryErrorIndex) != NO_ERROR
  397. CloseRegKey $(SoftProductKey)
  398. CloseRegKey $(SoftNetRuleKey)
  399. CloseRegKey $(SoftServiceKey)
  400. CloseRegKey $(SoftLinkageKey)
  401. goto fatalRegistry
  402. endif
  403. CreateRegKey $(SoftServiceKey) {"Performance",$(NoTitle),GenericClass} "" +
  404. $(MAXIMUM_ALLOWED) "" KeyPerformance
  405. set NewValueList = {{Library,$(NoTitle),$(!REG_VT_SZ),"Perfctrs.dll"},+
  406. {Open,$(NoTitle),$(!REG_VT_SZ),"OpenNbfPerformanceData"},+
  407. {Collect,$(NoTitle),$(!REG_VT_SZ),"CollectNbfPerformanceData"},+
  408. {Close,$(NoTitle),$(!REG_VT_SZ),"CloseNbfPerformanceData"}}
  409. Shell $(UtilityInf), AddValueList, $(KeyPerformance), $(NewValueList)
  410. set RegistryErrorIndex = $($R0)
  411. Ifstr $(RegistryErrorIndex) != NO_ERROR
  412. CloseRegKey $(SoftProductKey)
  413. CloseRegKey $(SoftNetRuleKey)
  414. CloseRegKey $(SoftServiceKey)
  415. CloseRegKey $(SoftLinkageKey)
  416. CloseRegKey $(KeyParameters)
  417. goto fatalRegistry
  418. endif
  419. CloseRegKey $(KeyPerformance)
  420. CloseRegKey $(SoftProductKey)
  421. CloseRegKey $(SoftNetRuleKey)
  422. CloseRegKey $(SoftServiceKey)
  423. CloseRegKey $(SoftLinkageKey)
  424. endif
  425. ;
  426. ; Add the rpc strings
  427. ;
  428. Shell $(UtilityInf) AddMixRpcProtocol "Netbios" "nbf" "ncacn_nb_nb" "rpclt1.dll" "rpclt1.dll"
  429. goto writeparameters
  430. ;
  431. ; REQUIRED: $(KeyParameters) contains service Parameters key handle
  432. ;
  433. writeparameters = +
  434. ;
  435. ; Add the rest of the parameters to the Services area
  436. ;
  437. CloseRegKey $(KeyParameters)
  438. EndWait
  439. goto successful
  440. ;-----------------------------------------------
  441. ; Binding section
  442. ;-----------------------------------------------
  443. bindingadapter =+
  444. set Error = "Binding: Sorry, not yet implemented."
  445. goto fatal
  446. ;-----------------------------------------------
  447. ; Removeadapter section
  448. ;-----------------------------------------------
  449. removeadapter = +
  450. Shell $(UtilityInf) RemoveRpcProtocol "ncacn_nb_nb"
  451. ;
  452. ; Remove NETBIOS service
  453. ;
  454. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  455. $(ProductSoftwareName)
  456. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  457. Debug-Output "ShellCode error"
  458. goto ShellCodeError
  459. endif
  460. set RegistryErrorIndex = $($R0)
  461. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  462. goto fatalregistry
  463. endif
  464. goto end
  465. ;-----------------------------------------------
  466. ; Upgrade Software section
  467. ;-----------------------------------------------
  468. UpgradeSoftware = +
  469. ; Upgrade software component
  470. ;
  471. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  472. Ifstr $(KeyProduct) != $(KeyNull)
  473. install "Install-Update"
  474. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  475. goto fatal
  476. endif
  477. ; Upgrade the version number
  478. ;
  479. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  480. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  481. ;
  482. ; Upgrade the description and op support
  483. ;
  484. SetRegValue $(KeyProduct) {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)}
  485. SetRegValue $(KeyProduct) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  486. ;
  487. ; Update the rpc strings
  488. ;
  489. Shell $(UtilityInf) AddMixRpcProtocol "Netbios" "nbf" "ncacn_nb_nb" "rpclt1.dll" "rpclt1.dll"
  490. ;
  491. ; Update load order group membership
  492. ;
  493. OpenRegKey $(!REG_H_LOCAL) "" $(ServiceKeyName) $(MAXIMUM_ALLOWED) KeyService
  494. Ifstr $(KeyService) != $(KeyNull)
  495. SetRegValue $(KeyService) {Group,$(NoTitle),$(!REG_VT_SZ),"PNP_TDI"}
  496. CloseRegKey $(KeyService)
  497. endif
  498. ;
  499. ; Update NetRules Key.
  500. ;
  501. OpenRegKey $(!REG_H_LOCAL) "" $(NetRuleKeyName) $(MAXIMUM_ALLOWED) KeyNetRules
  502. Ifstr $(KeyNetRules) != $(KeyNull)
  503. SetRegValue $(KeyNetRules) {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}
  504. CloseRegKey $(KeyNetRules)
  505. endif
  506. CloseRegKey $(KeyProduct)
  507. else
  508. ;
  509. ; Cannot Open software key, goto ERROR
  510. ;
  511. goto fatalregistry
  512. endif
  513. goto end
  514. ;
  515. ; End of Upgrade Software
  516. ;
  517. ;
  518. ; Escape hatches
  519. ;
  520. successful = +
  521. goto end
  522. ;
  523. ; warning display
  524. ;
  525. warning = +
  526. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  527. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  528. goto ShellCodeError
  529. endif
  530. ifstr(i) $($R1) == "OK"
  531. goto $(to)
  532. else-ifstr(i) $($R1) == "CANCEL"
  533. goto $(from)
  534. else
  535. ; Debug-Msg "Error Error Bad DLGEVENT"
  536. goto "end"
  537. endif
  538. ;
  539. ; non fatal error display
  540. ;
  541. nonfatalinfo = +
  542. Set CommonStatus = STATUS_USERCANCEL
  543. Set Severity = STATUS
  544. goto nonfatalmsg
  545. nonfatal = +
  546. Set Severity = NONFATAL
  547. goto nonfatalmsg
  548. nonfatalmsg = +
  549. ifstr(i) $(Error) == ""
  550. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  551. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  552. goto ShellCodeError
  553. endif
  554. set Error = $($R0)
  555. endif
  556. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  557. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  558. goto ShellCodeError
  559. endif
  560. ifstr(i) $($R1) == "OK"
  561. goto $(from)
  562. else
  563. goto "end"
  564. endif
  565. ;
  566. ; Registry is broken
  567. ;
  568. fatalregistry = +
  569. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  570. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  571. goto ShellCodeError
  572. endif
  573. set Error = $($R0)
  574. goto fatal
  575. ;
  576. ; fatal error display
  577. ;
  578. fatal = +
  579. ifstr(i) $(Error) == ""
  580. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  581. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  582. goto ShellCodeError
  583. endif
  584. set Error = $($R0)
  585. endif
  586. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  587. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  588. goto ShellCodeError
  589. endif
  590. goto setfailed
  591. ;
  592. ; Shelling error
  593. ;
  594. ShellCodeError = +
  595. set DlgType = "MessageBox"
  596. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  597. set STF_MB_TEXT = $(ShellCodeErrorText)
  598. set STF_MB_TYPE = 1
  599. set STF_MB_ICON = 3
  600. set STF_MB_DEF = 1
  601. ui start "Error Message"
  602. goto setfailed
  603. setfailed = +
  604. set CommonStatus = STATUS_FAILED
  605. ;
  606. ; If OEM_ABANDON_ON, we need to clean up the registry
  607. ;
  608. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  609. set OEM_ABANDON_ON = FALSE
  610. goto removeadapter
  611. endif
  612. goto end
  613. end = +
  614. goto term
  615. term = +
  616. Return $(CommonStatus)
  617. ;***************************************************************
  618. ; INSTALL SECTIONS
  619. ;***************************************************************
  620. [Install-Option]
  621. set STF_VITAL = ""
  622. ifstr(i) $(AddCopy) == "YES"
  623. ;
  624. ; Add the files to the copy list
  625. ;
  626. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  627. ; the other INF files
  628. ;
  629. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  630. endif
  631. ifstr(i) $(DoCopy) == "YES"
  632. ;
  633. ; Copy files in the copy list
  634. ;
  635. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  636. CopyFilesInCopyList
  637. endif
  638. ifstr(i) $(DoConfig) == "YES"
  639. ;
  640. ; Add product to registry
  641. ;
  642. ;
  643. ; Finish up
  644. endif
  645. Exit
  646. [Install-Update]
  647. set STF_VITAL = ""
  648. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  649. ;set STF_VERSION = "YES"
  650. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  651. exit