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.

1087 lines
32 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADXM.INF
  4. ;
  5. ; UB Micro Channel network card and driver 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 ELNKMC 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. ;
  16. ;***********************************************************************
  17. ;-----------------------------------------------------------------------
  18. ; OPTION TYPE
  19. ; -----------
  20. ; This identifies the Option type we are dealing with. The different
  21. ; possible types are:
  22. ;
  23. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  24. ;
  25. ; Types specific to networking:
  26. ;
  27. ; NetAdapter, a netcard / adapter combination or just a netcard
  28. ; NetDriver, just a netcard driver
  29. ; NetTransport, a complete NDIS-compliant TDI transport stack
  30. ; NetService, an NT networking service
  31. ; NetWork, a complete network ensemble.
  32. ; NetProvider a complete network which supports NT MPR protocol
  33. ;-----------------------------------------------------------------------
  34. [Identification]
  35. OptionType = NetAdapter
  36. ;-----------------------------------------------------------------------
  37. ; PlatformsSupported
  38. ; ------------------
  39. ; This identifies the platforms supported by the adapter card.
  40. ; Possible types are:
  41. ;
  42. ; ISA, EISA and MCA
  43. ;-----------------------------------------------------------------------
  44. [PlatformsSupported]
  45. MCA
  46. ;-----------------------------------------------------------------------
  47. ; LANGUAGES SUPPORTED
  48. ; -------------------
  49. ;
  50. ; The languages supported by the OEM INF, For every language supported
  51. ; we need to have a separate text section for every displayable text
  52. ; section.
  53. ;
  54. ;-----------------------------------------------------------------------
  55. [LanguagesSupported]
  56. ENG
  57. ;-----------------------------------------------------------------------
  58. ; OPTION LIST
  59. ; -----------
  60. ; This section lists the OEM Option key names. These keys are locale
  61. ; independent and used to represent the option in a locale independent
  62. ; manner.
  63. ;
  64. ;-----------------------------------------------------------------------
  65. [Options]
  66. UBPSXNS
  67. ;-----------------------------------------------------------------------
  68. ; OPTION TEXT SECTION
  69. ; -------------------
  70. ; These are text strings used to identify the option to the user. There
  71. ; are separate sections for each language supported. The format of the
  72. ; section name is "OptionsText" concatenated with the Language represented
  73. ; by the section.
  74. ;
  75. ;-----------------------------------------------------------------------
  76. [OptionsTextENG]
  77. UBPSXNS = "Ungermann-Bass Ethernet NIUps Adapter [XNS]"
  78. ;***********************************************************************
  79. ; CONSTANTS FOR USING DIALOGS
  80. ;***********************************************************************
  81. [FileConstants]
  82. ;
  83. ; File names, etc.
  84. ;
  85. UtilityInf = "UTILITY.INF"
  86. subroutineinf = "SUBROUTN.INF"
  87. SoftwareType = "driver"
  88. Exit_Code = 0
  89. ;ShellCode = 0
  90. ;
  91. ; EventLog Message File
  92. ;
  93. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  94. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  95. UBPSXNS_1BYTE = 18
  96. UBPSXNS_2BYTE = 112
  97. NETCARD_ID = 28690
  98. ;
  99. ; Product Info
  100. ;
  101. Manufacturer = "Microsoft"
  102. ProductMajorVersion = "4"
  103. ProductMinorVersion = "0"
  104. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  105. ;
  106. ; Software
  107. ;
  108. ProductSoftwareName = "XNS"
  109. ProductSoftwareTitle = "UB Monolithic Transport and Driver"
  110. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\xns.sys"
  111. NetRuleSoftwareType = "ubStack netBiosTransport ubXnsDriver"
  112. NetRuleSoftwareUse = $(SoftwareType)
  113. NetRuleSoftwareBindForm = """XNS"" yes no container"
  114. NetRuleSoftwareClass = {"ubXnsDriver basic"}
  115. NetRuleSoftwareBindable = {"ubXnsDriver ubAdapter exclusive exclusive 200"}
  116. ;
  117. ; Hardware
  118. ;
  119. ProductHardwareName = "UB"
  120. ProductHardwareTitle = "Ungermann-Bass Ethernet NIUps Adapter"
  121. NetRuleHardwareType = "ub ubAdapter"
  122. NetRuleHardwareBindForm = " yes yes container"
  123. NetRuleHardwareClass = {"ubAdapter basic"}
  124. ProductOpSupport = 132 ; 0x0084 ; Display,Removable,Not Properties,Not Updatable
  125. ;
  126. ; Registry Key
  127. ;
  128. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  129. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  130. [GeneralConstants]
  131. ;
  132. ; Program flow control variables.
  133. ;
  134. from = ""
  135. to = ""
  136. ;
  137. ; Return codes; Exit_Code is set to one of these
  138. ;
  139. ExitCodeOk = 0
  140. ExitCodeCancel = 1
  141. ExitCodeFatal = 2
  142. KeyNull = ""
  143. MAXIMUM_ALLOWED = 33554432
  144. RegistryErrorIndex = NO_ERROR
  145. KeyProduct = ""
  146. KeyParameters = ""
  147. TRUE = 1
  148. FALSE = 0
  149. NoTitle = 0
  150. ExitState = "Active"
  151. OldVersionExisted = $(FALSE)
  152. DriverPath = $(!STF_NTPATH)\drivers
  153. ;***********************************************************************
  154. ; Language-Dependent Dialog Constants
  155. ;***********************************************************************
  156. [FileConstantsENG]
  157. ;
  158. ; Variables to support thermometer gauge and error dialogs
  159. ;
  160. ProCaption = "Windows NT Setup"
  161. ProCancel = "Cancel"
  162. ProCancelMsg = "Windows NT Networking is not correctly installed. "+
  163. "Are you sure you want to cancel copying files?"
  164. ProCancelCap = "Network Setup Message"
  165. ProText1 = "Copying:"
  166. ProText2 = "To:"
  167. ;
  168. ; Product Info
  169. ;
  170. FunctionTitle = "Ungermann-Bass Adapter Card Setup"
  171. ;
  172. ; Software
  173. ;
  174. ProductSoftwareDescription = "UB Monolithic Transport and Driver"
  175. ;
  176. ; Hardware
  177. ;
  178. ProductHardwareDescription = "Ungermann-Bass Ethernet NIUps Adapter"
  179. CANNOT_FIND_ANY_CARD = "Network card is not present in the system"
  180. [DialogConstantsENG]
  181. ;
  182. ; Common button names, etc.
  183. ;
  184. Help = "&Help"
  185. Exit = "&Cancel"
  186. OK = "&OK"
  187. HelpContext = ""
  188. Continue = "C&ontinue"
  189. Cancel = "C&ancel"
  190. [date]
  191. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  192. ; Minute, Second }
  193. Now = {} ? $(!LIBHANDLE) GetSystemDate
  194. ;-----------------------------------------------
  195. ; Input DIALOGS
  196. ;-----------------------------------------------
  197. [FileDependentDlgENG]
  198. ;
  199. ; No UI for micro channel
  200. ;
  201. ;---------------------------------------------------------------------------
  202. ; 1. Identify
  203. ;
  204. ; DESCRIPTION: To verify that this INF deals with the same type of options
  205. ; as we are choosing currently.
  206. ;
  207. ; INPUT: None
  208. ;
  209. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  210. ; $($R1): Option Type (COMPUTER ...)
  211. ; $($R2): Diskette description
  212. ;---------------------------------------------------------------------------
  213. [Identify]
  214. ;
  215. ;
  216. read-syms Identification
  217. set Status = STATUS_SUCCESSFUL
  218. set Identifier = $(OptionType)
  219. set Media = #("Source Media Descriptions", 1, 1)
  220. Return $(Status) $(Identifier) $(Media)
  221. ;------------------------------------------------------------------------
  222. ; 2. ReturnOptions:
  223. ;
  224. ; DESCRIPTION: To return the option list supported by this INF and the
  225. ; localised text list representing the options.
  226. ;
  227. ;
  228. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  229. ;
  230. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  231. ; STATUS_NOLANGUAGE
  232. ; STATUS_FAILED
  233. ; STATUS_NOTSUPPORTED
  234. ;
  235. ; $($R1): Option List
  236. ; $($R2): Option Text List
  237. ;------------------------------------------------------------------------
  238. [ReturnOptions]
  239. ;
  240. ;
  241. set Status = STATUS_FAILED
  242. set OptionList = {}
  243. set OptionTextList = {}
  244. ;
  245. ; Check if the language requested is supported
  246. ;
  247. set LanguageList = ^(LanguagesSupported, 1)
  248. Ifcontains(i) $($0) in $(LanguageList)
  249. ;
  250. ; Check if the platforms requested is supported
  251. ;
  252. ifstr(i) $($1) == ""
  253. goto returnoptions
  254. endif
  255. set PlatformList = ^(PlatformsSupported, 1)
  256. Ifcontains(i) $($1) in $(PlatformList)
  257. goto returnoptions
  258. else
  259. set Status = STATUS_NOTSUPPORTED
  260. goto finish_ReturnOptions
  261. endif
  262. else
  263. set Status = STATUS_NOLANGUAGE
  264. goto finish_ReturnOptions
  265. endif
  266. ;
  267. ; form a list of all the options and another of the text representing
  268. ;
  269. returnoptions = +
  270. set OptionList = ^(Options, 1)
  271. set OptionTextList = ^(OptionsText$($0), 1)
  272. set Status = STATUS_SUCCESSFUL
  273. finish_ReturnOptions = +
  274. Return $(Status) $(OptionList) $(OptionTextList)
  275. ;----------InstallOption-------------------------------------------------
  276. ;
  277. ; InstallOption:
  278. ;
  279. ; This section is shelled to by main installation processing
  280. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  281. ;
  282. ;
  283. ; FUNCTION: To copy files representing Options
  284. ; To configure the installed option
  285. ; To update the registry for the installed option
  286. ;
  287. ; INPUT: $($0): Language to use
  288. ; $($1): OptionID to install
  289. ; $($2): SourceDirectory
  290. ; $($3): AddCopy (YES | NO)
  291. ; $($4): DoCopy (YES | NO)
  292. ; $($5): DoConfig (YES | NO)
  293. ;
  294. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  295. ; STATUS_NOLANGUAGE |
  296. ; STATUS_USERCANCEL |
  297. ; STATUS_FAILED
  298. ;
  299. ;------------------------------------------------------------------------
  300. [InstallOption]
  301. ;
  302. ; extract parameters
  303. ;
  304. set Option = $($1)
  305. set SrcDir = $($2)
  306. set AddCopy = $($3)
  307. set DoCopy = $($4)
  308. set DoConfig = $($5)
  309. ;
  310. ; Check if the language requested is supported
  311. ;
  312. set LanguageList = ^(LanguagesSupported, 1)
  313. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  314. Return STATUS_NOLANGUAGE
  315. endif
  316. Debug-Output "OEMNADXM.INF: STF_CWDIR is: "$(!STF_CWDIR)
  317. Debug-Output "OEMNADXM.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  318. ; define all the constants
  319. set-subst LF = "\n"
  320. read-syms GeneralConstants
  321. read-syms FileConstants
  322. read-syms DialogConstants$(!STF_LANGUAGE)
  323. read-syms FileConstants$(!STF_LANGUAGE)
  324. detect date
  325. set-title $(FunctionTitle)
  326. set to = Begin
  327. set from = Begin
  328. ;
  329. ; Assume all is well.
  330. ;
  331. set CommonStatus = STATUS_SUCCESSFUL
  332. EndWait
  333. ;
  334. ; Set up the operation-mode-based variables and gaily welcome
  335. ; the user. If the "install mode" variable is improperly set,
  336. ; assume this is a new installation.
  337. ;
  338. Begin = +
  339. Ifstr(i) $(!NTN_InstallMode) == deinstall
  340. set StartLabel = removeadapter
  341. else-Ifstr(i) $(!NTN_InstallMode) == Update
  342. set StartLabel = UpgradeSoftware
  343. else-Ifstr(i) $(!NTN_InstallMode) == bind
  344. set StartLabel = bindingadapter
  345. else-Ifstr(i) $(!NTN_InstallMode) == configure
  346. set CommonStatus = STATUS_REBOOT
  347. ;
  348. ; You cannot config the software component
  349. ;
  350. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  351. Debug-Output "Cannot configure the ubpsxns driver software."
  352. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  353. else
  354. Debug-Output "Cannot configure the ubpsxns adapter card."
  355. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_HARDWARE
  356. endif
  357. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  358. Debug-Output "ShellCode error: cannot get an error string."
  359. goto ShellCodeError
  360. endif
  361. set Error = $($R0)
  362. set from = end
  363. set to = end
  364. goto nonfatalinfo
  365. else
  366. set StartLabel = installadapter
  367. set OEM_ABANDON_OPTIONS = {}
  368. set OEM_ABANDON_SOFTWARE = FALSE
  369. set OEM_ABANDON_ON = TRUE
  370. endif
  371. set from = $(fatal)
  372. set to = $(fatal)
  373. goto $(StartLabel)
  374. ;-----------------------------------------------
  375. ; Installation Section
  376. ;-----------------------------------------------
  377. installadapter = +
  378. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  379. Ifstr $(KeyProduct) != $(KeyNull)
  380. ;
  381. ; Same version already existed in the local machine
  382. ; Popup the dialog and ask the user whether he wants to continue
  383. ;
  384. CloseRegKey $(KeyProduct)
  385. ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  386. ;
  387. ; Cannot Install the same software again
  388. ;
  389. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  390. $(ProductVersion)
  391. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  392. Debug-Output "ShellCode error: cannot get an error string."
  393. goto ShellCodeError
  394. endif
  395. goto end
  396. else
  397. ;
  398. ; Add a new adapter card?
  399. ;
  400. Shell $(UtilityInf), CardExistedDlg
  401. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  402. Debug-Output "ShellCode error: cannot get an error string."
  403. goto ShellCodeError
  404. endif
  405. ifstr(i) $($R1) != "OK"
  406. Set CommonStatus = STATUS_USERCANCEL
  407. goto end
  408. endif
  409. set OldVersionExisted = $(TRUE)
  410. endif
  411. endif
  412. goto nextstep
  413. ;-----------------------------------------------
  414. ; Configuration Section
  415. ;-----------------------------------------------
  416. configureadapter = +
  417. ;
  418. ; we should delete the old data here
  419. ;
  420. set Error = "Configure: Not Implmemented yet"
  421. goto fatal
  422. ;
  423. ; If installing, go create the necessary keys;
  424. ; if configuring, they're already open.
  425. ;
  426. nextstep = +
  427. StartWait
  428. installproduct = +
  429. ;
  430. ; Check hardware component
  431. ;
  432. Shell $(UtilityInf), MCAFindBus, $(UBPSXNS_1BYTE), $(UBPSXNS_2BYTE)
  433. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  434. goto ShellCodeError
  435. endif
  436. ifstr $($R0) != "NO_ERROR"
  437. set Error = $($R0)
  438. goto fatal
  439. endif
  440. ifstr(i) $($R1) == {}
  441. set Error = $(CANNOT_FIND_ANY_CARD)
  442. set CommonStatus = STATUS_USERCANCEL
  443. set from = "end"
  444. goto nonfatal
  445. endif
  446. set AdapterList = $($R1)
  447. ;
  448. ; Install Software Component
  449. ;
  450. ifint $(OldVersionExisted) == $(FALSE)
  451. ifstr(i) $(!NTN_InstallMode) == "Install"
  452. Ifstr(i) $(DoCopy) == "YES"
  453. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  454. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  455. Goto ShellCodeError
  456. Else-Ifstr(i) $($R0) == STATUS_FAILED
  457. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  458. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  459. goto ShellCodeError
  460. endif
  461. set Error = $($R0)
  462. Goto fatal
  463. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  464. Goto successful
  465. Endif
  466. Set SrcDir = $($R1)
  467. Endif
  468. install "Install-Option"
  469. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  470. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  471. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  472. goto ShellCodeError
  473. endif
  474. set Error = $($R0)
  475. goto fatal
  476. endif
  477. endif
  478. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  479. $(ProductSoftwareName), +
  480. $(ProductSoftwareName), +
  481. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  482. $(ProductSoftwareImagePath), "kernel", "TDI", {}, "",+
  483. $(NetEventDLL)
  484. Set OEM_ABANDON_SOFTWARE = TRUE
  485. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  486. goto ShellCodeError
  487. endif
  488. set RegistryErrorIndex = $($R0)
  489. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  490. EndWait
  491. CloseRegKey $($R1)
  492. CloseRegKey $($R2)
  493. CloseRegKey $($R3)
  494. CloseRegKey $($R4)
  495. CloseRegKey $($R5)
  496. goto fatalregistry
  497. endif
  498. ;
  499. ; At this point:
  500. ; $R1 contains the product version key handle;
  501. ; $R2 contains the NetRules subkey handle;
  502. ; $R3 contains the new Services key handle; and
  503. ; $R4 contains the Parameters key
  504. ; $R5 contains the Linkage Key
  505. ;
  506. Set SoftProductKey = $($R1)
  507. Set SoftNetRuleKey = $($R2)
  508. Set SoftServiceKey = $($R3)
  509. Set SoftParameterKey = $($R4)
  510. Set SoftLinkageKey = $($R5)
  511. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  512. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  513. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  514. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  515. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  516. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  517. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  518. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  519. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  520. goto ShellCodeError
  521. endif
  522. set RegistryErrorIndex = $($R0)
  523. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  524. EndWait
  525. CloseRegKey $(SoftProductKey)
  526. CloseRegKey $(SoftNetRuleKey)
  527. CloseRegKey $(SoftServiceKey)
  528. CloseRegKey $(SoftParameterKey)
  529. CloseRegKey $(SoftLinkageKey)
  530. goto fatalregistry
  531. endif
  532. ;
  533. ; Add the NetBIOS provider flag to the XNS\Parameters key
  534. ;
  535. Set NewValueList = {{NbProvider,$(NoTitle),$(!REG_VT_SZ),"_xns"}}
  536. Shell $(UtilityInf), AddValueList, $(SoftParameterKey), $(NewValueList)
  537. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  538. Debug-Output "OEMNADXM.INF: ShellCode error."
  539. goto ShellCodeError
  540. Endif
  541. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  542. EndWait
  543. CloseRegKey $(SoftProductKey)
  544. CloseRegKey $(SoftNetRuleKey)
  545. CloseRegKey $(SoftServiceKey)
  546. CloseRegKey $(SoftParameterKey)
  547. CloseRegKey $(SoftLinkageKey)
  548. goto fatalregistry
  549. endif
  550. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  551. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  552. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  553. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  554. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  555. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  556. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  557. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  558. goto ShellCodeError
  559. endif
  560. set RegistryErrorIndex = $($R0)
  561. CloseRegKey $(SoftProductKey)
  562. CloseRegKey $(SoftNetRuleKey)
  563. CloseRegKey $(SoftServiceKey)
  564. CloseRegKey $(SoftParameterKey)
  565. CloseRegKey $(SoftLinkageKey)
  566. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  567. EndWait
  568. goto fatalregistry
  569. endif
  570. endif
  571. ;
  572. ; Install Hardware component
  573. ;
  574. ForListDo $(AdapterList)
  575. set BusNum = *($($),1)
  576. set SlotNum = *($($),2)
  577. Debug-Output $(BusNum)
  578. Debug-Output $(SlotNum)
  579. Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  580. $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  581. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  582. goto ShellCodeError
  583. endif
  584. ifstr $($R0) != "NO_ERROR"
  585. set Error = $($R0)
  586. goto fatal
  587. endif
  588. ifstr(i) $($R1) != "YES"
  589. ;
  590. ; Create the HARDWARE\Netcard region and
  591. ; its corresponding service
  592. ;
  593. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  594. ifint $($R4) != -1
  595. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  596. endif
  597. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  598. goto ShellCodeError
  599. endif
  600. set RegistryErrorIndex = $($R0)
  601. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  602. EndWait
  603. CloseRegKey $($R1)
  604. CloseRegKey $($R2)
  605. CloseRegKey $($R3)
  606. goto fatalregistry
  607. endif
  608. ;
  609. ; At this point:
  610. ; $R1 Registry key variable for
  611. ; HARDWARE\Netcard\(n)
  612. ; $R2 Registry key variable for
  613. ; HARDWARE\Netcard\(n)\\NetRules
  614. ; $R3 Registry key handle for
  615. ; <service>\Parameters key
  616. ; $R4 Adapter number assigned to adapter
  617. ; $R5 Service name generated by combining
  618. ; svc name with adapter number
  619. ;
  620. Set HardNetCardKey = $($R1)
  621. Set HardNetRuleKey = $($R2)
  622. Set HardParameterKey = $($R3)
  623. set AdapterNumber = $($R4)
  624. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  625. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  626. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  627. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  628. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  629. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  630. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  631. Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  632. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  633. goto ShellCodeError
  634. endif
  635. set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
  636. {BusType,$(NoTitle),$(!REG_VT_DWORD),3},+
  637. {CardType,$(NoTitle),$(!REG_VT_DWORD),3},+
  638. {McaPosId,$(NoTitle),$(!REG_VT_DWORD),$(NETCARD_ID)},+
  639. {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  640. {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)}}
  641. Shell $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  642. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  643. goto ShellCodeError
  644. endif
  645. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  646. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  647. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  648. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  649. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  650. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  651. Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  652. CloseRegKey $(HardNetCardKey)
  653. CloseRegKey $(HardNetRuleKey)
  654. CloseRegKey $(HardParameterKey)
  655. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  656. goto ShellCodeError
  657. endif
  658. endif
  659. EndForListDo
  660. goto writeparameters
  661. ;
  662. ; REQUIRED: $(KeyParameters) contains service Parameters key handle
  663. ;
  664. writeparameters = +
  665. EndWait
  666. goto successful
  667. ;-----------------------------------------------
  668. ; Binding section
  669. ;-----------------------------------------------
  670. bindingadapter =+
  671. set Error = "Binding: Not Implmemented yet"
  672. goto fatal
  673. ;-----------------------------------------------
  674. ; Removeadapter section
  675. ;-----------------------------------------------
  676. removeadapter = +
  677. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  678. ; Remove Software Component
  679. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  680. $(ProductSoftwareName)
  681. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  682. Debug-Output "ShellCode error"
  683. goto ShellCodeError
  684. endif
  685. set RegistryErrorIndex = $($R0)
  686. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  687. goto fatalregistry
  688. endif
  689. else
  690. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  691. $(ProductSoftwareName), $(!NTN_RegBase)
  692. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  693. Debug-Output "ShellCode error"
  694. goto ShellCodeError
  695. endif
  696. set RegistryErrorIndex = $($R0)
  697. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  698. goto fatalregistry
  699. endif
  700. endif
  701. goto end
  702. ; Shell $(UtilityInf) RemoveNetworkCardEntry, $(ProductHardwareName)
  703. ; ifint $($ShellCode) != $(!SHELL_CODE_OK)
  704. ; goto ShellCodeError
  705. ; endif
  706. ;-----------------------------------------------
  707. ; Upgrade Software section
  708. ;-----------------------------------------------
  709. UpgradeSoftware = +
  710. ;
  711. ; First determine whether we want to do upgrade or update for software
  712. ; or hardware component. Then we will determine whether the Mode is
  713. ; update or upgrade.
  714. ;
  715. ; If the same version of the product existed in the registry, we do
  716. ; update. Otherwise, we will do a upgrade
  717. ;
  718. ; Upgrade software component
  719. ;
  720. ; see whether the same version exist or not
  721. ;
  722. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  723. Ifstr $(KeyProduct) != $(KeyNull)
  724. install "Install-Update"
  725. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  726. goto fatal
  727. endif
  728. ; Upgrade the version number
  729. ;
  730. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  731. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  732. ;
  733. ; do nothing for update
  734. ;
  735. CloseRegKey $(KeyProduct)
  736. else
  737. ;
  738. ; Cannot Open software key, goto ERROR
  739. ;
  740. goto fatalregistry
  741. endif
  742. ;
  743. ; Enumerate all netcards installed of this type and update them
  744. ;
  745. set iSearch = 1
  746. nextnetcard = +
  747. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  748. set KeyNetcard = $($R0)
  749. set iSearch = $($R1)
  750. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  751. Ifstr $(KeyNetcard) != $(KeyNull)
  752. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  753. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  754. CloseRegKey $(KeyNetcard)
  755. goto nextnetcard
  756. Endif
  757. goto end
  758. ;
  759. ; End of Upgrade Software
  760. ;
  761. ;
  762. ; Escape hatches
  763. ;
  764. successful = +
  765. goto end
  766. abandon = +
  767. ForListDo $(OEM_ABANDON_OPTIONS)
  768. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  769. $(ProductSoftwareName), $($)
  770. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  771. Debug-Output "ShellCode error"
  772. goto ShellCodeError
  773. endif
  774. set RegistryErrorIndex = $($R0)
  775. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  776. goto fatalregistry
  777. endif
  778. EndForListDo
  779. Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  780. ; Remove Software Component
  781. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  782. $(ProductSoftwareName), FALSE
  783. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  784. Debug-Output "ShellCode error"
  785. goto ShellCodeError
  786. endif
  787. set RegistryErrorIndex = $($R0)
  788. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  789. goto fatalregistry
  790. endif
  791. endif
  792. goto end
  793. ;
  794. ; warning display
  795. ;
  796. warning = +
  797. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  798. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  799. goto ShellCodeError
  800. endif
  801. ifstr(i) $($R1) == "OK"
  802. goto $(to)
  803. else-ifstr(i) $($R1) == "CANCEL"
  804. goto $(from)
  805. else
  806. ; Debug-Msg "Error Error Bad DLGEVENT"
  807. goto "end"
  808. endif
  809. ;
  810. ; non fatal error display
  811. ;
  812. nonfatalinfo = +
  813. Set CommonStatus = STATUS_USERCANCEL
  814. Set Severity = STATUS
  815. goto nonfatalmsg
  816. nonfatal = +
  817. Set Severity = NONFATAL
  818. goto nonfatalmsg
  819. nonfatalmsg = +
  820. ifstr(i) $(Error) == ""
  821. Set Severity = NONFATAL
  822. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  823. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  824. goto ShellCodeError
  825. endif
  826. set Error = $($R0)
  827. endif
  828. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  829. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  830. goto ShellCodeError
  831. endif
  832. ifstr(i) $($R1) == "OK"
  833. goto $(from)
  834. else
  835. goto "end"
  836. endif
  837. ;
  838. ; Registry is broken
  839. ;
  840. fatalregistry = +
  841. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  842. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  843. goto ShellCodeError
  844. endif
  845. set Error = $($R0)
  846. goto fatal
  847. ;
  848. ; fatal error display
  849. ;
  850. fatal = +
  851. ifstr(i) $(Error) == ""
  852. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  853. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  854. goto ShellCodeError
  855. endif
  856. set Error = $($R0)
  857. endif
  858. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  859. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  860. goto ShellCodeError
  861. endif
  862. goto setfailed
  863. ;
  864. ; Shelling error
  865. ;
  866. ShellCodeError = +
  867. set DlgType = "MessageBox"
  868. set STF_MB_TITLE = "Error: "$(FunctionTitle)
  869. set STF_MB_TEXT = "Shell Code Error"
  870. set STF_MB_TYPE = 1
  871. set STF_MB_ICON = 3
  872. set STF_MB_DEF = 1
  873. ui start "Error Message"
  874. goto setfailed
  875. setfailed = +
  876. set CommonStatus = STATUS_FAILED
  877. ;
  878. ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  879. ;
  880. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  881. set OEM_ABANDON_ON = FALSE
  882. goto abandon
  883. endif
  884. goto end
  885. end = +
  886. goto term
  887. term = +
  888. Return $(CommonStatus)
  889. ;***************************************************************
  890. ; INSTALL SECTIONS
  891. ;***************************************************************
  892. [Install-Option]
  893. set STF_VITAL = ""
  894. ifstr(i) $(AddCopy) == "YES"
  895. ;
  896. ; Add the files to the copy list
  897. ;
  898. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  899. ; the other INF files
  900. ;
  901. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  902. AddSectionFilesToCopyList Files-exmb $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  903. endif
  904. ifstr(i) $(DoCopy) == "YES"
  905. ;
  906. ; Copy files in the copy list
  907. ;
  908. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  909. CopyFilesInCopyList
  910. endif
  911. ifstr(i) $(DoConfig) == "YES"
  912. ;
  913. ; Add product to registry
  914. ;
  915. ;
  916. ; Finish up
  917. endif
  918. Exit
  919. [Install-Update]
  920. set STF_VITAL = ""
  921. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  922. ;set STF_VERSION = "YES"
  923. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  924. AddSectionFilesToCopyList Files-exmb $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  925. exit