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.

599 lines
18 KiB

  1. ;-----------------------------------------------------------------
  2. ; Copyright(c) 1992-93 Microsoft Corporation
  3. ;
  4. ; SETUP INF FILE for the LT200 LocalTalk Adapter
  5. ;
  6. ; Author: KrishG
  7. ;
  8. ; Revision History: 3/4/93 General Cleanup
  9. ;-----------------------------------------------------------------
  10. [Identification]
  11. OptionType = NetAdapter
  12. [PlatformsSupported]
  13. MCA
  14. [Options]
  15. LT200MC
  16. [FileConstants]
  17. UtilInf = "UTILITY.INF"
  18. SubInf = "SUBROUTN.INF"
  19. SoftwareType = "driver"
  20. LT200MC_1BYTE = 116
  21. LT200MC_2BYTE = 102
  22. NETCARD_ID = 26228
  23. Manufacturer = "Microsoft"
  24. ProductMajorVersion = "4"
  25. ProductMinorVersion = "0"
  26. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  27. ProductInfName = "oemnadlm.inf"
  28. ProductSoftwareName = "lt200"
  29. ProductSoftwareImagePath = "%SystemRoot%\system32\drivers\lt200.sys"
  30. NetRuleSoftwareType = "Lt200Sys ltkndisDriver lt200Driver"
  31. NetRuleSoftwareUse = $(SoftwareType)
  32. NetRuleSoftwareBindForm = """Lt200Sys"" yes no container"
  33. NetRuleSoftwareClass = {"lt200Driver basic","ltkndisDriver basic yes"}
  34. NetRuleSoftwareBindable = {"lt200Driver lt200Adapter non exclusive 100",+
  35. "ltkndisDriver lt200Driver non non 100"}
  36. ProductEventDll = "%SystemRoot%\system32\netevent.dll"
  37. ProductHardwareName = "lt200"
  38. NetRuleHardwareType = "lt200 lt200Adapter"
  39. NetRuleHardwareBindForm = " yes yes container"
  40. NetRuleHardwareClass = {"lt200Adapter basic"}
  41. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  42. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  43. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  44. CardKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  45. [GeneralConstants]
  46. KeyNull = ""
  47. MAXIMUM_ALLOWED = 33554432
  48. RegistryErrorIndex = NO_ERROR
  49. KeyProduct = ""
  50. KeyParameters = ""
  51. TRUE = 1
  52. FALSE = 0
  53. NoTitle = 0
  54. ; !DebugOutputControl = 0
  55. [date]
  56. Now = {} ? $(!LIBHANDLE) GetSystemDate
  57. [Identify]
  58. read-syms Identification
  59. set Status = STATUS_SUCCESSFUL
  60. set Identifier = $(OptionType)
  61. set Media = #("Source Media Descriptions", 1, 1)
  62. Return $(Status) $(Identifier) $(Media)
  63. [ReturnOptions]
  64. set Status = STATUS_FAILED
  65. set OptionList = {}
  66. set OptionTextList = {}
  67. ;
  68. ; Check if the language requested is supported
  69. ;
  70. set LanguageList = ^(LanguagesSupported, 1)
  71. Ifcontains(i) $($0) in $(LanguageList)
  72. ;
  73. ; Check if the platforms requested is supported
  74. ;
  75. ifstr(i) $($1) == ""
  76. goto returnoptions
  77. endif
  78. set PlatformList = ^(PlatformsSupported, 1)
  79. Ifcontains(i) $($1) in $(PlatformList)
  80. goto returnoptions
  81. else
  82. set Status = STATUS_NOTSUPPORTED
  83. goto finish_ReturnOptions
  84. endif
  85. else
  86. set Status = STATUS_NOLANGUAGE
  87. goto finish_ReturnOptions
  88. endif
  89. ;
  90. ; form a list of all the options and another of the text representing
  91. ;
  92. returnoptions = +
  93. set OptionList = ^(Options, 1)
  94. set OptionTextList = ^(OptionsText$($0), 1)
  95. set Status = STATUS_SUCCESSFUL
  96. finish_ReturnOptions = +
  97. Return $(Status) $(OptionList) $(OptionTextList)
  98. [InstallOption]
  99. set Status = STATUS_FAILED
  100. set Option = $($1)
  101. set SrcDir = $($2)
  102. Set AddCopy = $($3)
  103. Set DoCopy = $($4)
  104. Set DoConfig = $($5)
  105. set LanguageList = ^(LanguagesSupported, 1)
  106. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  107. return STATUS_NOLANGUAGE
  108. EndIf
  109. StartWait
  110. set-subst LF = "\n"
  111. set-subst CR = "\r"
  112. read-syms GeneralConstants
  113. read-syms FileConstants
  114. read-syms DialogConstants$(!STF_LANGUAGE)
  115. read-syms FileConstants$(!STF_LANGUAGE)
  116. detect date
  117. set-title $(FunctionTitle)
  118. set CommonStatus = STATUS_SUCCESSFUL
  119. EndWait
  120. Begin = +
  121. Ifstr(i) $(!NTN_InstallMode) == deinstall
  122. set StartLabel = removeadapter
  123. Set RemoveonError = FALSE
  124. else-Ifstr(i) $(!NTN_InstallMode) == Update
  125. set StartLabel = UpgradeSoftware
  126. else-Ifstr(i) $(!NTN_InstallMode) == bind
  127. set StartLabel = bindingadapter
  128. else-Ifstr(i) $(!NTN_InstallMode) == configure
  129. set CommonStatus = STATUS_USERCANCEL
  130. set StartLabel = configureadapter
  131. else
  132. set StartLabel = installadapter
  133. set REMOVE_SOFTWARE = TRUE
  134. set REMOVE_HARDWARE = {}
  135. Set RemoveOnError = TRUE
  136. endif
  137. goto $(StartLabel)
  138. installadapter = +
  139. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  140. Ifstr $(KeyProduct) != $(KeyNull)
  141. GetRegValue $(KeyProduct) $(MajorVersion) VersionInfo
  142. set VersionMajor = *($(VersionInfo), 4)
  143. GetRegValue $(KeyProduct) $(MinorVersion) VersionInfo
  144. set VersionMinor = *($(VersionInfo), 4)
  145. set InstalledVersion = $(VersionMajor)"."$(VersionMinor)
  146. ifstr(i) $(ProductVersion) == $(InstalledVersion)
  147. read-syms MiscErrorString1$(!STF_LANGUAGE)
  148. Set Text = $(Version)$(ProductVersion)
  149. Shell $(SubInf), SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(Text)$(ErrorString)
  150. goto end
  151. EndIf
  152. EndIf
  153. ifstr(i) $(!NTN_InstallMode) == "install"
  154. Ifstr(i) $(!DoCopy) == "YES"
  155. Shell $(UtilInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  156. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  157. Goto ShellCodeError
  158. Else-Ifstr(i) $($R0) == STATUS_FAILED
  159. Shell $(UtilInf) RegistryErrorString "ASK_SOURCE_FAIL"
  160. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  161. goto ShellCodeError
  162. endif
  163. set Error = $($R0)
  164. Goto end
  165. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  166. Goto end
  167. Endif
  168. Set SrcDir = $($R1)
  169. Endif
  170. Endif
  171. adapteroptions = +
  172. Shell $(UtilInf), MCAFindBus, $(LT200MC_1BYTE), $(LT200MC_2BYTE)
  173. ifstr(i) $($R0) != "NO_ERROR"
  174. set Error = $($R0)
  175. goto fatal
  176. endif
  177. ifint $($ShellCode) != 0
  178. goto ShellCodeError
  179. endif
  180. ifstr(i) $($R1) == {}
  181. read-syms MiscErrorString2$(!STF_LANGUAGE)
  182. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  183. goto usercancel
  184. endif
  185. set AdapterList = $($R1)
  186. installproduct = +
  187. install "Install-Initial"
  188. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  189. goto usercancel
  190. Endif
  191. Set FLibraryErrCtl = 1
  192. Shell $(UtilInf), AddSoftwareComponent, $(Manufacturer),+
  193. $(ProductSoftwareName), +
  194. $(ProductSoftwareName), +
  195. $(ProductSoftwareName), +
  196. $(ProductInfName),+
  197. $(ProductSoftwareImagePath),+
  198. "kernel", "NDIS", {}, "", $(ProductEventDll)
  199. ifint $($ShellCode) != 0
  200. goto ShellCodeError
  201. endif
  202. set RegistryErrorIndex = $($R0)
  203. set KeyProduct = $($R1)
  204. Set SoftNetRulesKey = $($R2)
  205. CloseRegKey $($R3)
  206. CloseRegKey $($R4)
  207. CloseRegKey $($R5)
  208. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  209. CloseRegKey $(KeyProduct)
  210. CloseRegKey $(SoftNetRulesKey)
  211. goto fatalregistry
  212. endif
  213. set NewValueList = {{SoftwareType,0,$(!REG_VT_SZ),$(SoftwareType)},+
  214. {MajorVersion,0,$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  215. {MinorVersion,0,$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  216. {Title,0,$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  217. {Description,0,$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  218. {PathName,0,$(!REG_VT_SZ),$(!STF_WINDOWSSYSPATH)},+
  219. {ServiceName,0,$(!REG_VT_SZ),$(ProductSoftwareName)},+
  220. {InstallDate,0,$(!REG_VT_DWORD),*($(Now),1)}}
  221. Shell $(UtilInf), AddValueList, $(KeyProduct), $(NewValueList)
  222. ifint $($ShellCode) != 0
  223. goto ShellCodeError
  224. endif
  225. set RegistryErrorIndex = $($R0)
  226. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  227. CloseRegKey $(KeyProduct)
  228. CloseRegKey $(SoftNetRulesKey)
  229. goto fatalregistry
  230. endif
  231. set NewValueList = {{type,0,$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  232. {use,0,$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  233. {bindform,0,$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  234. {class,0,$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  235. {bindable,0,$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  236. {InfOption,0,$(!REG_VT_SZ),$(Option)}, +
  237. {Infname ,0,$(!REG_VT_SZ),$(ProductInfName)} }
  238. Shell $(UtilInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  239. ifint $($ShellCode) != 0
  240. goto ShellCodeError
  241. endif
  242. set RegistryErrorIndex = $($R0)
  243. CloseRegKey $(KeyProduct)
  244. CloseRegKey $(SoftNetRulesKey)
  245. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  246. goto fatalregistry
  247. endif
  248. ForListDo $(AdapterList)
  249. set BusNum = *($($),1)
  250. set SlotNum = *($($),2)
  251. Debug-Output "Bus Number = "$(BusNum)
  252. Debug-Output "Slot Number = "$(SlotNum)
  253. Shell $(UtilInf), IsNetCardAlreadyInstalled, $(BusNum), +
  254. $(SlotNum), +
  255. $(ProductHardwareDescription), +
  256. $(ProductHardwareName)
  257. ifint $($ShellCode) != 0
  258. goto ShellCodeError
  259. endif
  260. Ifstr $($R0) != NO_ERROR
  261. set Error = $($R0)
  262. goto fatal
  263. Endif
  264. ifstr(i) $($R1) != "YES"
  265. Shell $(UtilInf), AddHardwareComponent, $(ProductHardwareName),+
  266. $(ProductInfName),$(ProductKeyName)
  267. ifint $($R4) != -1
  268. Set REMOVE_HARDWARE = >($(REMOVE_HARDWARE),$(CardKey)"\"$($R4))
  269. endif
  270. ifint $($ShellCode) != 0
  271. goto ShellCodeError
  272. endif
  273. set RegistryErrorIndex = $($R0)
  274. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  275. CloseRegKey $($R1)
  276. CloseRegKey $($R2)
  277. CloseRegKey $($R3)
  278. goto fatalregistry
  279. Endif
  280. set KeyParameters = $($R3)
  281. set KeyAdapterRules = $($R2)
  282. set AdapterNumber = $($R4)
  283. set NewValueList = {{Manufacturer,0,$(!REG_VT_SZ),$(Manufacturer)},+
  284. {Title,0,$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  285. {Description,0,$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  286. {ProductName,0,$(!REG_VT_SZ),$(ProductHardwareName)},+
  287. {ServiceName,0,$(!REG_VT_SZ),$($R5)},+
  288. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)},+
  289. {InstallDate,0,$(!REG_VT_DWORD),*($(Now),1)}}
  290. Shell $(UtilInf), AddValueList, $($R1), $(NewValueList)
  291. ifint $($ShellCode) != 0
  292. goto ShellCodeError
  293. endif
  294. CloseRegKey $($R1)
  295. set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  296. set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  297. set NewValueList = {{type,0,$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  298. {bindform,0,$(!REG_VT_SZ),$(TempBindForm)}, +
  299. {class,0,$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  300. {InfOption,0,$(!REG_VT_SZ),$(Option)}, +
  301. {Infname ,0,$(!REG_VT_SZ),$(ProductInfName)}}
  302. Shell $(UtilInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  303. ifint $($ShellCode) != 0
  304. goto ShellCodeError
  305. endif
  306. set RegistryErrorIndex = $($R0)
  307. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  308. CloseRegKey $(KeyParameters)
  309. CloseRegKey $(KeyAdapterRules)
  310. goto fatalregistry
  311. endif
  312. CloseRegKey $(KeyAdapterRules)
  313. EndForListDo
  314. goto writeparameters
  315. configureadapter = +
  316. read-syms NoConfig$(!STF_LANGUAGE)
  317. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  318. goto end
  319. ;------------------------------------------------------------------
  320. writeparameters = +
  321. set NewValueList = {{BusNumber,0,$(!REG_VT_DWORD),$(BusNum)},+
  322. {MediaType,0,$(!REG_VT_DWORD),5},+
  323. {McaPosId,0,$(!REG_VT_DWORD),$(NETCARD_ID)},+
  324. {BusType,0,$(!REG_VT_DWORD),3},+
  325. {Server,0,$(!REG_VT_DWORD),1},+
  326. {SlotNumber,0,$(!REG_VT_DWORD),$(SlotNum)}}
  327. Shell $(UtilInf), AddValueList, $(KeyParameters), $(NewValueList)
  328. CloseRegKey $(KeyParameters)
  329. ifint $($ShellCode) != 0
  330. Debug-Output "ShellCode error."
  331. goto ShellCodeError
  332. endif
  333. set RegistryErrorIndex = $($R0)
  334. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  335. goto fatalregistry
  336. endif
  337. goto end
  338. ;--------------------------------------------------------------------------
  339. bindingadapter = +
  340. goto end
  341. removeadapter = +
  342. Set FLibraryErrCtl = 1
  343. Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  344. Shell $(UtilInf), RemoveSoftwareComponent, $(Manufacturer),$(ProductSoftwareName)
  345. ifint $($ShellCode) != 0
  346. Debug-Output "ShellCode error"
  347. goto ShellCodeError
  348. endif
  349. set RegistryErrorIndex = $($R0)
  350. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  351. goto fatalregistry
  352. endif
  353. else
  354. Shell $(UtilInf), RemoveHardwareComponent, $(Manufacturer),$(ProductSoftwareName), $(!NTN_RegBase)
  355. ifint $($ShellCode) != 0
  356. Debug-Output "ShellCode error"
  357. goto ShellCodeError
  358. endif
  359. set RegistryErrorIndex = $($R0)
  360. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  361. goto fatalregistry
  362. endif
  363. endif
  364. goto end
  365. UpgradeSoftware = +
  366. ; Upgrade software component
  367. ;
  368. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  369. Ifstr $(KeyProduct) != $(KeyNull)
  370. install "Install-Update"
  371. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  372. goto fatal
  373. endif
  374. ; Upgrade the version number
  375. ;
  376. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  377. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  378. ;
  379. ; do nothing for update
  380. ;
  381. CloseRegKey $(KeyProduct)
  382. else
  383. ;
  384. ; Cannot Open software key, goto ERROR
  385. ;
  386. goto fatalregistry
  387. endif
  388. ;
  389. ; Enumerate all netcards installed of this type and update them
  390. ;
  391. set iSearch = 1
  392. nextnetcard = +
  393. Shell $(UtilityInf), FindNextNetworkCard, $(ProductHardwareName), $(iSearch)
  394. set KeyNetcard = $($R0)
  395. set iSearch = $($R1)
  396. Debug-Output "OemNadEp.Inf: FindNextNetworkCard "$(KeyNetcard)","$(iSearch)
  397. Ifstr $(KeyNetcard) != $(KeyNull)
  398. Debug-Output "OemNadEp.Inf: Setting OperationsSupport value"
  399. SetRegValue $(KeyNetcard) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  400. CloseRegKey $(KeyNetcard)
  401. goto nextnetcard
  402. Endif
  403. goto end
  404. successful = +
  405. installstep1 = +
  406. goto end
  407. abandon = +
  408. ForListDo $(REMOVE_HARDWARE)
  409. Shell $(UtilInf), RemoveHardwareComponent, $(Manufacturer), +
  410. $(ProductSoftwareName), $($)
  411. ifint $($ShellCode) != 0
  412. Debug-Output "ShellCode error"
  413. goto ShellCodeError
  414. endif
  415. set RegistryErrorIndex = $($R0)
  416. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  417. goto fatalregistry
  418. endif
  419. EndForListDo
  420. Ifstr(i) $(REMOVE_SOFTWARE) == TRUE
  421. Shell $(UtilInf), RemoveSoftwareComponent, +
  422. $(Manufacturer), +
  423. $(ProductSoftwareName), FALSE
  424. ifint $($ShellCode) != 0
  425. goto ShellCodeError
  426. endif
  427. set RegistryErrorIndex = $($R0)
  428. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  429. goto fatalregistry
  430. endif
  431. endif
  432. goto end
  433. fatalregistry = +
  434. Shell $(UtilInf) RegistryErrorString $(RegistryErrorIndex)
  435. ifint $($ShellCode) != 0
  436. goto ShellCodeError
  437. endif
  438. set Error = $($R0)
  439. goto fatal
  440. fatal = +
  441. ifstr(i) $(!NTN_InstallMode) == install
  442. read-syms MiscErrorString3$(!STF_LANGUAGE)
  443. Shell $(SubInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(ErrorString)$(Error)
  444. Else
  445. Shell $(SubInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  446. EndIf
  447. ifint $($ShellCode) != 0
  448. goto ShellCodeError
  449. endif
  450. goto setfailed
  451. ShellCodeError = +
  452. read-syms ShellingError$(!STF_LANGUAGE)
  453. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "FATAL" $(ErrorString)
  454. setfailed = +
  455. set CommonStatus = STATUS_FAILED
  456. ifstr(i) $(RemoveOnError) == TRUE
  457. Set RemoveOnError = FALSE
  458. goto abandon
  459. Endif
  460. goto end
  461. usercancel = +
  462. set CommonStatus = STATUS_USERCANCEL
  463. end = +
  464. Return $(CommonStatus)
  465. [Install-Initial]
  466. Set STF_VITAL = ""
  467. AddSectionFilesToCopyList Files-LT200 $(SrcDir) $(!STF_WINDOWSSYSPATH)"\DRIVERS"
  468. CopyFilesInCopyList
  469. exit
  470. [Install-Update]
  471. Set STF_VITAL = ""
  472. AddSectionFilesToCopyList Files-LT200 $(SrcDir) $(!STF_WINDOWSSYSPATH)"\DRIVERS"
  473. exit