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.

1472 lines
44 KiB

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