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.

1079 lines
31 KiB

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