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.

1375 lines
41 KiB

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