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.

1517 lines
52 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADDI.INF
  4. ;
  5. ; DigiBoard ISDN Setup INF
  6. ;
  7. ; History:
  8. ;***********************************************************************
  9. ;-----------------------------------------------------------------------
  10. ; OPTION TYPE
  11. ; -----------
  12. ;
  13. ; NetAdapter, a netcard / adapter combination or just a netcard
  14. ;-----------------------------------------------------------------------
  15. [Identification]
  16. OptionType = NetAdapter
  17. ;-----------------------------------------------------------------------
  18. ; PlatformsSupported
  19. ; ------------------
  20. ; This identifies the platforms supported by the adapter card.
  21. ; Possible types are:
  22. ;
  23. ; ISA, EISA and MCA
  24. ;-----------------------------------------------------------------------
  25. [PlatformsSupported]
  26. ISA
  27. EISA
  28. MCA
  29. "Jazz-Internal Bus"
  30. ;-----------------------------------------------------------------------
  31. ; LANGUAGES SUPPORTED
  32. ; -------------------
  33. ;
  34. ; The languages supported by the OEM INF, For every language supported
  35. ; we need to have a separate text section for every displayable text
  36. ; section.
  37. ;
  38. ;-----------------------------------------------------------------------
  39. [LanguagesSupported]
  40. ENG
  41. ;-----------------------------------------------------------------------
  42. ; OPTION LIST
  43. ; -----------
  44. ; This section lists the OEM Option key names. These keys are locale
  45. ; independent and used to represent the option in a locale independent
  46. ; manner.
  47. ;
  48. ;-----------------------------------------------------------------------
  49. [Options]
  50. DATAFIREU
  51. DATAFIREST
  52. DATAFIRE4ST
  53. PCIMACISA
  54. PCIMAC4
  55. [OptionsMCA]
  56. PCIMACMC
  57. [AdapterInfoMCA]
  58. ; MCA POS MCA POS MCA POS
  59. ; ID Byte 1 Byte 2
  60. ; ------- ------- -------
  61. PCIMACMC = {32670}, {158}, {127}
  62. ;***********************************************************************
  63. ; CONSTANTS FOR USING DIALOGS
  64. ;***********************************************************************
  65. [FileConstants]
  66. ;
  67. ; File names, etc.
  68. ;
  69. UtilityInf = "UTILITY.INF"
  70. ParamInf = "NCPARAM.INF"
  71. subroutineinf = "SUBROUTN.INF"
  72. InfFileName = "OEMNADDI.INF"
  73. SoftwareType = "driver"
  74. Exit_Code = 0
  75. DIGIHANDLE = 0
  76. ;
  77. ; EventLog Message File
  78. ;
  79. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  80. IoLogMsgDLL = "%SystemRoot%\System32\IoLogMsg.dll"
  81. ; Product Info
  82. ;
  83. Manufacturer = "DigiBoard"
  84. ProductMajorVersion = "4"
  85. ProductMinorVersion = "0"
  86. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  87. ;
  88. ; Software
  89. ;
  90. ProductSoftwareName = "Pcimac"
  91. ProductSoftwareTitle = "Digi ISDN Adapter Driver"
  92. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\pcimac.sys"
  93. NetRuleSoftwareType = "pcimacSys ndisDriver pcimacDriver"
  94. NetRuleSoftwareUse = $(SoftwareType)
  95. NetRuleSoftwareBindForm = """PcimacSys"" yes no container"
  96. NetRuleSoftwareClass = {"pcimacDriver basic"}
  97. NetRuleSoftwareBindable = {"pcimacDriver pcimacAdapter non exclusive 100"}
  98. ;
  99. ; Hardware
  100. ;
  101. ProductHardwareName = "Pcimac"
  102. ProductHardwareTitle = "Digi ISDN Adapter"
  103. NetRuleHardwareType = "pcimac pcimacAdapter"
  104. NetRuleHardwareBindForm = " yes yes container"
  105. NetRuleHardwareClass = {"pcimacAdapter basic"}
  106. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  107. ;
  108. ; Registry Key
  109. ;
  110. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  111. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  112. AdapterList = ^(AdapterInfo$(BusType),0)
  113. AdapterHardwareAdapterIDList = ^(AdapterInfo$(BusType), 1)
  114. AdapterIDByte1List = ^(AdapterInfo$(BusType), 2)
  115. AdapterIDByte2List = ^(AdapterInfo$(BusType), 3)
  116. AdapterHardwareAdapterID = *($(AdapterHardwareAdapterIDList), ~($(AdapterList), $(Option)))
  117. AdapterIDByte1 = *($(AdapterIDByte1List), ~($(AdapterList), $(Option)))
  118. AdapterIDByte2 = *($(AdapterIDByte2List), ~($(AdapterList), $(Option)))
  119. AdapterHardwareName = pcimac
  120. [GeneralConstants]
  121. ;
  122. ; Program flow control variables.
  123. ;
  124. from = ""
  125. to = ""
  126. ;
  127. ; Return codes; Exit_Code is set to one of these
  128. ;
  129. ExitCodeOk = 0
  130. ExitCodeCancel = 1
  131. ExitCodeFatal = 2
  132. KeyNull = ""
  133. !MAXIMUM_ALLOWED = 33554432
  134. RegistryErrorIndex = NO_ERROR
  135. KeyProduct = ""
  136. KeyParameters = ""
  137. TRUE = 1
  138. FALSE = 0
  139. NoTitle = 0
  140. ExitState = "Active"
  141. OldVersionExisted = $(FALSE)
  142. DriverPath = $(!STF_NTPATH)\drivers
  143. CopyFirmwareOnly = $(TRUE)
  144. [date]
  145. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  146. ; Minute, Second }
  147. Now = {} ? $(!LIBHANDLE) GetSystemDate
  148. ;---------------------------------------------------------------------------
  149. ; 1. Identify
  150. ;
  151. ; DESCRIPTION: To verify that this INF deals with the same type of options
  152. ; as we are choosing currently.
  153. ;
  154. ; INPUT: None
  155. ;
  156. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  157. ; $($R1): Option Type (COMPUTER ...)
  158. ; $($R2): Diskette description
  159. ;---------------------------------------------------------------------------
  160. [Identify]
  161. ;
  162. ;
  163. read-syms Identification
  164. set Status = STATUS_SUCCESSFUL
  165. set Identifier = $(OptionType)
  166. set Media = #("Source Media Descriptions", 1, 1)
  167. Return $(Status) $(Identifier) $(Media)
  168. ;------------------------------------------------------------------------
  169. ; 2. ReturnOptions:
  170. ;
  171. ; DESCRIPTION: To return the option list supported by this INF and the
  172. ; localised text list representing the options.
  173. ;
  174. ;
  175. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  176. ; $($1): Bus Type
  177. ;
  178. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  179. ; STATUS_NOLANGUAGE
  180. ; STATUS_FAILED
  181. ; STATUS_NOTSUPPORTED
  182. ;
  183. ; $($R1): Option List
  184. ; $($R2): Option Text List
  185. ;------------------------------------------------------------------------
  186. [ReturnOptions]
  187. read-syms GeneralConstants
  188. Debug-Output "**** OEMNADDI: Entering ReturnOptions ****"
  189. Debug-Output "NTN_InstallMode = "$(!NTN_InstallMode)
  190. set Status = STATUS_FAILED
  191. set OptionList = {}
  192. set OptionTextList = {}
  193. ;
  194. ; Check if the language requested is supported
  195. ;
  196. set LanguageList = ^(LanguagesSupported, 1)
  197. Ifcontains(i) $($0) in $(LanguageList)
  198. ;
  199. ; Check if the platforms requested is supported
  200. ;
  201. ifstr(i) $($1) == ""
  202. goto returnoptions
  203. endif
  204. set PlatformList = ^(PlatformsSupported, 1)
  205. Ifcontains(i) $($1) in $(PlatformList)
  206. goto returnoptions
  207. else
  208. set Status = STATUS_NOTSUPPORTED
  209. goto finish_ReturnOptions
  210. endif
  211. else
  212. set Status = STATUS_NOLANGUAGE
  213. goto finish_ReturnOptions
  214. endif
  215. ;
  216. ; form a list of all the options and another of the text representing
  217. ;
  218. returnoptions = +
  219. ifstr(i) $($1) == "MCA"
  220. set OptionList = ^(OptionsMCA, 1)
  221. set OptionTextList = ^(OptionsTextMCA$($0), 1)
  222. set Status = STATUS_SUCCESSFUL
  223. Debug-Output "returning: OptionList = "$(OptionList)
  224. Debug-Output " OptionTextList = "$(OptionTextList)
  225. else
  226. set OptionList = ^(Options, 1)
  227. set OptionTextList = ^(OptionsText$($0), 1)
  228. set Status = STATUS_SUCCESSFUL
  229. Debug-Output "returning: OptionList = "$(OptionList)
  230. Debug-Output " OptionTextList = "$(OptionTextList)
  231. endif
  232. finish_ReturnOptions = +
  233. Return $(Status) $(OptionList) $(OptionTextList)
  234. ;------------------------------------------------------------------------
  235. ;
  236. ; InstallOption:
  237. ;
  238. ; This section is shelled to by main installation processing
  239. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  240. ;
  241. ;
  242. ; FUNCTION: To copy files representing Options
  243. ; To configure the installed option
  244. ; To update the registry for the installed option
  245. ;
  246. ; INPUT: $($0): Language to use
  247. ; $($1): OptionID to install
  248. ; $($2): SourceDirectory
  249. ; $($3): AddCopy (YES | NO)
  250. ; $($4): DoCopy (YES | NO)
  251. ; $($5): DoConfig (YES | NO)
  252. ;
  253. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  254. ; STATUS_NOLANGUAGE |
  255. ; STATUS_USERCANCEL |
  256. ; STATUS_FAILED
  257. ;
  258. ;------------------------------------------------------------------------
  259. [InstallOption]
  260. ;
  261. ; Set default values for
  262. ;
  263. set Status = STATUS_FAILED
  264. ;
  265. ; extract parameters
  266. ;
  267. set Option = $($1)
  268. set SrcDir = $($2)
  269. set AddCopy = $($3)
  270. set DoCopy = $($4)
  271. set DoConfig = $($5)
  272. ;
  273. ; Check if the language requested is supported
  274. ;
  275. set LanguageList = ^(LanguagesSupported, 1)
  276. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  277. Return STATUS_NOLANGUAGE
  278. endif
  279. ifstr(i) $(!STF_BUSTYPE) == "MCA"
  280. set BusType = "MCA"
  281. else
  282. set BusType = ""
  283. endif
  284. set-subst LF = "\n"
  285. ; Only uncomment to force into local buffer.
  286. ; NOTE: You should be using a debugger of some type, not DR. Watson
  287. ;
  288. ; LoadLibrary "x" $(!STF_CWDDIR)digiinst.dll DIGIHANDLE
  289. ; LibraryProcedure Result, $(DIGIHANDLE), DigiDebugBreak
  290. read-syms GeneralConstants
  291. read-syms FileConstants
  292. ifstr(i) $(!NTN_Origination) == "NCPA"
  293. set Continue = "OK"
  294. endif
  295. read-syms FileConstants$(!STF_LANGUAGE)
  296. detect date
  297. set-title $(FunctionTitle)
  298. set to = Begin
  299. set from = Begin
  300. ;
  301. ; Assume all is well.
  302. ;
  303. set CommonStatus = STATUS_SUCCESSFUL
  304. EndWait
  305. Debug-Output "OEMNADDI.INF: [InstallOption]"
  306. Debug-Output " Option = "$(Option)
  307. Debug-Output " SrcDir = "$(SrcDir)
  308. Debug-Output " AddCopy = "$(AddCopy)
  309. Debug-Output " DoCopy = "$(DoCopy)
  310. Debug-Output " DoConfig = "$(DoConfig)
  311. ;
  312. ; Set up the operation-mode-based variables and gaily welcome
  313. ; the user. If the "install mode" variable is improperly set,
  314. ; assume this is a new installation.
  315. ;
  316. Begin = +
  317. set Result = {}
  318. Set ActivateDetection = FALSE
  319. Ifstr(i) $(!NTN_InstallMode) == deinstall
  320. set StartLabel = removeadapter
  321. else-Ifstr(i) $(!NTN_InstallMode) == Update
  322. set StartLabel = UpgradeSoftware
  323. else-Ifstr(i) $(!NTN_InstallMode) == bind
  324. set StartLabel = bindingadapter
  325. else-Ifstr(i) $(!NTN_InstallMode) == configure
  326. set StartLabel = configureadapter
  327. ;
  328. ; You cannot config the software component
  329. ;
  330. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  331. Debug-Output "Cannot configure the PCIMAC driver software."
  332. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  333. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  334. Debug-Output "ShellCode error: cannot get an error string."
  335. goto ShellCodeError
  336. endif
  337. set Error = $($R0)
  338. set from = end
  339. set to = end
  340. goto nonfatalinfo
  341. endif
  342. else
  343. ifstr(i) $(!STF_NCDETINFO) == {}
  344. Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardwarePCIMACDescription) $(BusInterfaceType) $(BusNumber)
  345. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  346. Debug-Output "ShellCode error."
  347. goto ShellCodeError
  348. endif
  349. ifstr(i) $($R0) != NO_ERROR
  350. set Error = $($R0)
  351. set from = end
  352. set to = end
  353. goto cancel
  354. else-ifstr(i) $($R3) == CANCEL
  355. set Error = $($R0)
  356. set from = end
  357. set to = end
  358. goto cancel
  359. endif
  360. set BusTypeNum = $($R1)
  361. else-ifstr(i) $(!STF_NCDETINFO) == ""
  362. Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardwarePCIMACDescription) $(BusInterfaceType) $(BusNumber)
  363. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  364. Debug-Output "ShellCode error."
  365. goto ShellCodeError
  366. endif
  367. ifstr(i) $($R0) != NO_ERROR
  368. set Error = $($R0)
  369. set from = end
  370. set to = end
  371. goto cancel
  372. else-ifstr(i) $($R3) == CANCEL
  373. set Error = $($R0)
  374. set from = end
  375. set to = end
  376. goto cancel
  377. endif
  378. set BusTypeNum = $($R1)
  379. else
  380. set BusTypeNum = *($(!STF_NCDETINFO),5)
  381. endif
  382. set ActivateDetection = TRUE
  383. set StartLabel = installadapter
  384. set OEM_ABANDON_OPTIONS = {}
  385. set OEM_ABANDON_SOFTWARE = FALSE
  386. set OEM_ABANDON_ON = TRUE
  387. endif
  388. ;===================================================
  389. ; Netcard Detection logic
  390. ;
  391. ; Initialize use of netcard detection;
  392. ; Construct require global parameter variables
  393. ;
  394. Debug-Output "OEMNADDI.INF: =================================================="
  395. Debug-Output "OEMNADDI.INF: STF_CWDDIR is: "$(!STF_CWDDIR)
  396. Debug-Output "OEMNADDI.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  397. Debug-Output "OEMNADDI.INF: Option is: "$(Option)
  398. Debug-Output "OEMNADDI.INF: SrcDir is: "$(SrcDir)
  399. Debug-Output "OEMNADDI.INF: !STF_NCDETECT is: "$(!STF_NCDETECT)
  400. Debug-Output "OEMNADDI.INF: !STF_NCOPTION is: "$(!STF_NCOPTION)
  401. Debug-Output "OEMNADDI.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  402. Debug-Output "OEMNADDI.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  403. Debug-Output "OEMNADDI.INF: =================================================="
  404. Set DetectedCard = FALSE
  405. Ifstr(i) $(ActivateDetection) != TRUE
  406. Goto $(StartLabel)
  407. Endif
  408. ;-----------------------------------------------
  409. ; Installation Section
  410. ;-----------------------------------------------
  411. installadapter = +
  412. ;
  413. ; First, check whether the same version of the software exists
  414. ;
  415. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(!MAXIMUM_ALLOWED) KeyProduct
  416. Debug-Output "OEMNADDI.INF: KeyProduct "$(KeyProduct)
  417. Ifstr $(KeyProduct) != $(KeyNull)
  418. ;
  419. ; Same version already existed in the local machine
  420. ; Popup the dialog and ask the user whether he wants to continue
  421. ;
  422. CloseRegKey $(KeyProduct)
  423. ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  424. ;
  425. ; Cannot Install the same software again
  426. ;
  427. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  428. $(ProductVersion)
  429. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  430. Debug-Output "ShellCode error: cannot get an error string."
  431. goto ShellCodeError
  432. endif
  433. goto end
  434. else
  435. ;
  436. ; Okay, we need to determine if this class of adapter has
  437. ; all ready been installed, or whether we need to prompt
  438. ; the user for the path to the distribution disk to copy
  439. ; the appropriate files.
  440. ;
  441. ; We need to enumerate all the PCIMAC netcard entries and determine
  442. ; if this class of adapter has all ready been installed.
  443. ;
  444. set NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  445. OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(!MAXIMUM_ALLOWED) IE_KeyNetcards
  446. ifstr(i) $(IE_KeyNetcards) != ""
  447. EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
  448. ForListDo $(IE_KeyNameList)
  449. OpenRegKey $(IE_KeyNetcards) "" *($($),1) +
  450. $(!MAXIMUM_ALLOWED) NetworkCardKey
  451. Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  452. ;
  453. ; Okay, we need see if this is a controller we support
  454. ;
  455. GetRegValue $(NetworkCardKey),"Manufacturer", ManufacturerInfo
  456. set ManufacturerName = *($(ManufacturerInfo), 4)
  457. Debug-Output " Manufacturer = "$(ManufacturerName)
  458. Ifstr $(ManufacturerName) != $(Manufacturer)
  459. ; Not ours, so skip to next
  460. goto nextnetcard2
  461. endif
  462. ;
  463. ; We need to determine if this is an option we are interested
  464. ; in.
  465. ;
  466. GetRegValue $(NetworkCardKey),"ProductName", ProductNameInfo
  467. set ProductName = *($(ProductNameInfo), 4)
  468. Debug-Output " ProductName = "$(ProductName)
  469. Ifstr(i) $(ProductName) != "PCIMAC"
  470. goto nextnetcard2
  471. endif
  472. OpenRegKey $(NetworkCardKey) "" "NetRules" +
  473. $(!MAXIMUM_ALLOWED) NetRuleKey
  474. Ifstr $(NetRuleKey) != $(KeyNull)
  475. GetRegValue $(NetRuleKey),"InfOption", InfOptionInfo
  476. set InfOption = *($(InfOptionInfo), 4)
  477. Debug-Output "InfOption = "$(InfOption)
  478. endif
  479. Ifstr(i) $(InfOption) == $(Option)
  480. ; We found the adapter all ready installed,
  481. set CopyFirmwareOnly = $(FALSE)
  482. endif
  483. CloseRegKey $(NetRules)
  484. CloseRegKey $(NetworkCardKey)
  485. endif
  486. nextnetcard2 = +
  487. EndForListDo
  488. CloseRegKey $(IE_KeyNetcards)
  489. endif
  490. ifint $(CopyFirmwareOnly) == $(FALSE)
  491. Shell $(UtilityInf), CardExistedDlg
  492. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  493. Debug-Output "ShellCode error: cannot get an error string."
  494. goto ShellCodeError
  495. endif
  496. ifstr(i) $($R1) != "OK"
  497. goto end
  498. endif
  499. set OldVersionExisted = $(TRUE)
  500. endif
  501. endif
  502. else
  503. set CopyFirmwareOnly = $(FALSE)
  504. endif
  505. goto adapteroptions
  506. configureadapter = +
  507. Debug-Output "OEMNADDI.INF: Configure Adapter "$(!NTN_RegBase)
  508. Debug-Output " !REG_H_LOCAL = "$(!REG_H_LOCAL)
  509. shell "" QueryParameters $(!NTN_RegBase)
  510. set BusTypeNum = $($R1)
  511. Debug-Output "OEMNADDI.INF: (Config) BusTypeNum is: "$(BusTypeNum)
  512. adapteroptions = +
  513. StartWait
  514. ;
  515. ; Add Software Component
  516. ;
  517. ifint $(OldVersionExisted) == $(FALSE)
  518. ifstr(i) $(!NTN_InstallMode) == "install"
  519. Ifstr(i) $(DoCopy) == "YES"
  520. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  521. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  522. Goto ShellCodeError
  523. Else-Ifstr(i) $($R0) == STATUS_FAILED
  524. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  525. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  526. goto ShellCodeError
  527. endif
  528. set Error = $($R0)
  529. Goto fatal
  530. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  531. Goto successful
  532. Endif
  533. Set SrcDir = $($R1)
  534. ;
  535. ; We need to check an make sure a backslash is
  536. ; on the end of the path.
  537. ;
  538. Split-String $(SrcDir) "\" JunkList
  539. QueryListSize JunkSize $(JunkList)
  540. Set JunkItem = *($(JunkList),$(JunkSize))
  541. set JunkItem2 = "foo"
  542. ifstr $(JunkItem2)$(JunkItem)$(JunkItem2) != $(JunkItem2)"\"$(JunkItem2)
  543. Debug-Output "In ifstr"
  544. set SrcDir = $(SrcDir)"\"
  545. endif
  546. Debug-Output "Reassigning SourceDirectory = "$(SrcDir)
  547. Endif
  548. install "Install-Option"
  549. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  550. goto filecopycancel
  551. endif
  552. endif
  553. endif
  554. Debug-Output "OEMNADDI.INF: RegBase "$(!NTN_RegBase)
  555. LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  556. Debug-Output "OEMNADDI.INF: LIBHANDLE is "$(!LIBHANDLE)
  557. LoadLibrary "x" $(!STF_CWDDIR)digiinst.dll DIGIHANDLE
  558. Debug-Output "OEMNADDI.INF: DIGIHANDLE is "$(DIGIHANDLE)
  559. Shell "subroutn.inf" PopBillboard
  560. set AlternateMemory = ""
  561. set AlternateIO = ""
  562. set AlternateIRQ = ""
  563. ifstr(i) $(BusType) == "MCA"
  564. ;
  565. ; Look for a MCA controller.
  566. ;
  567. Ifstr(i) $(!NTN_InstallMode) == deinstall
  568. goto getcurrentconfig
  569. else-Ifstr(i) $(!NTN_InstallMode) == Update
  570. goto getcurrentconfig
  571. else-Ifstr(i) $(!NTN_InstallMode) == bind
  572. goto getcurrentconfig
  573. else-Ifstr(i) $(!NTN_InstallMode) == configure
  574. getcurrentconfig = +
  575. ;
  576. ; This is an adapter which all ready exists. Read what slot
  577. ; it is in and set the alternate settings appropriately.
  578. ;
  579. ; Look for the service name
  580. Ifstr $(!NTN_RegBase) != $(KeyNull)
  581. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(!MAXIMUM_ALLOWED) SoftwareKey
  582. Ifstr $(SoftwareKey) == $(KeyNull)
  583. Debug-Output "Unable to open "$(!NTN_RegBase)" key!!!!"
  584. goto cancel
  585. Else
  586. GetRegValue $(SoftwareKey), "ServiceName", ServiceNameList
  587. set AdapterServiceName = *($(ServiceNameList),4)
  588. set AdapterName = $(AdapterServiceName)
  589. CloseRegKey $(SoftwareKey)
  590. Endif
  591. Endif
  592. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(AdapterServiceName) $(!MAXIMUM_ALLOWED) BaseKey
  593. Ifstr $(BaseKey) == $(KeyNull)
  594. Debug-Output "Error opening BaseKey "$(!NTN_ServiceBase)"\"$(AdapterServiceName)
  595. CloseRegKey $(BaseKey)
  596. goto fatalregistry
  597. Endif
  598. OpenRegKey $(BaseKey) "" "Parameters" $(!MAXIMUM_ALLOWED) ParametersKey
  599. Ifstr $(ParametersKey) == $(KeyNull)
  600. goto cancel
  601. endif
  602. Debug-Output "Reading Parameters Key for current configuration"
  603. GetRegValue $(ParametersKey) "IOBaseAddress" IOBaseValueList
  604. set AlternateIO = {Slot*($(IOBaseValueList),4)}
  605. set AlternateMemory = {Slot*($(IOBaseValueList),4)}
  606. set AlternateIRQ = {Slot*($(IOBaseValueList),4)}
  607. else
  608. ;
  609. ; Look for a new instance of an MCA adapter.
  610. ;
  611. ForListDo $(AdapterHardwareAdapterID)
  612. Debug-Output "Calling MCAFindBus, "*($(AdapterIDByte1),$(#))", "*($(AdapterIDByte2),$(#))
  613. Shell $(UtilityInf), MCAFindBus, *($(AdapterIDByte1),$(#)), *($(AdapterIDByte2),$(#))
  614. Debug-Output "MCAFindBus returned "$($R1)
  615. set CardInfo = {}
  616. ifstr(i) $($R1) != {}
  617. set CardInfo = $($R1)
  618. Debug-Output "MCA controller found!"
  619. Debug-Output "CardInfo = "$(CardInfo)
  620. ForListDo $(CardInfo)
  621. Debug-Output "Current CardInfo Entry = "$($)
  622. set TmpBusNumber = *($($), 1)
  623. set SlotNumber = *($($), 2)
  624. set MCAPosId = *($($), 3)
  625. Debug-Output "Calling DoesControllerExist:"
  626. Debug-Output " AdapterHardwareName = "$(AdapterHardwareName)
  627. Debug-Output " BusNumber = "$(TmpBusNumber)
  628. Debug-Output " Slot # = "$(SlotNumber)
  629. Debug-Output " DIGIHANDLE = "$(DIGIHANDLE)
  630. LibraryProcedure Result, $(DIGIHANDLE), +
  631. DoesControllerExist, $(AdapterHardwareName), +
  632. $(TmpBusNumber), +
  633. $(SlotNumber)
  634. Debug-Output "DoesControllerExist return: "$(Result)
  635. ifstr(i) $(Result) == "FALSE"
  636. set AlternateIO = {Slot$(SlotNumber)}
  637. Debug-Output "Setting AlternateIO: "$(AlternateIO)
  638. set AlternateMemory = {Slot$(SlotNumber)}
  639. Debug-Output "Setting AlternateMemory: "$(AlternateMemory)
  640. set AlternateIRQ = {Slot$(SlotNumber)}
  641. Debug-Output "Setting AlternateIRQ: "$(AlternateIRQ)
  642. ; Reset the BusTypeNum default to MCA
  643. set BusTypeNum = 3
  644. goto continueSetup1
  645. endif
  646. EndForListDo
  647. endif
  648. EndForListDo
  649. ; We didn't find a new adapter.
  650. goto cancel
  651. endif
  652. endif
  653. continueSetup1 = +
  654. LibraryProcedure Result, $(DIGIHANDLE), +
  655. DigiEntry, $(!STF_HWND), +
  656. $(Option), +
  657. $(!NTN_InstallMode), +
  658. $(!NTN_RegBase), +
  659. $(BusTypeNum), +
  660. $(AlternateMemory), +
  661. $(AlternateIO), +
  662. $(AlternateIRQ)
  663. Debug-Output "OEMNADDI.INF: Dialog Result is "$(Result)
  664. Ifstr(i) $(Result) == Success
  665. ; If we were just configuring, then don't invoke RAS
  666. read-syms InvokeRasDlg$(!STF_LANGUAGE)
  667. Ifstr(i) $(!NTN_InstallMode) == configure
  668. goto skipRAS
  669. else-ifstr(i) $(!NTN_InstallPhase) == primary
  670. ; If this is the primary installation of Windows NT, then don't
  671. ; force the user to install or configure RAS. Just pop up
  672. ; an informational dialog box indicating the user should install
  673. ; and configure RAS.
  674. Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
  675. $(InvokeUserInstallRasMsg)
  676. goto skipRAS
  677. endif
  678. ; now that ISDN is successfully installed, shell the user into RAS
  679. ; setup to configure RAS-ISDN.
  680. ; if RAS is not installed, then shell ras setup INF file to install RAS
  681. ; else invoke RAS to allow user to configure RAS for ISDN.
  682. Shell "oemnsvra.inf" CheckRasInstalled
  683. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  684. Debug-Output "OEMNADDI.INF: Error Shelling the RAS INF file oemnsvra.inf"
  685. Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), +
  686. "STATUS", $(InvokeRasError)
  687. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  688. goto ShellCodeError
  689. endif
  690. goto successful
  691. endif
  692. set RasInstalled = $($R0)
  693. Debug-Output "OEMNADDI.INF: Is RAS Installed? "$(RasInstalled)
  694. ; display a message to the user that RAS setup will now be invoked
  695. ifstr(i) $(RasInstalled) == FALSE
  696. Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
  697. $(InvokeRasSetupMsg)
  698. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  699. goto successful
  700. endif
  701. else
  702. Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
  703. $(InvokeRasConfigMsg)
  704. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  705. goto successful
  706. endif
  707. endif
  708. ; set the flags based on whether this is an IDW installation
  709. Ifstr(i) $(!STF_IDW) == TRUE
  710. set AddCopy = NO
  711. set DoCopy = NO
  712. set DoConfig = NO
  713. else
  714. set AddCopy = YES
  715. set DoCopy = YES
  716. set DoConfig = YES
  717. endif
  718. ; change the global install mode flag to configure if RAS is
  719. ; already installed
  720. Debug-Output "OEMNADDI.INF: before - NTN_InstallMode = "$(!NTN_InstallMode)
  721. set SaveNTN_InstallMode = $(!NTN_InstallMode)
  722. ifstr(i) $(RasInstalled) == TRUE
  723. set !NTN_InstallMode = configure
  724. else
  725. set !NTN_InstallMode = install
  726. endif
  727. Debug-Output "OEMNADDI.INF: after - NTN_InstallMode = "$(!NTN_InstallMode)
  728. ; We change the following values so the user is prompted to enter
  729. ; a path for RAS file components if necessary.
  730. ;
  731. set SaveSTF_SRCDIR_OVERRIDE = $(!STF_SRCDIR_OVERRIDE)
  732. set !STF_SRCDIR_OVERRIDE = ""
  733. Debug-Output "OEMNADDI.INF: Shelling to oemnsvra.inf InstallOption with parameters:"
  734. Debug-Output " STF_LANGUAGE = "$(!STF_LANGUAGE)
  735. Debug-Output " SrcDir = "$(SrcDir)
  736. Debug-Output " AddCopy = "$(AddCopy)
  737. Debug-Output " DoCopy = "$(DoCopy)
  738. Debug-Output " DoConfig = "$(DoConfig)
  739. ; now invoke RAS setup to do the right thing
  740. Shell "oemnsvra.inf" InstallOption $(!STF_LANGUAGE) "RAS" $(SrcDir) $(AddCopy) $(DoCopy) $(DoConfig)
  741. ;
  742. ; Reset values we changed back to there originals
  743. ;
  744. set !NTN_InstallMode = $(SaveNTN_InstallMode)
  745. set !STF_SRCDIR_OVERRIDE = $(SaveSTF_SRCDIR_OVERRIDE)
  746. ifstr(i) $(!NTN_InstallMode) == "install"
  747. ; since this INF is not doing the right thing by calling
  748. ; AddHardwareComponent in Utility.Inf, we had to resort to the
  749. ; following code to add the new OperationsSupport
  750. ;
  751. ; Enumerate all netcards installed of this type and update them
  752. ;
  753. set iSearch = 1
  754. nextnci = +
  755. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  756. set KeyNetcard = $($R0)
  757. set iSearch = $($R1)
  758. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  759. Ifstr $(KeyNetcard) != $(KeyNull)
  760. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  761. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  762. CloseRegKey $(KeyNetcard)
  763. goto nextnci
  764. Endif
  765. endif
  766. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  767. Debug-Output "OEMNADDI.INF: Error Shelling the RAS INF file oemnsvra.inf"
  768. Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), "STATUS", +
  769. $(InvokeRasError)
  770. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  771. goto ShellCodeError
  772. endif
  773. goto successful
  774. Endif
  775. skipRAS = +
  776. goto successful
  777. else-Ifstr(i) $(Result) == Cancel
  778. goto cancel
  779. else-Ifstr(i) $(Result) == Error
  780. goto fatal
  781. ;-----------------------------------------------
  782. ; Binding section
  783. ;-----------------------------------------------
  784. bindingadapter =+
  785. set Error = "Binding: Sorry, not yet implemented."
  786. goto fatal
  787. ;-----------------------------------------------
  788. ; Removeadapter section
  789. ;-----------------------------------------------
  790. removeadapter = +
  791. Debug-Output "OEMNADDI.INF: RegBase "$(!NTN_RegBase)
  792. LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  793. Debug-Output "OEMNADDI.INF: LIBHANDLE is "$(!LIBHANDLE)
  794. LoadLibrary "x" $(!STF_CWDDIR)digiinst.dll DIGIHANDLE
  795. Debug-Output "OEMNADDI.INF: DIGIHANDLE is "$(DIGIHANDLE)
  796. LibraryProcedure Result, $(DIGIHANDLE), DigiEntry, $(!STF_HWND) $(Option) $(!NTN_InstallMode) $(!NTN_RegBase) $(BusTypeNum)
  797. goto end
  798. ;-----------------------------------------------
  799. ; Upgrade Software section
  800. ;-----------------------------------------------
  801. UpgradeSoftware = +
  802. ; Upgrade software component
  803. ;
  804. Debug-Output "OEMNADDI: **** Entering UpgradeSoftware ****"
  805. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(!MAXIMUM_ALLOWED) KeyProduct
  806. Ifstr $(KeyProduct) != $(KeyNull)
  807. CloseRegKey $(KeyProduct)
  808. ;
  809. ; We need to enumerate all the Netcard entries for a PCIMAC4 and
  810. ; make sure we change the BoardType from PCIMAC/4 to PCIMAC4 before
  811. ; calling our DLL to do the actual update.
  812. ;
  813. ; Beware of a NT 3.1 upgrade.
  814. ;
  815. set NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  816. OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(!MAXIMUM_ALLOWED) IE_KeyNetcards
  817. ifstr(i) $(IE_KeyNetcards) != ""
  818. Debug-Output "OEMNADDI: Enumerating all NetworkCard keys"
  819. EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
  820. ForListDo $(IE_KeyNameList)
  821. set Detected31 = FALSE
  822. OpenRegKey $(IE_KeyNetcards) "" *($($),1) +
  823. $(!MAXIMUM_ALLOWED) NetworkCardKey
  824. Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  825. ;
  826. ; Okay, we need see if this is a controller we support
  827. ;
  828. GetRegValue $(NetworkCardKey),"Manufacturer", ManufacturerInfo
  829. set ManufacturerName = *($(ManufacturerInfo), 4)
  830. Debug-Output " Manufacturer = "$(ManufacturerName)
  831. Ifstr $(ManufacturerName) != $(Manufacturer)
  832. ; Not ours, so skip to next
  833. goto nextnetcard
  834. endif
  835. ;
  836. ; We need to determine if this is an option we are interested
  837. ; in updating.
  838. ;
  839. GetRegValue $(NetworkCardKey),"ProductName", ProductNameInfo
  840. set ProductName = *($(ProductNameInfo), 4)
  841. Debug-Output " ProductName = "$(ProductName)
  842. Ifstr(i) $(ProductName) != "PCIMAC"
  843. goto nextnetcard
  844. endif
  845. ;
  846. ; Now we need to go through our entire list and determine
  847. ; what adapter we are suppose to update. I have to do this
  848. ; because I only get an update on a driver bases it appears.
  849. ;
  850. GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  851. set ServiceName = *($(ServiceNameInfo), 4)
  852. Debug-Output " ServiceName = "$(ServiceName)
  853. OpenRegKey $(NetworkCardKey) "" "NetRules" +
  854. $(!MAXIMUM_ALLOWED) NetRuleKey
  855. Ifstr $(NetRuleKey) != $(KeyNull)
  856. GetRegValue $(NetRuleKey),"InfOption", InfOptionInfo
  857. set InfOption = *($(InfOptionInfo), 4)
  858. Debug-Output " InfOption = "$(InfOption)
  859. ;
  860. ; Now, we reset the Option to match and re-init our variables
  861. ;
  862. Ifstr(i) $(InfOption) == "PCIMAC/4"
  863. Debug-Output "Resetting InfOption to PCIMAC4"
  864. SetRegValue $(NetRuleKey) {InfOption,$(NoTitle),$(!REG_VT_SZ),"PCIMAC4"}
  865. set InfOption = "PCIMAC4"
  866. Else-Ifstr(i) $(InfOption) == "PCIMAC"
  867. Debug-Output "OEMNADDI: Updating config which started as NT 3.1"
  868. ;
  869. ; In NT 3.1, the InfOption was only "PCIMAC" for both
  870. ; PCIMAC and PCIMAC/4 adapaters. As as result, we
  871. ; need to dig a little further and update the registry
  872. ; to a NT 3.5 configuration.
  873. ;
  874. OpenRegKey $(!REG_H_LOCAL) "" +
  875. $(!NTN_ServiceBase)"\"$(ServiceName) +
  876. $(!MAXIMUM_ALLOWED) ServiceKey
  877. Ifstr $(ServiceKey) != $(KeyNull)
  878. Debug-Output " Opened service key "$(ServiceName)" successfully"
  879. OpenRegKey $(ServiceKey) "" "Parameters" +
  880. $(!MAXIMUM_ALLOWED) ParametersKey
  881. Ifstr $(ParametersKey) != $(KeyNull)
  882. set RegLastError = $(!REG_ERROR_SUCCESS)
  883. GetRegValue $(ParametersKey),"BoardLink", BoardLinkInfo
  884. ;
  885. ; If BoardLink exists, then this is a NT 3.1
  886. ; we are updating for sure. We need to walk
  887. ; this link and change the InfOption in
  888. ; the netrule section. If this is a PCIMAC/4,
  889. ; then we also need to update the Type
  890. ; parameter
  891. ;
  892. set BoardLink = *($(BoardLinkInfo), 4)
  893. Debug-Output "OEMNADDI: BoardLink = "$(BoardLink)
  894. Debug-Output "OEMNADDI: RegLastError = "$(RegLastError)
  895. ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  896. Debug-Output "OEMNADDI: Detected NT 3.1 configuration"
  897. ;
  898. ; This must be a NT 3.1 installation
  899. ; we are upgrading.
  900. ;
  901. ;
  902. ; Open \registry\machine\system\currentcontrolset\
  903. ; services\pcimac\Parameters\<boardlink>
  904. ;
  905. OpenRegKey $(!REG_H_LOCAL) +
  906. "" +
  907. $(ParamKeyName) +
  908. $(!MAXIMUM_ALLOWED) +
  909. DriverKey
  910. Ifstr(i) $(DriverKey) != $(KeyNull)
  911. Debug-Output "OEMNADDI.INF: Opened "$(ParamKeyName)
  912. OpenRegKey $(DriverKey) +
  913. "" +
  914. $(BoardLink) +
  915. $(!MAXIMUM_ALLOWED) +
  916. AdapterKey
  917. Ifstr(i) $(AdapterKey) != $(KeyNull)
  918. Debug-Output "OEMNADDI: Opened "$(ParamKeyName)"\"$(BoardLink)
  919. GetRegValue $(AdapterKey), +
  920. "Type", +
  921. TypeInfo
  922. set Type = *($(TypeInfo), 4 )
  923. Debug-Output "OEMNADDI: Type = "$(Type)
  924. Ifstr(i) $(Type) == "PCIMAC/4"
  925. Debug-Output "OEMNADDI: Resetting InfOption to PCIMAC4"
  926. SetRegValue $(NetRuleKey) {InfOption,$(NoTitle),$(!REG_VT_SZ),"PCIMAC4"}
  927. set InfOption = "PCIMAC4"
  928. Debug-Output "OEMNADDI: Resetting Type to PCIMAC4"
  929. SetRegValue $(AdapterKey) +
  930. {Type,$(NoTitle),$(!REG_VT_SZ),"PCIMAC4"}
  931. Else-Ifstr(i) $(Type) == "PCIMAC4"
  932. Debug-Output "OEMNADDI: Resetting InfOption to PCIMAC4"
  933. SetRegValue $(NetRuleKey) {InfOption,$(NoTitle),$(!REG_VT_SZ),"PCIMAC4"}
  934. set InfOption = "PCIMAC4"
  935. Else-Ifstr(i) $(Type) == "PCIMAC - ISA"
  936. set InfOption = "PCIMACISA"
  937. Debug-Output "Resetting InfOption to PCIMACISA"
  938. SetRegValue $(NetRuleKey) {InfOption,$(NoTitle),$(!REG_VT_SZ),"PCIMACISA"}
  939. Endif
  940. Else
  941. goto fatalregistry
  942. Endif
  943. CloseRegKey $(AdapterKey)
  944. Else
  945. goto fatalregistry
  946. Endif
  947. CloseRegKey $(DriverKey)
  948. else
  949. Debug-Output "OEMNADDI: Detected NT 3.5 config which was upgraded from NT 3.1"
  950. ;
  951. ; This must be a NT 3.5 installation
  952. ; which was updated from NT 3.1
  953. ; previously.
  954. ;
  955. GetRegValue $(ParametersKey) +
  956. "BoardType" +
  957. BoardTypeInfo
  958. set BoardType = *($(BoardTypeInfo), 4)
  959. Ifstr(i) $(BoardType) == "PCIMAC/4"
  960. Debug-Output "OEMNADDI: Resetting InfOption to PCIMAC4"
  961. SetRegValue $(NetRuleKey) {InfOption,$(NoTitle),$(!REG_VT_SZ),"PCIMAC4"}
  962. set InfOption = "PCIMAC4"
  963. Debug-Output "OEMNADDI: Changing BoardType from "$(BoardType)" -> PCIMAC4"
  964. SetRegValue $(ParametersKey) +
  965. {BoardType,$(NoTitle),$(!REG_VT_SZ),"PCIMAC4"}
  966. Else-Ifstr(i) $(BoardType) == "PCIMAC - ISA"
  967. Debug-Output "Resetting InfOption to PCIMACISA"
  968. SetRegValue $(NetRuleKey) {InfOption,$(NoTitle),$(!REG_VT_SZ),"PCIMACISA"}
  969. set InfOption = "PCIMACISA"
  970. Endif
  971. endif
  972. CloseRegKey $(ParametersKey)
  973. else
  974. goto fatalregistry
  975. Endif
  976. CloseRegKey $(ServiceKey)
  977. else
  978. goto fatalregistry
  979. endif
  980. Endif
  981. set Option = $(InfOption)
  982. install "Install-Update"
  983. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  984. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  985. goto filecopycancel
  986. endif
  987. endif
  988. CloseRegKey $(NetRules)
  989. CloseRegKey $(NetworkCardKey)
  990. endif
  991. OpenRegKey $(!REG_H_LOCAL) "" +
  992. $(!NTN_ServiceBase)"\"$(ServiceName) +
  993. $(!MAXIMUM_ALLOWED) ServiceKey
  994. Ifstr $(ServiceKey) != $(KeyNull)
  995. Debug-Output " Opened service key "$(ServiceName)" successfully"
  996. OpenRegKey $(ServiceKey) "" "Parameters" +
  997. $(!MAXIMUM_ALLOWED) ParametersKey
  998. Ifstr $(ParametersKey) != $(KeyNull)
  999. Ifstr(i) $(InfOption) == "PCIMAC4"
  1000. Debug-Output "Resetting BoardType = PCIMAC4"
  1001. SetRegValue $(ParametersKey) {BoardType,$(NoTitle),$(!REG_VT_SZ),"PCIMAC4"}
  1002. Endif
  1003. CloseRegKey $(ParametersKey)
  1004. else
  1005. goto fatalregistry
  1006. Endif
  1007. CloseRegKey $(ServiceKey)
  1008. else
  1009. goto fatalregistry
  1010. endif
  1011. nextnetcard = +
  1012. EndForListDo
  1013. endif
  1014. shell "" QueryParameters $(!NTN_RegBase)
  1015. set BusTypeNum = $($R1)
  1016. Debug-Output "OEMNADDI.INF: (update) BusTypeNum is: "$(BusTypeNum)
  1017. LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  1018. LoadLibrary "x" $(!STF_CWDDIR)digiinst.dll DIGIHANDLE
  1019. LibraryProcedure Result, $(DIGIHANDLE), DigiEntry, $(!STF_HWND) $(Option) $(!NTN_InstallMode) "" $(BusTypeNum)
  1020. Ifstr(i) $(Result) == Success
  1021. goto successful
  1022. else-Ifstr(i) $(Result) == Cancel
  1023. goto cancel
  1024. else-Ifstr(i) $(Result) == Error
  1025. goto fatal
  1026. endif
  1027. FreeLibrary $(!LIBHANDLE)
  1028. FreeLibrary $(DIGIHANDLE)
  1029. endif
  1030. ;
  1031. ; Enumerate all netcards installed of this type and update them
  1032. ;
  1033. set iSearch = 1
  1034. nextncu = +
  1035. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  1036. set KeyNetcard = $($R0)
  1037. set iSearch = $($R1)
  1038. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  1039. Ifstr $(KeyNetcard) != $(KeyNull)
  1040. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  1041. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  1042. CloseRegKey $(KeyNetcard)
  1043. goto nextncu
  1044. Endif
  1045. goto end
  1046. ;
  1047. ; End of Upgrade Software
  1048. ;
  1049. ;
  1050. ; Escape hatches
  1051. ;
  1052. successful = +
  1053. set CommonStatus = STATUS_SUCCESSFUL
  1054. goto end
  1055. ;
  1056. ; warning display
  1057. ;
  1058. warning = +
  1059. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1060. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1061. goto ShellCodeError
  1062. endif
  1063. ifstr(i) $($R1) == "OK"
  1064. goto $(to)
  1065. else-ifstr(i) $($R1) == "CANCEL"
  1066. goto $(from)
  1067. else
  1068. goto "end"
  1069. endif
  1070. ;
  1071. ; non fatal error display
  1072. ;
  1073. nonfatalinfo = +
  1074. Set Severity = STATUS
  1075. Set CommonStatus = STATUS_USERCANCEL
  1076. goto nonfatalmsg
  1077. nonfatal = +
  1078. Set Severity = NONFATAL
  1079. goto nonfatalmsg
  1080. nonfatalmsg = +
  1081. ifstr(i) $(Error) == ""
  1082. Set Severity = NONFATAL
  1083. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1084. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1085. goto ShellCodeError
  1086. endif
  1087. set Error = $($R0)
  1088. endif
  1089. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1090. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1091. goto ShellCodeError
  1092. endif
  1093. ifstr(i) $($R1) == "OK"
  1094. goto $(from)
  1095. else
  1096. goto "end"
  1097. endif
  1098. ;
  1099. ; Registry is broken
  1100. ;
  1101. fatalregistry = +
  1102. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1103. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1104. goto ShellCodeError
  1105. endif
  1106. set Error = $($R0)
  1107. goto nonfatal
  1108. ;
  1109. ; Netcard detection failure
  1110. ;
  1111. fataldetect = +
  1112. Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1113. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1114. Debug-Output "ShellCode error: cannot get an error string."
  1115. goto ShellCodeError
  1116. endif
  1117. set Error = $($R0)
  1118. Goto fatal
  1119. ;
  1120. ; fatal error display
  1121. ;
  1122. fatal = +
  1123. ifstr(i) $(Error) == ""
  1124. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1125. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1126. goto ShellCodeError
  1127. endif
  1128. set Error = $($R0)
  1129. endif
  1130. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1131. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1132. goto ShellCodeError
  1133. endif
  1134. goto setfailed
  1135. ;
  1136. ; Shelling error
  1137. ;
  1138. ShellCodeError = +
  1139. set DlgType = "MessageBox"
  1140. set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1141. set STF_MB_TEXT = "Shell Code Error"
  1142. set STF_MB_TYPE = 1
  1143. set STF_MB_ICON = 3
  1144. set STF_MB_DEF = 1
  1145. ui start "Error Message"
  1146. goto setfailed
  1147. setfailed = +
  1148. set CommonStatus = STATUS_FAILED
  1149. ;
  1150. ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1151. ;
  1152. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1153. set OEM_ABANDON_ON = FALSE
  1154. goto end
  1155. endif
  1156. goto end
  1157. filecopycancel = +
  1158. set CommonStatus = STATUS_NO_EFFECT
  1159. goto end
  1160. cancel = +
  1161. set CommonStatus = STATUS_USERCANCEL
  1162. goto term
  1163. end = +
  1164. goto term
  1165. term = +
  1166. Return $(CommonStatus)
  1167. exit
  1168. [DebugConfiguration]
  1169. Set InfName = "OEMNADDI.INF"
  1170. Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1171. return
  1172. ;***************************************************************
  1173. ; INSTALL SECTIONS
  1174. ;***************************************************************
  1175. [Install-Option]
  1176. set STF_VITAL = NO
  1177. ifstr(i) $(AddCopy) == "YES"
  1178. ;
  1179. ; Add the files to the copy list
  1180. ;
  1181. ;
  1182. ifint $(CopyFirmwareOnly) == $(FALSE)
  1183. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1184. AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1185. endif
  1186. ; Determine if this is a Microsoft release or Digi release
  1187. LibraryProcedure FilePresent, $(!LIBHANDLE), CheckFileExistance $(SrcDir)..\common\isdnhelp.hlp
  1188. ifstr(i) $(FilePresent) != "YES"
  1189. ; Check for compressed files
  1190. LibraryProcedure FilePresent, $(!LIBHANDLE), CheckFileExistance $(SrcDir)..\common\isdnhelp.hl_
  1191. ifstr(i) $(FilePresent) != "YES"
  1192. ; Must be a Microsoft release
  1193. Debug-Output "Retrieving images from "$(SrcDir)
  1194. AddSectionFilesToCopyList Files-$(Option)-firmware $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1195. ifint $(CopyFirmwareOnly) == $(FALSE)
  1196. AddSectionFilesToCopyList Files-common-system32 $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1197. endif
  1198. else
  1199. ; Must be a Digi release
  1200. Debug-Output "Retrieving images from "$(SrcDir)"..\common"
  1201. AddSectionFilesToCopyList Files-$(Option)-firmware $(SrcDir)..\common $(!STF_WINDOWSSYSPATH)\drivers
  1202. ifint $(CopyFirmwareOnly) == $(FALSE)
  1203. AddSectionFilesToCopyList Files-common-system32 $(SrcDir)..\common $(!STF_WINDOWSSYSPATH)
  1204. endif
  1205. endif
  1206. else
  1207. ; Must be a Digi release
  1208. Debug-Output "Retrieving images from "$(SrcDir)"..\common"
  1209. AddSectionFilesToCopyList Files-$(Option)-firmware $(SrcDir)..\common $(!STF_WINDOWSSYSPATH)\drivers
  1210. ifint $(CopyFirmwareOnly) == $(FALSE)
  1211. AddSectionFilesToCopyList Files-common-system32 $(SrcDir)..\common $(!STF_WINDOWSSYSPATH)
  1212. endif
  1213. endif
  1214. endif
  1215. ifstr(i) $(DoCopy) == "YES"
  1216. ;
  1217. ; Copy files in the copy list
  1218. ;
  1219. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1220. CopyFilesInCopyList
  1221. else
  1222. ; Determine if this is a Microsoft release or Digi release
  1223. LibraryProcedure FilePresent, $(!LIBHANDLE), CheckFileExistance $(SrcDir)..\common\isdnhelp.hlp
  1224. ifstr(i) $(FilePresent) != "YES"
  1225. ; Check for compressed files
  1226. LibraryProcedure FilePresent, $(!LIBHANDLE), CheckFileExistance $(SrcDir)..\common\isdnhelp.hl_
  1227. ifstr(i) $(FilePresent) != "YES"
  1228. ; Must be a Microsoft release
  1229. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\DIGIINST.DLL $(!STF_WINDOWSSYSPATH)\DIGIINST.DLL
  1230. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\ISDNHELP.CNT $(!STF_WINDOWSSYSPATH)\ISDNHELP.CNT
  1231. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\ISDNHELP.HLP $(!STF_WINDOWSSYSPATH)\ISDNHELP.HLP
  1232. else
  1233. ; Must be a Digi release
  1234. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\DIGIINST.DLL $(!STF_WINDOWSSYSPATH)\DIGIINST.DLL
  1235. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\..\common\ISDNHELP.HLP $(!STF_WINDOWSSYSPATH)\ISDNHELP.HLP
  1236. endif
  1237. else
  1238. ; Must be a Digi release
  1239. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\DIGIINST.DLL $(!STF_WINDOWSSYSPATH)\DIGIINST.DLL
  1240. LibraryProcedure STATUS,$(!NCPA_HANDLE), CopySingleFile $(!STF_HWND) $(SrcDir)\..\common\ISDNHELP.HLP $(!STF_WINDOWSSYSPATH)\ISDNHELP.HLP
  1241. endif
  1242. endif
  1243. Exit
  1244. [Install-Update]
  1245. Debug-Output "********************* Inside Install-Update *************************"
  1246. Debug-Output " AddCopy = "$(AddCopy)
  1247. Debug-Output " DoCopy = "$(DoCopy)
  1248. Debug-Output " DoConfig = "$(DoConfig)
  1249. Debug-Output " NTN_InstallPhase = "$(!NTN_InstallPhase)
  1250. Debug-Output " Option = "$(Option)
  1251. Debug-Output " SrcDir = "$(SrcDir)
  1252. set STF_VITAL = NO
  1253. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  1254. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1255. AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1256. ; Determine if this is a Microsoft release or Digi release
  1257. LibraryProcedure FilePresent, $(!LIBHANDLE), CheckFileExistance $(SrcDir)..\common\isdnhelp.hlp
  1258. ifstr(i) $(FilePresent) != "YES"
  1259. ; Check for compressed files
  1260. LibraryProcedure FilePresent, $(!LIBHANDLE), CheckFileExistance $(SrcDir)..\common\isdnhelp.hl_
  1261. ifstr(i) $(FilePresent) != "YES"
  1262. ; Must be a Microsoft release
  1263. Debug-Output " Retrieving images from "$(SrcDir)
  1264. AddSectionFilesToCopyList Files-$(Option)-firmware $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1265. AddSectionFilesToCopyList Files-common-system32 $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1266. else
  1267. ; Must be a Digi release
  1268. Debug-Output " Retrieving images from "$(SrcDir)"..\common"
  1269. AddSectionFilesToCopyList Files-$(Option)-firmware $(SrcDir)..\common $(!STF_WINDOWSSYSPATH)\drivers
  1270. AddSectionFilesToCopyList Files-common-system32 $(SrcDir)..\common $(!STF_WINDOWSSYSPATH)
  1271. endif
  1272. else
  1273. ; Must be a Digi release
  1274. Debug-Output " Retrieving images from "$(SrcDir)"..\common"
  1275. AddSectionFilesToCopyList Files-$(Option)-firmware $(SrcDir)..\common $(!STF_WINDOWSSYSPATH)\drivers
  1276. AddSectionFilesToCopyList Files-common-system32 $(SrcDir)..\common $(!STF_WINDOWSSYSPATH)
  1277. endif
  1278. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1279. CopyFilesInCopyList
  1280. Debug-Output "********************* exiting Install-Update *************************"
  1281. exit
  1282. ;---------------------------------------------------------------------------
  1283. ; QueryParameters
  1284. ;
  1285. ; DESCRIPTION: Read Adapter parameters from the registry.
  1286. ;
  1287. ; INPUT: $($0): Service we wish to retreive parameters from
  1288. ;
  1289. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  1290. ; $($R1): Bus Type Number
  1291. ;---------------------------------------------------------------------------
  1292. [QueryParameters]
  1293. set Status = STATUS_FAILED
  1294. set KeyProduct = ""
  1295. set KeyNull = ""
  1296. set KeyProductName = $($0)
  1297. ; Default to ISA bus type.
  1298. set BusTypeNum = 1
  1299. Debug-Output "QueryParameters: "$(KeyProductName)
  1300. Debug-Output " REG_H_LOCAL = "$(!REG_H_LOCAL)
  1301. Debug-Output " !MAXIMUM_ALLOWED = "$(!MAXIMUM_ALLOWED)
  1302. Debug-Output " UtilityInf = "$(UtilityInf)
  1303. Debug-Output " UtilityInf = "$(UtilityInf)
  1304. OpenRegKey $(!REG_H_LOCAL) "" $(KeyProductName) $(!MAXIMUM_ALLOWED) KeyProduct
  1305. Debug-Output "KeyProduct = "$(KeyProduct)
  1306. Ifstr $(KeyProduct) == $(KeyNull)
  1307. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  1308. Debug-Output "Cannot find component product key"
  1309. goto QueryParameters_End
  1310. Endif
  1311. Debug-Output "INF: Shelling to FindService"
  1312. Shell $(UtilityInf) FindService, $(KeyProduct)
  1313. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1314. Debug-Output "INF: FindService shell failure"
  1315. Goto QueryParameters_End
  1316. Endif
  1317. Ifstr(i) $($R0) != NO_ERROR
  1318. Debug-Output "INF: FindService Shell error: "$($R0)
  1319. Goto QueryParameters_End
  1320. endif
  1321. set KeyParameters = $($R2)
  1322. CloseRegKey $($R1)
  1323. Ifstr $(KeyParameters) == $(KeyNull)
  1324. set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  1325. Debug-Output "Cannot find component service"
  1326. Goto QueryParameters_End
  1327. endif
  1328. set ValueName = ""
  1329. set ValueData = ""
  1330. set ValueStr = ""
  1331. set ValueList = {}
  1332. EnumRegValue $(KeyParameters) ValueList
  1333. ForListDo $(ValueList)
  1334. ;
  1335. ; Look for all the parameters we are currently interested in
  1336. ;
  1337. set ValueItem = $($)
  1338. set ValueName = *($(ValueItem),1)
  1339. set ValueData = *($(ValueItem),4)
  1340. Ifstr(i) $(ValueName) == "BusType"
  1341. set BusTypeNum = $(ValueData)
  1342. endif
  1343. EndForListDo
  1344. set Status = STATUS_SUCCESSFUL
  1345. QueryParameters_End = +
  1346. Return $(Status) $(BusTypeNum)