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.

1195 lines
34 KiB

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