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.

1042 lines
31 KiB

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