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.

1034 lines
31 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADTM.INF
  4. ;
  5. ; IBM Token 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 IBMTOK MC setup
  12. ; terryk 02-Apr-1992 Code review changed
  13. ; davidhov 03-Apr-1992 Enhanced to use new INF section
  14. ; structure from SunilP, et al.
  15. ;
  16. ;***********************************************************************
  17. ;-----------------------------------------------------------------------
  18. ; OPTION TYPE
  19. ; -----------
  20. ; This identifies the Option type we are dealing with. The different
  21. ; possible types are:
  22. ;
  23. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  24. ;
  25. ; Types specific to networking:
  26. ;
  27. ; NetAdapter, a netcard / adapter combination or just a netcard
  28. ; NetDriver, just a netcard driver
  29. ; NetTransport, a complete NDIS-compliant TDI transport stack
  30. ; NetService, an NT networking service
  31. ; NetWork, a complete network ensemble.
  32. ; NetProvider a complete network which supports NT MPR protocol
  33. ;-----------------------------------------------------------------------
  34. [Identification]
  35. OptionType = NetAdapter
  36. ;-----------------------------------------------------------------------
  37. ; PlatformsSupported
  38. ; ------------------
  39. ; This identifies the platforms supported by the adapter card.
  40. ; Possible types are:
  41. ;
  42. ; ISA, EISA and MCA
  43. ;-----------------------------------------------------------------------
  44. [PlatformsSupported]
  45. MCA
  46. ;-----------------------------------------------------------------------
  47. ; OPTION LIST
  48. ; -----------
  49. ; This section lists the OEM Option key names. These keys are locale
  50. ; independent and used to represent the option in a locale independent
  51. ; manner.
  52. ;
  53. ;-----------------------------------------------------------------------
  54. [Options]
  55. IBMTOKMC
  56. IBMTOKA
  57. ;***********************************************************************
  58. ; CONSTANTS FOR USING DIALOGS
  59. ;***********************************************************************
  60. [FileConstants]
  61. ;
  62. ; File names, etc.
  63. ;
  64. UtilityInf = "UTILITY.INF"
  65. subroutineinf = "SUBROUTN.INF"
  66. SoftwareType = "driver"
  67. Exit_Code = 0
  68. ;ShellCode = 0
  69. ;
  70. ; EventLog Message File
  71. ;
  72. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  73. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  74. IBMTOKMC_1BYTE = 1
  75. IBMTOKMC_2BYTE = 224
  76. IBMTOKMC_ID = 57345
  77. IBMTOKA_1BYTE = 0
  78. IBMTOKA_2BYTE = 224
  79. IBMTOKA_ID = 57344
  80. ;
  81. ; Product Info
  82. ;
  83. Manufacturer = "Microsoft"
  84. ProductMajorVersion = "4"
  85. ProductMinorVersion = "0"
  86. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  87. ;
  88. ; Software
  89. ;
  90. ProductSoftwareName = "IbmTok"
  91. ProductSoftwareImagePath = "\SystemRoot\system32\drivers\ibmtok.sys"
  92. NetRuleSoftwareType = "ibmtokSys ndisDriver ibmtokDriver"
  93. NetRuleSoftwareUse = $(SoftwareType)
  94. NetRuleSoftwareBindForm = """IBMTokSys"" yes no container"
  95. NetRuleSoftwareClass = {"ibmtokriver basic"}
  96. NetRuleSoftwareBindable = {"ibmtokDriver ibmtokAdapter non exclusive 100",+
  97. "ibmtokDriver ibmtokmcAdapter non exclusive 100"}
  98. ;
  99. ; Hardware
  100. ;
  101. ProductHardwareName = "IbmTokMC"
  102. NetRuleHardwareType = "ibmtokmc ibmtokmcAdapter"
  103. NetRuleHardwareBindForm = " yes yes container"
  104. NetRuleHardwareClass = {"ibmtokmcAdapter basic"}
  105. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  106. ;
  107. ; Registry Key
  108. ;
  109. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  110. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  111. [GeneralConstants]
  112. ;
  113. ; Program flow control variables.
  114. ;
  115. from = ""
  116. to = ""
  117. ;
  118. ; Return codes; Exit_Code is set to one of these
  119. ;
  120. ExitCodeOk = 0
  121. ExitCodeCancel = 1
  122. ExitCodeFatal = 2
  123. KeyNull = ""
  124. MAXIMUM_ALLOWED = 33554432
  125. RegistryErrorIndex = NO_ERROR
  126. KeyProduct = ""
  127. KeyParameters = ""
  128. TRUE = 1
  129. FALSE = 0
  130. NoTitle = 0
  131. ExitState = "Active"
  132. OldVersionExisted = $(FALSE)
  133. DriverPath = $(!STF_NTPATH)\drivers
  134. [date]
  135. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  136. ; Minute, Second }
  137. Now = {} ? $(!LIBHANDLE) GetSystemDate
  138. ;---------------------------------------------------------------------------
  139. ; 1. Identify
  140. ;
  141. ; DESCRIPTION: To verify that this INF deals with the same type of options
  142. ; as we are choosing currently.
  143. ;
  144. ; INPUT: None
  145. ;
  146. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  147. ; $($R1): Option Type (COMPUTER ...)
  148. ; $($R2): Diskette description
  149. ;---------------------------------------------------------------------------
  150. [Identify]
  151. ;
  152. ;
  153. read-syms Identification
  154. set Status = STATUS_SUCCESSFUL
  155. set Identifier = $(OptionType)
  156. set Media = #("Source Media Descriptions", 1, 1)
  157. Return $(Status) $(Identifier) $(Media)
  158. ;------------------------------------------------------------------------
  159. ; 2. ReturnOptions:
  160. ;
  161. ; DESCRIPTION: To return the option list supported by this INF and the
  162. ; localised text list representing the options.
  163. ;
  164. ;
  165. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  166. ;
  167. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  168. ; STATUS_NOLANGUAGE
  169. ; STATUS_FAILED
  170. ; STATUS_NOTSUPPORTED
  171. ;
  172. ; $($R1): Option List
  173. ; $($R2): Option Text List
  174. ;------------------------------------------------------------------------
  175. [ReturnOptions]
  176. ;
  177. ;
  178. set Status = STATUS_FAILED
  179. set OptionList = {}
  180. set OptionTextList = {}
  181. ;
  182. ; Check if the language requested is supported
  183. ;
  184. set LanguageList = ^(LanguagesSupported, 1)
  185. Ifcontains(i) $($0) in $(LanguageList)
  186. ;
  187. ; Check if the platforms requested is supported
  188. ;
  189. ifstr(i) $($1) == ""
  190. goto returnoptions
  191. endif
  192. set PlatformList = ^(PlatformsSupported, 1)
  193. Ifcontains(i) $($1) in $(PlatformList)
  194. goto returnoptions
  195. else
  196. set Status = STATUS_NOTSUPPORTED
  197. goto finish_ReturnOptions
  198. endif
  199. else
  200. set Status = STATUS_NOLANGUAGE
  201. goto finish_ReturnOptions
  202. endif
  203. ;
  204. ; form a list of all the options and another of the text representing
  205. ;
  206. returnoptions = +
  207. set OptionList = ^(Options, 1)
  208. set OptionTextList = ^(OptionsText$($0), 1)
  209. set Status = STATUS_SUCCESSFUL
  210. finish_ReturnOptions = +
  211. Return $(Status) $(OptionList) $(OptionTextList)
  212. ;----------InstallOption-------------------------------------------------
  213. ;
  214. ; InstallOption:
  215. ;
  216. ; This section is shelled to by main installation processing
  217. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  218. ;
  219. ;
  220. ; FUNCTION: To copy files representing Options
  221. ; To configure the installed option
  222. ; To update the registry for the installed option
  223. ;
  224. ; INPUT: $($0): Language to use
  225. ; $($1): OptionID to install
  226. ; $($2): SourceDirectory
  227. ; $($3): AddCopy (YES | NO)
  228. ; $($4): DoCopy (YES | NO)
  229. ; $($5): DoConfig (YES | NO)
  230. ;
  231. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  232. ; STATUS_NOLANGUAGE |
  233. ; STATUS_USERCANCEL |
  234. ; STATUS_FAILED
  235. ;
  236. ;------------------------------------------------------------------------
  237. [InstallOption]
  238. ;
  239. ; extract parameters
  240. ;
  241. set Option = $($1)
  242. set SrcDir = $($2)
  243. set AddCopy = $($3)
  244. set DoCopy = $($4)
  245. set DoConfig = $($5)
  246. ;
  247. ; Check if the language requested is supported
  248. ;
  249. set LanguageList = ^(LanguagesSupported, 1)
  250. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  251. Return STATUS_NOLANGUAGE
  252. endif
  253. Debug-Output "OEMNADTM.INF: STF_CWDIR is: "$(!STF_CWDIR)
  254. Debug-Output "OEMNADTM.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  255. ; define all the constants
  256. set-subst LF = "\n"
  257. read-syms GeneralConstants
  258. read-syms FileConstants
  259. read-syms DialogConstants$(!STF_LANGUAGE)
  260. read-syms FileConstants$(!STF_LANGUAGE)
  261. detect date
  262. set-title $(FunctionTitle)
  263. set to = Begin
  264. set from = Begin
  265. ;
  266. ; Assume all is well.
  267. ;
  268. set CommonStatus = STATUS_SUCCESSFUL
  269. EndWait
  270. ;
  271. ; Set up the operation-mode-based variables and gaily welcome
  272. ; the user. If the "install mode" variable is improperly set,
  273. ; assume this is a new installation.
  274. ;
  275. Begin = +
  276. Ifstr(i) $(!NTN_InstallMode) == deinstall
  277. set StartLabel = removeadapter
  278. else-Ifstr(i) $(!NTN_InstallMode) == Update
  279. set StartLabel = UpgradeSoftware
  280. else-Ifstr(i) $(!NTN_InstallMode) == bind
  281. set StartLabel = bindingadapter
  282. else-Ifstr(i) $(!NTN_InstallMode) == configure
  283. set CommonStatus = STATUS_REBOOT
  284. ;
  285. ; You cannot config the software component
  286. ;
  287. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  288. Debug-Output "Cannot configure the ibm token ring driver software."
  289. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  290. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  291. Debug-Output "ShellCode error: cannot get an error string."
  292. goto ShellCodeError
  293. endif
  294. set Error = $($R0)
  295. set from = end
  296. set to = end
  297. goto nonfatalinfo
  298. endif
  299. set StartLabel = configureadapter
  300. else
  301. set StartLabel = installadapter
  302. set OEM_ABANDON_OPTIONS = {}
  303. set OEM_ABANDON_SOFTWARE = FALSE
  304. set OEM_ABANDON_ON = TRUE
  305. endif
  306. set from = $(fatal)
  307. set to = $(fatal)
  308. goto $(StartLabel)
  309. ;-----------------------------------------------
  310. ; Installation Section
  311. ;-----------------------------------------------
  312. installadapter = +
  313. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  314. Ifstr $(KeyProduct) != $(KeyNull)
  315. ;
  316. ; Same version already existed in the local machine
  317. ; Popup the dialog and ask the user whether he wants to continue
  318. ;
  319. CloseRegKey $(KeyProduct)
  320. ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  321. ;
  322. ; Cannot Install the same software again
  323. ;
  324. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  325. $(ProductVersion)
  326. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  327. Debug-Output "ShellCode error: cannot get an error string."
  328. goto ShellCodeError
  329. endif
  330. goto end
  331. else
  332. ;
  333. ; Add a new adapter card?
  334. ;
  335. Shell $(UtilityInf), CardExistedDlg
  336. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  337. Debug-Output "ShellCode error: cannot get an error string."
  338. goto ShellCodeError
  339. endif
  340. ifstr(i) $($R1) != "OK"
  341. Set CommonStatus = STATUS_USERCANCEL
  342. goto end
  343. endif
  344. set OldVersionExisted = $(TRUE)
  345. endif
  346. endif
  347. goto nextstep
  348. ;-----------------------------------------------
  349. ; Configuration Section
  350. ;-----------------------------------------------
  351. configureadapter = +
  352. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) NetCardKey
  353. ifstr(i) $(NetCardKey) == ""
  354. set CommonStatus = STATUS_USERCANCEL
  355. goto successful
  356. endif
  357. GetRegValue $(NetCardKey) "ServiceName" ServiceInfo
  358. set ServiceName = *($(ServiceInfo),4)
  359. CloseRegKey $(NetCardKey)
  360. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) ParamKey
  361. ifstr(i) $(ParamKey) != ""
  362. GetRegValue $(ParamKey),"NetworkAddress", NetworkAddressInfo
  363. set NetworkAddress = *($(NetworkAddressInfo), 4)
  364. read-syms FileDependentDlg$(!STF_LANGUAGE)
  365. ui start "NetworkAddress"
  366. ifstr(i) $(DLGEVENT) == "CONTINUE"
  367. set NetworkAddress = *($(EditTextOut),1)
  368. SetRegValue $(ParamKey) {NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)}
  369. ui pop 1
  370. else
  371. set CommonStatus = STATUS_USERCANCEL
  372. ui pop 1
  373. endif
  374. CloseRegKey $(ParamKey)
  375. endif
  376. goto successful
  377. ;
  378. ; If installing, go create the necessary keys;
  379. ; if configuring, they're already open.
  380. ;
  381. nextstep = +
  382. StartWait
  383. installproduct = +
  384. ifstr(i) $(Option) == "IBMTOKMC"
  385. ;
  386. ; Find new version of the card, E001
  387. ;
  388. set NETCARD_ID = $(IBMTOKMC_ID)
  389. Shell $(UtilityInf), MCAFindBus, $(IBMTOKMC_1BYTE), $(IBMTOKMC_2BYTE)
  390. else
  391. set NETCARD_ID = $(IBMTOKA_ID)
  392. Shell $(UtilityInf), MCAFindBus, $(IBMTOKA_1BYTE), $(IBMTOKA_2BYTE)
  393. endif
  394. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  395. goto ShellCodeError
  396. endif
  397. ifstr $($R0) != "NO_ERROR"
  398. set Error = $($R0)
  399. goto fatal
  400. endif
  401. ifstr(i) $($R1) == {}
  402. set Error = $(CANNOT_FIND_ANY_CARD)
  403. set CommonStatus = STATUS_USERCANCEL
  404. set from = "end"
  405. goto nonfatal
  406. endif
  407. set AdapterList = $($R1)
  408. ;
  409. ; Install Software Component
  410. ;
  411. ifint $(OldVersionExisted) == $(FALSE)
  412. ifstr(i) $(!NTN_InstallMode) == "install"
  413. Ifstr(i) $(DoCopy) == "YES"
  414. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  415. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  416. Goto ShellCodeError
  417. Else-Ifstr(i) $($R0) == STATUS_FAILED
  418. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  419. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  420. goto ShellCodeError
  421. endif
  422. set Error = $($R0)
  423. Goto fatal
  424. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  425. Goto successful
  426. Endif
  427. Set SrcDir = $($R1)
  428. Endif
  429. install "Install-Option"
  430. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  431. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  432. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  433. goto ShellCodeError
  434. endif
  435. set Error = $($R0)
  436. goto fatal
  437. endif
  438. endif
  439. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  440. $(ProductSoftwareName), +
  441. $(ProductSoftwareName), +
  442. $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  443. $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  444. $(NetEventDLL)
  445. Set OEM_ABANDON_SOFTWARE = TRUE
  446. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  447. goto ShellCodeError
  448. endif
  449. set RegistryErrorIndex = $($R0)
  450. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  451. EndWait
  452. CloseRegKey $($R1)
  453. CloseRegKey $($R2)
  454. CloseRegKey $($R3)
  455. CloseRegKey $($R4)
  456. CloseRegKey $($R5)
  457. goto fatalregistry
  458. endif
  459. ;
  460. ; At this point:
  461. ; $R1 contains the product version key handle;
  462. ; $R2 contains the NetRules subkey handle;
  463. ; $R3 contains the new Services key handle; and
  464. ; $R4 contains the Parameters key
  465. ; $R5 contains the Linkage Key
  466. ;
  467. Set SoftProductKey = $($R1)
  468. Set SoftNetRuleKey = $($R2)
  469. Set SoftServiceKey = $($R3)
  470. Set SoftParameterKey = $($R4)
  471. Set SoftLinkageKey = $($R5)
  472. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  473. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  474. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  475. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  476. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  477. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  478. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  479. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  480. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  481. goto ShellCodeError
  482. endif
  483. set RegistryErrorIndex = $($R0)
  484. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  485. EndWait
  486. CloseRegKey $(SoftProductKey)
  487. CloseRegKey $(SoftNetRuleKey)
  488. CloseRegKey $(SoftServiceKey)
  489. CloseRegKey $(SoftParameterKey)
  490. CloseRegKey $(SoftLinkageKey)
  491. goto fatalregistry
  492. endif
  493. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  494. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  495. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  496. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  497. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  498. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  499. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  500. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  501. goto ShellCodeError
  502. endif
  503. set RegistryErrorIndex = $($R0)
  504. CloseRegKey $(SoftProductKey)
  505. CloseRegKey $(SoftNetRuleKey)
  506. CloseRegKey $(SoftServiceKey)
  507. CloseRegKey $(SoftParameterKey)
  508. CloseRegKey $(SoftLinkageKey)
  509. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  510. EndWait
  511. goto fatalregistry
  512. endif
  513. endif
  514. ;
  515. ; Install Hardware Component
  516. ;
  517. ForListDo $(AdapterList)
  518. set BusNum = *($($),1)
  519. set SlotNum = *($($),2)
  520. Debug-Output $(BusNum)
  521. Debug-Output $(SlotNum)
  522. Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  523. $(SlotNum), $(ProductHardware$(Option)Description), $(ProductHardwareName)
  524. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  525. goto ShellCodeError
  526. endif
  527. ifstr $($R0) != "NO_ERROR"
  528. set Error = $($R0)
  529. goto fatal
  530. endif
  531. ifstr(i) $($R1) != "YES"
  532. ;
  533. ; Create the HARDWARE\Netcard region and
  534. ; its corresponding service
  535. ;
  536. Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  537. ifint $($R4) != -1
  538. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  539. endif
  540. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  541. goto ShellCodeError
  542. endif
  543. set RegistryErrorIndex = $($R0)
  544. Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  545. EndWait
  546. CloseRegKey $($R1)
  547. CloseRegKey $($R2)
  548. CloseRegKey $($R3)
  549. goto fatalregistry
  550. endif
  551. ;
  552. ; At this point:
  553. ; $R1 Registry key variable for
  554. ; HARDWARE\Netcard\(n)
  555. ; $R2 Registry key variable for
  556. ; HARDWARE\Netcard\(n)\\NetRules
  557. ; $R3 Registry key handle for
  558. ; <service>\Parameters key
  559. ; $R4 Adapter number assigned to adapter
  560. ; $R5 Service name generated by combining
  561. ; svc name with adapter number
  562. ;
  563. Set HardNetCardKey = $($R1)
  564. Set HardNetRuleKey = $($R2)
  565. Set HardParameterKey = $($R3)
  566. set AdapterNumber = $($R4)
  567. set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  568. {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  569. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  570. {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  571. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  572. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  573. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  574. Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  575. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  576. goto ShellCodeError
  577. endif
  578. ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  579. NetworkAddress = ""
  580. goto WriteNetworkAddr
  581. endif
  582. read-syms FileDependentDlg$(!STF_LANGUAGE)
  583. ui start "NetworkAddress"
  584. set NetworkAddress = *($(EditTextOut),1)
  585. WriteNetworkAddr = +
  586. set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
  587. {MediaType,$(NoTitle),$(!REG_VT_DWORD),2},+
  588. {NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)},+
  589. {McaPosId,$(NoTitle),$(!REG_VT_DWORD),$(NETCARD_ID)},+
  590. {BusType,$(NoTitle),$(!REG_VT_DWORD),3},+
  591. {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)}}
  592. Shell $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  593. ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  594. Shell $(UtilityInf),AddDefaultNetCardParameters,$(HardParameterKey)
  595. endif
  596. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  597. goto ShellCodeError
  598. endif
  599. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  600. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  601. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  602. {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  603. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  604. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  605. Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  606. CloseRegKey $(HardNetCardKey)
  607. CloseRegKey $(HardNetRuleKey)
  608. CloseRegKey $(HardParameterKey)
  609. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  610. goto ShellCodeError
  611. endif
  612. endif
  613. EndForListDo
  614. goto writeparameters
  615. ;
  616. ; REQUIRED: $(KeyParameters) contains service Parameters key handle
  617. ;
  618. writeparameters = +
  619. EndWait
  620. goto successful
  621. ;-----------------------------------------------
  622. ; Binding section
  623. ;-----------------------------------------------
  624. bindingadapter =+
  625. set Error = "Binding: Sorry, not yet implemented."
  626. goto fatal
  627. ;-----------------------------------------------
  628. ; Removeadapter section
  629. ;-----------------------------------------------
  630. removeadapter = +
  631. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  632. ; Remove Software Component
  633. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  634. $(ProductSoftwareName)
  635. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  636. Debug-Output "ShellCode error"
  637. goto ShellCodeError
  638. endif
  639. set RegistryErrorIndex = $($R0)
  640. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  641. goto fatalregistry
  642. endif
  643. else
  644. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  645. $(ProductSoftwareName), $(!NTN_RegBase)
  646. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  647. Debug-Output "ShellCode error"
  648. goto ShellCodeError
  649. endif
  650. set RegistryErrorIndex = $($R0)
  651. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  652. goto fatalregistry
  653. endif
  654. endif
  655. goto end
  656. ;Shell $(UtilityInf) RemoveNetworkCardEntry, $(ProductHardwareName)
  657. ;ifint $($ShellCode) != $(!SHELL_CODE_OK)
  658. ; goto ShellCodeError
  659. ;endif
  660. ;-----------------------------------------------
  661. ; Upgrade Software section
  662. ;-----------------------------------------------
  663. UpgradeSoftware = +
  664. ;
  665. ; First determine whether we want to do upgrade or update for software
  666. ; or hardware component. Then we will determine whether the Mode is
  667. ; update or upgrade.
  668. ;
  669. ; If the same version of the product existed in the registry, we do
  670. ; update. Otherwise, we will do a upgrade
  671. ;
  672. ; Upgrade software component
  673. ;
  674. ; see whether the same version exist or not
  675. ;
  676. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  677. Ifstr $(KeyProduct) != $(KeyNull)
  678. install "Install-Update"
  679. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  680. goto fatal
  681. endif
  682. ; Upgrade the version number
  683. ;
  684. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  685. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  686. ;
  687. ; do nothing for update
  688. ;
  689. CloseRegKey $(KeyProduct)
  690. else
  691. ;
  692. ; Cannot Open software key, goto ERROR
  693. ;
  694. goto fatalregistry
  695. endif
  696. ;
  697. ; Enumerate all netcards installed of this type and update them
  698. ;
  699. set iSearch = 1
  700. nextnetcard = +
  701. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  702. set KeyNetcard = $($R0)
  703. set iSearch = $($R1)
  704. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  705. Ifstr $(KeyNetcard) != $(KeyNull)
  706. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  707. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  708. CloseRegKey $(KeyNetcard)
  709. goto nextnetcard
  710. Endif
  711. goto end
  712. ;
  713. ; End of Upgrade Software
  714. ;
  715. ;
  716. ; Escape hatches
  717. ;
  718. successful = +
  719. goto end
  720. abandon = +
  721. ForListDo $(OEM_ABANDON_OPTIONS)
  722. Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  723. $(ProductSoftwareName), $($)
  724. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  725. Debug-Output "ShellCode error"
  726. goto ShellCodeError
  727. endif
  728. set RegistryErrorIndex = $($R0)
  729. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  730. goto fatalregistry
  731. endif
  732. EndForListDo
  733. Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  734. ; Remove Software Component
  735. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  736. $(ProductSoftwareName), FALSE
  737. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  738. Debug-Output "ShellCode error"
  739. goto ShellCodeError
  740. endif
  741. set RegistryErrorIndex = $($R0)
  742. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  743. goto fatalregistry
  744. endif
  745. endif
  746. goto end
  747. ;
  748. ; warning display
  749. ;
  750. warning = +
  751. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  752. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  753. goto ShellCodeError
  754. endif
  755. ifstr(i) $($R1) == "OK"
  756. goto $(to)
  757. else-ifstr(i) $($R1) == "CANCEL"
  758. goto $(from)
  759. else
  760. ; Debug-Msg "Error Error Bad DLGEVENT"
  761. goto "end"
  762. endif
  763. ;
  764. ; non fatal error display
  765. ;
  766. nonfatalinfo = +
  767. Set CommonStatus = STATUS_USERCANCEL
  768. Set Severity = STATUS
  769. goto nonfatalmsg
  770. nonfatal = +
  771. Set Severity = NONFATAL
  772. goto nonfatalmsg
  773. nonfatalmsg = +
  774. ifstr(i) $(Error) == ""
  775. Set Severity = NONFATAL
  776. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  777. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  778. goto ShellCodeError
  779. endif
  780. set Error = $($R0)
  781. endif
  782. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  783. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  784. goto ShellCodeError
  785. endif
  786. ifstr(i) $($R1) == "OK"
  787. goto $(from)
  788. else
  789. goto "end"
  790. endif
  791. ;
  792. ; Registry is broken
  793. ;
  794. fatalregistry = +
  795. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  796. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  797. goto ShellCodeError
  798. endif
  799. set Error = $($R0)
  800. goto fatal
  801. ;
  802. ; fatal error display
  803. ;
  804. fatal = +
  805. ifstr(i) $(Error) == ""
  806. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  807. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  808. goto ShellCodeError
  809. endif
  810. set Error = $($R0)
  811. endif
  812. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  813. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  814. goto ShellCodeError
  815. endif
  816. goto setfailed
  817. ;
  818. ; Shelling error
  819. ;
  820. ShellCodeError = +
  821. set DlgType = "MessageBox"
  822. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  823. set STF_MB_TEXT = $(ShellCodeErrorText)
  824. set STF_MB_TYPE = 1
  825. set STF_MB_ICON = 3
  826. set STF_MB_DEF = 1
  827. ui start "Error Message"
  828. goto setfailed
  829. setfailed = +
  830. set CommonStatus = STATUS_FAILED
  831. ;
  832. ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  833. ;
  834. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  835. set OEM_ABANDON_ON = FALSE
  836. goto abandon
  837. endif
  838. goto end
  839. end = +
  840. goto term
  841. term = +
  842. Return $(CommonStatus)
  843. ;***************************************************************
  844. ; INSTALL SECTIONS
  845. ;***************************************************************
  846. [Install-Option]
  847. set STF_VITAL = ""
  848. ifstr(i) $(AddCopy) == "YES"
  849. ;
  850. ; Add the files to the copy list
  851. ;
  852. ; BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  853. ; the other INF files
  854. ;
  855. AddSectionFilesToCopyList Files-IBMTOKMC $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  856. endif
  857. ifstr(i) $(DoCopy) == "YES"
  858. ;
  859. ; Copy files in the copy list
  860. ;
  861. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  862. CopyFilesInCopyList
  863. endif
  864. ifstr(i) $(DoConfig) == "YES"
  865. ;
  866. ; Add product to registry
  867. ;
  868. ;
  869. ; Finish up
  870. endif
  871. Exit
  872. [Install-Update]
  873. set STF_VITAL = ""
  874. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  875. ;set STF_VERSION = "YES"
  876. AddSectionFilesToCopyList Files-IBMTOKMC $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  877. exit