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.

1260 lines
37 KiB

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