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.

443 lines
14 KiB

  1. [Identification]
  2. OptionType = NetTransport
  3. [LanguagesSupported]
  4. ENG
  5. [Options]
  6. RCA
  7. [OptionsTextENG]
  8. RCA = "NDIS RCA Filter"
  9. [FileConstants]
  10. UtilityInf = "UTILITY.INF"
  11. subroutineinf = "SUBROUTN.INF"
  12. SoftwareType = "transport"
  13. Exit_Code = 0
  14. NetEventDLL = "%SystemRoot%\System32\netevent.dll"
  15. Manufacturer = "Microsoft"
  16. ProductMajorVersion = "1"
  17. ProductMinorVersion = "0"
  18. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  19. ProductSoftwareName = "RCA"
  20. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\RCA.SYS"
  21. NetRuleSoftwareType = "RCA RCA"
  22. NetRuleSoftwareClass = {"RCA basic"}
  23. NetRuleSoftwareUse = $(SoftwareType)" no yes"
  24. NetRuleSoftwareBindForm = """RCA"" yes yes container"
  25. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  26. ParamKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)"\Parameters"
  27. ServiceKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)
  28. [GeneralConstants]
  29. from = ""
  30. to = ""
  31. ExitCodeOk = 0
  32. ExitCodeCancel = 1
  33. ExitCodeFatal = 2
  34. KeyNull = ""
  35. MAXIMUM_ALLOWED = 33554432
  36. RegistryErrorIndex = NO_ERROR
  37. KeyProduct = ""
  38. KeyParameters = ""
  39. TRUE = 1
  40. FALSE = 0
  41. NoTitle = 0
  42. ExitState = "Active"
  43. OldVersionExisted = $(FALSE)
  44. DriverPath = $(!STF_NTPATH)\drivers
  45. [date]
  46. Now = {} ? $(!LIBHANDLE) GetSystemDate
  47. [platform]
  48. STF_PLATFORM = "" ? $(!LIBHANDLE) GetPlatform
  49. [Identify]
  50. read-syms Identification
  51. set Status = STATUS_SUCCESSFUL
  52. set Identifier = $(OptionType)
  53. set Media = #("Source Media Descriptions", 1, 1)
  54. Return $(Status) $(Identifier) $(Media)
  55. [ReturnOptions]
  56. set Status = STATUS_FAILED
  57. set OptionList = {}
  58. set OptionTextList = {}
  59. set LanguageList = ^(LanguagesSupported, 1)
  60. Ifcontains(i) $($0) in $(LanguageList)
  61. goto returnoptions
  62. else
  63. set Status = STATUS_NOLANGUAGE
  64. goto finish_ReturnOptions
  65. endif
  66. returnoptions = +
  67. set OptionList = ^(Options, 1)
  68. set OptionTextList = ^(OptionsText$($0), 1)
  69. set Status = STATUS_SUCCESSFUL
  70. finish_ReturnOptions = +
  71. Return $(Status) $(OptionList) $(OptionTextList)
  72. [InstallOption]
  73. set Option = $($1)
  74. set SrcDir = $($2)
  75. set AddCopy = $($3)
  76. set DoCopy = $($4)
  77. set DoConfig = $($5)
  78. set LanguageList = ^(LanguagesSupported, 1)
  79. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  80. Return STATUS_NOLANGUAGE
  81. endif
  82. Debug-Output "OEMSETUP.INF: STF_CWDDIR is: "$(!STF_CWDDIR)
  83. Debug-Output "OEMSETUP.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  84. set-subst LF = "\n"
  85. read-syms GeneralConstants
  86. read-syms FileConstants
  87. read-syms DialogConstants$(!STF_LANGUAGE)
  88. ifstr(i) $(!NTN_Origination) == "NCPA"
  89. set Continue = $(OK)
  90. endif
  91. read-syms FileConstants$(!STF_LANGUAGE)
  92. detect date
  93. detect platform
  94. set-title $(FunctionTitle)
  95. set to = Begin
  96. set from = Begin
  97. set CommonStatus = STATUS_SUCCESSFUL
  98. EndWait
  99. Begin = +
  100. Ifstr(i) $(!NTN_InstallMode) == deinstall
  101. set StartLabel = removeadapter
  102. else-Ifstr(i) $(!NTN_InstallMode) == Update
  103. set StartLabel = UpgradeSoftware
  104. else-Ifstr(i) $(!NTN_InstallMode) == bind
  105. set StartLabel = bindingadapter
  106. else-Ifstr(i) $(!NTN_InstallMode) == configure
  107. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  108. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  109. Debug-Output "OEMSETUP.INF: ShellCode error: cannot get an error string."
  110. goto ShellCodeError
  111. endif
  112. set Error = $($R0)
  113. set from = end
  114. set to = end
  115. goto nonfatalinfo
  116. else
  117. set StartLabel = installadapter
  118. endif
  119. set RadioDefault = 2
  120. set RadioIn = {$(RadioDefault)}
  121. set from = $(fatal)
  122. set to = $(fatal)
  123. goto $(StartLabel)
  124. installadapter = +
  125. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  126. Ifstr $(KeyProduct) != $(KeyNull)
  127. CloseRegKey $(KeyProduct)
  128. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  129. $(ProductVersion)
  130. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  131. Debug-Output "ShellCode error: cannot get an error string."
  132. goto ShellCodeError
  133. endif
  134. goto end
  135. endif
  136. CloseRegKey $(KeyProduct)
  137. goto installproduct
  138. installproduct = +
  139. StartWait
  140. ifint $(OldVersionExisted) == $(FALSE)
  141. Ifstr(i) $(DoCopy) == "YES"
  142. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  143. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  144. Goto ShellCodeError
  145. Else-Ifstr(i) $($R0) == STATUS_FAILED
  146. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  147. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  148. goto ShellCodeError
  149. endif
  150. set Error = $($R0)
  151. Goto fatal
  152. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  153. Goto successful
  154. Endif
  155. Set SrcDir = $($R1)
  156. Endif
  157. Shell "" StripTrailSlash $(SrcDir)
  158. set PlatformDir = $($R0)"\"$(STF_PLATFORM)
  159. set InfDir = $($R0)"\"
  160. install "Install-Option"
  161. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  162. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  163. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  164. goto ShellCodeError
  165. endif
  166. set Error = $($R0)
  167. goto fatal
  168. endif
  169. set OEM_ABANDON_ON = TRUE
  170. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  171. $(ProductSoftwareName), +
  172. $(ProductSoftwareName), +
  173. $(ProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
  174. $(ProductSoftwareImagePath), "kernel", "PNP_TDI", {}, "",+
  175. $(NetEventDLL)
  176. set RegistryErrorIndex = $($R0)
  177. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  178. EndWait
  179. CloseRegKey $($R1)
  180. CloseRegKey $($R2)
  181. CloseRegKey $($R3)
  182. CloseRegKey $($R4)
  183. CloseRegKey $($R5)
  184. goto fatalRegistry
  185. endif
  186. Set SoftProductKey = $($R1)
  187. Set SoftNetRuleKey = $($R2)
  188. Set SoftServiceKey = $($R3)
  189. set SoftParameterKey = $($R4)
  190. Set SoftLinkageKey = $($R5)
  191. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  192. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  193. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  194. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  195. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  196. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  197. {Review,$(NoTitle),$(!REG_VT_DWORD),1},+
  198. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  199. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  200. set RegistryErrorIndex = $($R0)
  201. Ifstr $(RegistryErrorIndex) != NO_ERROR
  202. CloseRegKey $(SoftProductKey)
  203. CloseRegKey $(SoftNetRuleKey)
  204. CloseRegKey $(SoftServiceKey)
  205. CloseRegKey $(SoftParameterKey)
  206. CloseRegKey $(SoftLinkageKey)
  207. goto fatalRegistry
  208. endif
  209. set NewValueList = {{type ,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)}, +
  210. {use ,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  211. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  212. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  213. {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  214. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  215. set RegistryErrorIndex = $($R0)
  216. Ifstr $(RegistryErrorIndex) != NO_ERROR
  217. CloseRegKey $(SoftProductKey)
  218. CloseRegKey $(SoftNetRuleKey)
  219. CloseRegKey $(SoftServiceKey)
  220. CloseRegKey $(SoftParameterKey)
  221. CloseRegKey $(SoftLinkageKey)
  222. goto fatalRegistry
  223. endif
  224. CloseRegKey $(SoftProductKey)
  225. CloseRegKey $(SoftNetRuleKey)
  226. CloseRegKey $(SoftServiceKey)
  227. CloseRegKey $(SoftParameterKey)
  228. CloseRegKey $(SoftLinkageKey)
  229. endif
  230. goto successful
  231. bindingadapter =+
  232. ; Set the DependOnService Key
  233. Set RegKey = $(!NTN_ServiceBase)"\RCA"
  234. OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) RCAKey
  235. ifstr(i) $(RCAKey) != ""
  236. SetRegValue $(RCAKey) {"DependOnService",$(NoTitle),$(!REG_VT_MULTI_SZ),{""}}
  237. CloseRegKey $(RCAKey)
  238. else
  239. Debug-Output "failed to open RCA key"
  240. endif
  241. goto successful
  242. removeadapter = +
  243. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  244. $(ProductSoftwareName)
  245. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  246. Debug-Output "ShellCode error"
  247. goto ShellCodeError
  248. endif
  249. set RegistryErrorIndex = $($R0)
  250. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  251. goto fatalregistry
  252. endif
  253. goto end
  254. UpgradeSoftware = +
  255. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  256. Ifstr $(KeyProduct) != $(KeyNull)
  257. install "Install-Update"
  258. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  259. goto fatal
  260. endif
  261. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  262. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  263. SetRegValue $(KeyProduct) {"Description",$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)}
  264. SetRegValue $(KeyProduct) {"Title",$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)}
  265. CloseRegKey $(KeyProduct)
  266. OpenRegKey $(!REG_H_LOCAL) "" $(ServiceKeyName) $(MAXIMUM_ALLOWED) ServiceKey
  267. ifstr(i) $(ServiceKey) != ""
  268. SetRegValue $(ServiceKey) {"DisplayName",$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDisplayName)}
  269. CloseRegKey $(ServiceKey)
  270. endif
  271. else
  272. goto fatalregistry
  273. endif
  274. goto end
  275. successful = +
  276. goto end
  277. warning = +
  278. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  279. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  280. goto ShellCodeError
  281. endif
  282. ifstr(i) $($R1) == "OK"
  283. goto $(to)
  284. else-ifstr(i) $($R1) == "CANCEL"
  285. goto $(from)
  286. else
  287. goto "end"
  288. endif
  289. nonfatalinfo = +
  290. Set CommonStatus = STATUS_USERCANCEL
  291. Set Severity = STATUS
  292. goto nonfatalmsg
  293. nonfatal = +
  294. Set Severity = NONFATAL
  295. goto nonfatalmsg
  296. nonfatalmsg = +
  297. ifstr(i) $(Error) == ""
  298. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  299. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  300. goto ShellCodeError
  301. endif
  302. set Error = $($R0)
  303. endif
  304. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  305. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  306. goto ShellCodeError
  307. endif
  308. ifstr(i) $($R1) == "OK"
  309. goto $(from)
  310. else
  311. goto "end"
  312. endif
  313. fatalregistry = +
  314. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  315. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  316. goto ShellCodeError
  317. endif
  318. set Error = $($R0)
  319. goto fatal
  320. fatal = +
  321. ifstr(i) $(Error) == ""
  322. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  323. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  324. goto ShellCodeError
  325. endif
  326. set Error = $($R0)
  327. endif
  328. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  329. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  330. goto ShellCodeError
  331. endif
  332. goto setfailed
  333. ShellCodeError = +
  334. set DlgType = "MessageBox"
  335. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  336. set STF_MB_TEXT = $(ShellCodeErrorText)
  337. set STF_MB_TYPE = 1
  338. set STF_MB_ICON = 3
  339. set STF_MB_DEF = 1
  340. ui start "Error Message"
  341. goto setfailed
  342. setfailed = +
  343. set CommonStatus = STATUS_FAILED
  344. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  345. set OEM_ABANDON_ON = FALSE
  346. goto removeadapter
  347. endif
  348. goto end
  349. end = +
  350. goto term
  351. term = +
  352. Return $(CommonStatus)
  353. [StripTrailSlash]
  354. Split-String $($0) "\" InList
  355. QueryListSize InListSize, $(InList)
  356. Ifint $(InListSize) <= 1
  357. Return $($0)
  358. Endif
  359. Set NewString = ""
  360. ForListDo $(InList)
  361. ifint $(#) < $(InListSize)
  362. Set NewString = $(NewString)$($)
  363. else-ifstr $($) != "\"
  364. Set NewString = $(NewString)$($)
  365. endif
  366. EndForListDo
  367. Return $(NewString)
  368. [Install-Option]
  369. set STF_VITAL = ""
  370. ifstr(i) $(AddCopy) == "YES"
  371. AddSectionFilesToCopyList Files-Platform-Drivers $(PlatformDir) $(!STF_WINDOWSSYSPATH)\drivers
  372. ; AddSectionFilesToCopyList Files-Platform-Utils $(PlatformDir) $(!STF_WINDOWSSYSPATH)
  373. endif
  374. ifstr(i) $(DoCopy) == "YES"
  375. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  376. CopyFilesInCopyList
  377. endif
  378. ifstr(i) $(DoConfig) == "YES"
  379. endif
  380. Exit
  381. [Install-Update]
  382. set STF_VITAL = ""
  383. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  384. AddSectionFilesToCopyList Files-Platform-Drivers $(PlatformDir) $(!STF_WINDOWSSYSPATH)\drivers
  385. ; AddSectionFilesToCopyList Files-Platform-Utils $(PlatformDir) $(!STF_WINDOWSSYSPATH)
  386. AddSectionFilesToCopyList Files-Inf $(InfDir) $(!STF_WINDOWSSYSPATH)
  387. exit
  388. [Source Media Descriptions]
  389. 1 = "RCA Installation Disk"
  390. [ProductType]
  391. STF_PRODUCT = Winnt
  392. [Files-Inf]
  393. 1, OEMSETUP.INF, SIZE=999
  394. ;1, OEMSETUP.INF, SIZE=999, RENAME=$(!UG_Filename)
  395. [Files-Platform-Drivers]
  396. 1, RCA.SYS , SIZE=999
  397. [FileConstantsENG]
  398. ProCaption = "Windows NT Setup"
  399. ProCancel = "Cancel"
  400. ProCancelMsg = "Windows NT Networking is not correctly installed. "+
  401. "Are you sure you want to cancel copying files?"
  402. ProCancelCap = "Network Setup Message"
  403. ProText1 = "Copying:"
  404. ProText2 = "To:"
  405. FunctionTitle = "RCA"
  406. ProductSoftwareDescription = "RCA 1.0. Provides Raw Channel Access via CSA/ActiveMovie."
  407. ProductSoftwareDisplayName = "RCA Filter"
  408. ProductSoftwareTitle = "RCA Filter"
  409. ShellCodeErrorTitle = "Error: "$(FunctionTitle)
  410. ShellCodeErrorText = "Shell Code Error."
  411. [DialogConstantsENG]
  412. Help = "&Help"
  413. Exit = "Cancel"
  414. OK = "OK"
  415. HelpContext = ""
  416. Continue = "Continue"
  417. Cancel = "Cancel"
  418.