Windows NT 4.0 source code leak
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.

1474 lines
44 KiB

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