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.

890 lines
25 KiB

  1. ;***********************************************************************
  2. ;
  3. ; OEMNSVFT.INF
  4. ;
  5. ; FTP Server driver SETUP INF file.
  6. ;
  7. ; History:
  8. ; thomaspa 05-Mar-1993 Created
  9. ;
  10. ;***********************************************************************
  11. ;-----------------------------------------------------------------------
  12. ; OPTION TYPE
  13. ; -----------
  14. ; This identifies the Option type we are dealing with. The different
  15. ; possible types are:
  16. ;
  17. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  18. ;
  19. ; Types specific to networking:
  20. ;
  21. ; NetAdapter, a netcard / adapter combination or just a netcard
  22. ; NetDriver, just a netcard driver
  23. ; NetTransport, a complete NDIS-compliant TDI transport stack
  24. ; NetService, an NT networking service
  25. ; NetWork, a complete network ensemble.
  26. ; NetProvider a complete network which supports NT MPR protocol
  27. ;-----------------------------------------------------------------------
  28. [Identification]
  29. OptionType = NetService
  30. ;-----------------------------------------------------------------------
  31. ; OPTION LIST
  32. ; -----------
  33. ; This section lists the OEM Option key names. These keys are locale
  34. ; independent and used to represent the option in a locale independent
  35. ; manner.
  36. ;
  37. ;-----------------------------------------------------------------------
  38. [Options]
  39. FTPD
  40. ;***********************************************************************
  41. ; CONSTANTS FOR USING DIALOGS
  42. ;***********************************************************************
  43. [FileConstants]
  44. ;
  45. ; File names, etc.
  46. ;
  47. UtilityInf = "UTILITY.INF"
  48. subroutineinf = "SUBROUTN.INF"
  49. SoftwareType = "service"
  50. Exit_Code = 0
  51. ;ShellCode = 0
  52. ;
  53. ; EventLog Message File
  54. ;
  55. FTPMsgDLL = "%SystemRoot%\System32\ftpsvc.dll"
  56. ;
  57. ; Product Info
  58. ;
  59. Manufacturer = "Microsoft"
  60. ProductMajorVersion = "4"
  61. ProductMinorVersion = "0"
  62. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  63. ;
  64. ; Software
  65. ;
  66. ProductSoftwareName = "FTPSVC"
  67. ProductSoftwareImagePath = "%SystemRoot%\System32\tcpsvcs.exe"
  68. ;
  69. ; Registry Key
  70. ;
  71. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  72. SystemService = $(!NTN_ServiceBase)
  73. ServiceKeyName = $(!NTN_ServiceBase)
  74. TCPIPKeyName = $(!NTN_ServiceBase)"\TCPIP"
  75. FTPServiceKeyName = $(!NTN_ServiceBase)"\"$(ProductSoftwareName)
  76. PerformanceKeyName = $(FTPServiceKeyName)"\Performance"
  77. [GeneralConstants]
  78. ;
  79. ; Program flow control variables.
  80. ;
  81. from = ""
  82. to = ""
  83. ;
  84. ; Return codes; Exit_Code is set to one of these
  85. ;
  86. ExitCodeOk = 0
  87. ExitCodeCancel = 1
  88. ExitCodeFatal = 2
  89. KeyNull = ""
  90. MAXIMUM_ALLOWED = 33554432
  91. SERVICE_NO_CHANGE = 4294967295
  92. RegistryErrorIndex = NO_ERROR
  93. KeyProduct = ""
  94. KeyParameters = ""
  95. TRUE = 1
  96. FALSE = 0
  97. NoTitle = 0
  98. ExitState = "Active"
  99. OldVersionExisted = $(FALSE)
  100. DefaultStatusReturn = STATUS_NO_EFFECT
  101. DriverPath = $(!STF_NTPATH)\drivers
  102. [date]
  103. ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  104. ; Minute, Second }
  105. Now = {} ? $(!LIBHANDLE) GetSystemDate
  106. ;---------------------------------------------------------------------------
  107. ; 1. Identify
  108. ;
  109. ; DESCRIPTION: To verify that this INF deals with the same type of options
  110. ; as we are choosing currently.
  111. ;
  112. ; INPUT: None
  113. ;
  114. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL
  115. ; $($R1): Option Type (COMPUTER ...)
  116. ; $($R2): Diskette description
  117. ;---------------------------------------------------------------------------
  118. [Identify]
  119. ;
  120. ;
  121. read-syms Identification
  122. set Status = STATUS_SUCCESSFUL
  123. set Identifier = $(OptionType)
  124. set Media = #("Source Media Descriptions", 1, 1)
  125. Return $(Status) $(Identifier) $(Media)
  126. ;------------------------------------------------------------------------
  127. ; 2. ReturnOptions:
  128. ;
  129. ; DESCRIPTION: To return the option list supported by this INF and the
  130. ; localised text list representing the options.
  131. ;
  132. ;
  133. ; INPUT: $($0): Language used. ( ENG | FRN | ... )
  134. ;
  135. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  136. ; STATUS_NOLANGUAGE
  137. ; STATUS_FAILED
  138. ;
  139. ; $($R1): Option List
  140. ; $($R2): Option Text List
  141. ;------------------------------------------------------------------------
  142. [ReturnOptions]
  143. ;
  144. ;
  145. set Status = STATUS_FAILED
  146. set OptionList = {}
  147. set OptionTextList = {}
  148. ;
  149. ; Check if the language requested is supported
  150. ;
  151. set LanguageList = ^(LanguagesSupported, 1)
  152. Ifcontains(i) $($0) in $(LanguageList)
  153. goto returnoptions
  154. else
  155. set Status = STATUS_NOLANGUAGE
  156. goto finish_ReturnOptions
  157. endif
  158. ;
  159. ; form a list of all the options and another of the text representing
  160. ;
  161. returnoptions = +
  162. set OptionList = ^(Options, 1)
  163. set OptionTextList = ^(OptionsText$($0), 1)
  164. set Status = STATUS_SUCCESSFUL
  165. finish_ReturnOptions = +
  166. Return $(Status) $(OptionList) $(OptionTextList)
  167. ;----------InstallOption-------------------------------------------------
  168. ;
  169. ; InstallOption:
  170. ;
  171. ; This section is shelled to by main installation processing
  172. ; or by NCPASHEL.INF during reconfig, removal, update, etc.
  173. ;
  174. ;
  175. ; FUNCTION: To copy files representing Options
  176. ; To configure the installed option
  177. ; To update the registry for the installed option
  178. ;
  179. ; INPUT: $($0): Language to use
  180. ; $($1): OptionID to install
  181. ; $($2): SourceDirectory
  182. ; $($3): AddCopy (YES | NO)
  183. ; $($4): DoCopy (YES | NO)
  184. ; $($5): DoConfig (YES | NO)
  185. ;
  186. ; OUTPUT: $($R0): STATUS: STATUS_SUCCESSFUL |
  187. ; STATUS_NOLANGUAGE |
  188. ; STATUS_USERCANCEL |
  189. ; STATUS_FAILED
  190. ;
  191. ;------------------------------------------------------------------------
  192. [InstallOption]
  193. ;
  194. ; extract parameters
  195. ;
  196. set Option = $($1)
  197. set SrcDir = $($2)
  198. set AddCopy = $($3)
  199. set DoCopy = $($4)
  200. set DoConfig = $($5)
  201. ;
  202. ; Check if the language requested is supported
  203. ;
  204. set LanguageList = ^(LanguagesSupported, 1)
  205. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  206. Return STATUS_NOLANGUAGE
  207. endif
  208. Debug-Output "OEMNSVFT.INF: STF_CWDIR is: "$(!STF_CWDIR)
  209. Debug-Output "OEMNSVFT.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  210. LoadLibrary "x" $(!STF_CWDDIR)\tcpcfg.dll !TCPCFG_HANDLE
  211. ; define all the constants
  212. set-subst LF = "\n"
  213. read-syms GeneralConstants
  214. read-syms FileConstants
  215. read-syms DialogConstants$(!STF_LANGUAGE)
  216. ifstr(i) $(!NTN_Origination) == "NCPA"
  217. set Continue = $(OK)
  218. endif
  219. read-syms FileConstants$(!STF_LANGUAGE)
  220. detect date
  221. set-title $(FunctionTitle)
  222. set to = Begin
  223. set from = Begin
  224. ;
  225. ; Assume all is well.
  226. ;
  227. set CommonStatus = STATUS_SUCCESSFUL
  228. EndWait
  229. ;
  230. ; Set up the operation-mode-based variables and gaily welcome
  231. ; the user. If the "install mode" variable is improperly set,
  232. ; assume this is a new installation.
  233. ;
  234. Begin = +
  235. Ifstr(i) $(!NTN_InstallMode) == deinstall
  236. set StartLabel = removeadapter
  237. else-Ifstr(i) $(!NTN_InstallMode) == Update
  238. set StartLabel = UpgradeSoftware
  239. else-Ifstr(i) $(!NTN_InstallMode) == bind
  240. set StartLabel = bindingadapter
  241. else-Ifstr(i) $(!NTN_InstallMode) == configure
  242. set StartLabel = configureadapter
  243. else
  244. set StartLabel = installadapter
  245. endif
  246. set from = $(fatal)
  247. set to = $(fatal)
  248. goto $(StartLabel)
  249. ;-----------------------------------------------
  250. ; Installation Section
  251. ;-----------------------------------------------
  252. installadapter = +
  253. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  254. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  255. Goto ShellCodeError
  256. Else-Ifstr(i) $($R0) == STATUS_FAILED
  257. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  258. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  259. goto ShellCodeError
  260. endif
  261. set Error = $($R0)
  262. Goto fatal
  263. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  264. Goto successful
  265. Endif
  266. Set SrcDir = $($R1)
  267. OpenRegKey $(!REG_H_LOCAL) "" $(TCPIPKeyName) $(MAXIMUM_ALLOWED) TCPIPKey
  268. Ifstr $(TCPIPKey) == $(KeyNull)
  269. ;
  270. ; Tcpip section does not exist
  271. ;
  272. set RegistryErrorIndex = TCPIP_NONEXIST_ERROR_FTPD
  273. goto fatalregistry
  274. endif
  275. CloseRegKey $(TCPIPKey)
  276. ;
  277. ; Confirm installation
  278. ;
  279. set FLibraryErrCtl = 1
  280. LibraryProcedure ResultList, $(!TCPCFG_HANDLE), CPlFtpdConfirmInstall, $(!STF_HWND)
  281. Set Result = *($(ResultList),1)
  282. ifint $(Result) == 1
  283. set CommonStatus = STATUS_USERCANCEL
  284. goto Successful
  285. endif
  286. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  287. Ifstr $(KeyProduct) != $(KeyNull)
  288. ;
  289. ; Same version already existed in the local machine
  290. ; Popup the dialog and ask the user whether he wants to continue
  291. ;
  292. CloseRegKey $(KeyProduct)
  293. Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  294. $(ProductVersion)
  295. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  296. Debug-Output "ShellCode error: cannot get an error string."
  297. goto ShellCodeError
  298. endif
  299. goto end
  300. endif
  301. StartWait
  302. ifstr(i) $(OldVersionExisted) == $(FALSE)
  303. install "Install-Option"
  304. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  305. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  306. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  307. goto ShellCodeError
  308. endif
  309. set Error = $($R0)
  310. goto fatal
  311. endif
  312. set OEM_ABANDON_ON = TRUE
  313. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  314. $(ProductSoftwareName), $(ProductSoftwareName),+
  315. $(ProductSoftwareDisplayName), +
  316. $(STF_CONTEXTINFNAME), $(ProductSoftwareImagePath), "autoserviceshare", "",+
  317. {"Tcpip","Afd"}, "", $(FTPMsgDLL)
  318. Set SoftwareProductKey = $($R1)
  319. Set SoftwareNetRuleKey = $($R2)
  320. Set SoftwareServiceKey = $($R3)
  321. Set KeyParameters = $($R4)
  322. Set SoftLinkageKey = $($R5)
  323. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  324. Debug-Output "ShellCode error"
  325. goto ShellCodeError
  326. endif
  327. set RegistryErrorIndex = $($R0)
  328. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  329. EndWait
  330. Debug-Output "Registry error: add software components"
  331. CloseRegKey $(SoftwareProductKey)
  332. CloseRegKey $(SoftwareNetRuleKey)
  333. CloseRegKey $(SoftwareServiceKey)
  334. CloseRegKey $(KeyParameters)
  335. CloseRegKey $(SoftLinkageKey)
  336. goto fatalregistry
  337. endif
  338. ; Seed the parameters
  339. Set MaxConnections = 20
  340. Set HomeDirectory = "C:\"
  341. Set AllowAnonymous = 0
  342. read-syms Defaults$(!STF_LANGUAGE)
  343. Set WriteAccessMask = 0
  344. Set ReadAccessMask = 0
  345. Set AnonymousOnly = 0
  346. Set ConnectionTimeout = 600
  347. set NewValueList = {{MaxConnections,$(NoTitle),$(!REG_VT_DWORD),$(MaxConnections)},+
  348. {HomeDirectory,$(NoTitle),$(!REG_VT_SZ),$(HomeDirectory)},+
  349. {AllowAnonymous,$(NoTitle),$(!REG_VT_DWORD),$(AllowAnonymous)},+
  350. {AnonymousUsername,$(NoTitle),$(!REG_VT_SZ),$(AnonymousUsername)},+
  351. {WriteAccessMask,$(NoTitle),$(!REG_VT_DWORD),$(WriteAccessMask)},+
  352. {ReadAccessMask,$(NoTitle),$(!REG_VT_DWORD),$(ReadAccessMask)},+
  353. {AnonymousOnly,$(NoTitle),$(!REG_VT_DWORD),$(AnonymousOnly)},+
  354. {ConnectionTimeout,$(NoTitle),$(!REG_VT_DWORD),$(ConnectionTimeout)}}
  355. Shell $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  356. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  357. Debug-Output "ShellCode error."
  358. goto ShellCodeError
  359. endif
  360. set RegistryErrorIndex = $($R0)
  361. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  362. EndWait
  363. Debug-Output "Resgitry error: add value list."
  364. CloseRegKey $(SoftwareProductKey)
  365. CloseRegKey $(SoftwareNetRuleKey)
  366. CloseRegKey $(SoftwareServiceKey)
  367. CloseRegKey $(SoftLinkageKey)
  368. CloseRegKey $(KeyParameters)
  369. goto fatalregistry
  370. endif
  371. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  372. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  373. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  374. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  375. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  376. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  377. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  378. Shell $(UtilityInf), AddValueList, $(SoftwareProductKey), $(NewValueList)
  379. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  380. Debug-Output "ShellCode error."
  381. goto ShellCodeError
  382. endif
  383. set RegistryErrorIndex = $($R0)
  384. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  385. EndWait
  386. Debug-Output "Resgitry error: add value list."
  387. CloseRegKey $(SoftwareProductKey)
  388. CloseRegKey $(SoftwareNetRuleKey)
  389. CloseRegKey $(SoftwareServiceKey)
  390. CloseRegKey $(SoftLinkageKey)
  391. CloseRegKey $(KeyParameters)
  392. goto fatalregistry
  393. endif
  394. set NewValueList = {{InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  395. Shell $(UtilityInf), AddValueList, $(SoftwareNetRuleKey), $(NewValueList)
  396. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  397. Debug-Output "ShellCode error."
  398. goto ShellCodeError
  399. endif
  400. set RegistryErrorIndex = $($R0)
  401. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  402. EndWait
  403. Debug-Output "Resgitry error: add value list."
  404. CloseRegKey $(SoftwareProductKey)
  405. CloseRegKey $(SoftwareNetRuleKey)
  406. CloseRegKey $(SoftwareServiceKey)
  407. CloseRegKey $(KeyParameters)
  408. CloseRegKey $(SoftLinkageKey)
  409. goto fatalregistry
  410. endif
  411. CloseRegKey $(SoftwareProductKey)
  412. CloseRegKey $(SoftwareNetRuleKey)
  413. CloseRegKey $(SoftLinkageKey)
  414. CloseRegKey $(KeyParameters)
  415. ;
  416. ; Performance stuff
  417. ;
  418. CreateRegKey $(SoftwareServiceKey) {"Performance",$(NoTitle),GenericClass} "" +
  419. $(MAXIMUM_ALLOWED) "" KeyPerformance
  420. set NewValueList = {{Library,$(NoTitle),$(!REG_VT_SZ),ftpctrs.dll}, +
  421. {Open,$(NoTitle),$(!REG_VT_SZ),"OpenFtpPerformanceData"}, +
  422. {Close,$(NoTitle),$(!REG_VT_SZ),"CloseFtpPerformanceData"}, +
  423. {Collect,$(NoTitle),$(!REG_VT_SZ),"CollectFtpPerformanceData"}}
  424. Shell $(UtilityInf), AddValueList, $(KeyPerformance), $(NewValueList)
  425. set RegistryErrorIndex = $($R0)
  426. Ifstr $(RegistryErrorIndex) != NO_ERROR
  427. CloseRegKey $(KeyPerformance)
  428. CloseRegKey $(SoftwareServiceKey)
  429. goto fatalRegistry
  430. endif
  431. CloseRegKey $(SoftwareServiceKey)
  432. CloseRegKey $(KeyPerformance)
  433. ; Add value for Server manager extension
  434. set SrvMgrExtKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\Network\smaddons"
  435. OpenRegKey $(!REG_H_LOCAL) "" $(SrvMgrExtKeyName) $(MAXIMUM_ALLOWED) KeySrvMgrExt
  436. Ifstr $(KeySrvMgrExt) == $(KeyNull)
  437. set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  438. goto fatalregistry
  439. endif
  440. set NewValueList = {{ftpsmx,$(NoTitle),$(!REG_VT_SZ),ftpsmx.dll}}
  441. Shell $(UtilityInf), AddValueList, $(KeySrvMgrExt), $(NewValueList)
  442. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  443. Debug-Output "ShellCode error."
  444. goto ShellCodeError
  445. endif
  446. set RegistryErrorIndes = $($R0)
  447. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  448. EndWait
  449. Debug-Output "Resgitry error: add value list."
  450. CloseRegKey $(KeySrvMgrExt)
  451. goto fatalregistry
  452. endif
  453. endif
  454. EndWait
  455. set FLibraryErrCtl = 1
  456. LibraryProcedure ResultList, $(!TCPCFG_HANDLE), CPlFtpd, $(!STF_HWND)
  457. Set Result = *($(ResultList),1)
  458. ifint $(Result) == 0
  459. set CommonStatus = STATUS_SUCCESSFUL
  460. else-ifint $(Result) == 1
  461. set CommonStatus = STATUS_USERCANCEL
  462. else
  463. set RegistryErrorIndex = $(Result)
  464. goto fatalregistry
  465. endif
  466. ;
  467. ; Set our master component for auto-self-removal
  468. ;
  469. Shell $(UtilityInf) SetMasterComponent Microsoft Tcpip $(STF_CONTEXTINFNAME) FTPD
  470. Goto successful
  471. ;-----------------------------------------------
  472. ; Configuration Section
  473. ;-----------------------------------------------
  474. configureadapter = +
  475. set FLibraryErrCtl = 1
  476. LibraryProcedure ResultList, $(!TCPCFG_HANDLE), CPlFtpd, $(!STF_HWND)
  477. Set Result = *($(ResultList),1)
  478. ifint $(Result) == 0
  479. set CommonStatus = STATUS_REBOOT
  480. else-ifint $(Result) == 1
  481. set CommonStatus = STATUS_USERCANCEL
  482. else
  483. set RegistryErrorIndex = $(Result)
  484. goto fatalregistry
  485. endif
  486. goto successful
  487. ;-----------------------------------------------
  488. ; Binding section
  489. ;-----------------------------------------------
  490. bindingadapter =+
  491. set Error = "Binding: Sorry, not yet implemented."
  492. goto fatal
  493. ;-----------------------------------------------
  494. ; Removeadapter section
  495. ;-----------------------------------------------
  496. removeadapter = +
  497. ;
  498. ; Remove FTP service
  499. ;
  500. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  501. $(ProductSoftwareName)
  502. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  503. Debug-Output "ShellCode error"
  504. goto ShellCodeError
  505. endif
  506. set RegistryErrorIndex = $($R0)
  507. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  508. goto fatalregistry
  509. endif
  510. set SrvMgrExtKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\Network\smaddons"
  511. OpenRegKey $(!REG_H_LOCAL) "" $(SrvMgrExtKeyName) $(MAXIMUM_ALLOWED) KeySrvMgrExt
  512. DeleteRegValue $(KeySrvMgrExt) "ftpsmx"
  513. CloseRegKey $(KeySrvMgrExt)
  514. goto end
  515. ;-----------------------------------------------
  516. ; Upgrade Software section
  517. ;-----------------------------------------------
  518. UpgradeSoftware = +
  519. ; Upgrade software component
  520. ;
  521. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  522. Ifstr $(KeyProduct) != $(KeyNull)
  523. install "Install-Update"
  524. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  525. goto fatal
  526. endif
  527. ; Upgrade the version number
  528. ;
  529. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  530. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  531. ;
  532. ; Change image path and dependencies
  533. ;
  534. LibraryProcedure Result, $(!LIBHANDLE), SetupChangeServiceConfig, "FTPSVC", $(SERVICE_NO_CHANGE), $(SERVICE_NO_CHANGE), $(SERVICE_NO_CHANGE), $(ProductSoftwareImagePath), "", "", "", "", ""
  535. ;
  536. ; Create the performance key
  537. ;
  538. OpenRegKey $(!REG_H_LOCAL) "" $(PerformanceKeyName) $(MAXIMUM_ALLOWED) KeyPerformance
  539. Ifstr $(KeyPerformance) == $(KeyNull)
  540. OpenRegKey $(!REG_H_LOCAL) "" $(FTPServiceKeyName) $(MAXIMUM_ALLOWED) SoftwareServiceKey
  541. Ifstr $(SoftwareServiceKey) == $(KeyNull)
  542. set RegistryErrorIndex = UNABLE_ACCESS_SOFTWARE_REG
  543. goto fatalregistry
  544. endif
  545. CreateRegKey $(SoftwareServiceKey) {"Performance",$(NoTitle),GenericClass} "" +
  546. $(MAXIMUM_ALLOWED) "" KeyPerformance
  547. CloseRegKey $(SoftwareServiceKey)
  548. set NewValueList = {{Library,$(NoTitle),$(!REG_VT_SZ),ftpctrs.dll}, +
  549. {Open,$(NoTitle),$(!REG_VT_SZ),"OpenFtpPerformanceData"}, +
  550. {Close,$(NoTitle),$(!REG_VT_SZ),"CloseFtpPerformanceData"}, +
  551. {Collect,$(NoTitle),$(!REG_VT_SZ),"CollectFtpPerformanceData"}}
  552. Shell $(UtilityInf), AddValueList, $(KeyPerformance), $(NewValueList)
  553. set RegistryErrorIndex = $($R0)
  554. Ifstr $(RegistryErrorIndex) != NO_ERROR
  555. CloseRegKey $(KeyPerformance)
  556. CloseRegKey $(SoftwareServiceKey)
  557. goto fatalRegistry
  558. endif
  559. ;
  560. ; Load the perfctrs.
  561. ;
  562. set FLibraryErrCtl = 1
  563. StartDetachedProcess ExitCode "" "" $(!STF_WINDOWSSYSPATH)\lodctr.exe ftpctrs.ini
  564. ifstr(i) $(ExitCode) == "ERROR"
  565. Debug-Output "OEMNSVFT.INF: error loading perfmon counters"
  566. endif
  567. set Status = STATUS_SUCCESSFUL
  568. set FLibraryErrCtl = 0
  569. Endif
  570. CloseRegKey $(KeyPerformance)
  571. CloseRegKey $(KeyProduct)
  572. else
  573. ;
  574. ; Cannot Open software key, goto ERROR
  575. ;
  576. goto fatalregistry
  577. endif
  578. goto end
  579. ;
  580. ; End of Upgrade Software
  581. ;
  582. ;
  583. ; Escape hatches
  584. ;
  585. successful = +
  586. goto end
  587. ;
  588. ; warning display
  589. ;
  590. warning = +
  591. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  592. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  593. goto ShellCodeError
  594. endif
  595. ifstr(i) $($R1) == "OK"
  596. goto $(to)
  597. else-ifstr(i) $($R1) == "CANCEL"
  598. goto $(from)
  599. else
  600. ; Debug-Msg "Error Error Bad DLGEVENT"
  601. goto "end"
  602. endif
  603. ;
  604. ; non fatal error display
  605. ;
  606. nonfatal = +
  607. ifstr(i) $(Error) == ""
  608. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  609. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  610. goto ShellCodeError
  611. endif
  612. set Error = $($R0)
  613. endif
  614. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error)
  615. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  616. goto ShellCodeError
  617. endif
  618. ifstr(i) $($R1) == "OK"
  619. goto $(from)
  620. else
  621. goto "end"
  622. endif
  623. ;
  624. ; Registry is broken
  625. ;
  626. fatalregistry = +
  627. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  628. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  629. goto ShellCodeError
  630. endif
  631. set Error = $($R0)
  632. goto fatal
  633. ;
  634. ; fatal error display
  635. ;
  636. fatal = +
  637. ifstr(i) $(Error) == ""
  638. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  639. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  640. goto ShellCodeError
  641. endif
  642. set Error = $($R0)
  643. endif
  644. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  645. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  646. goto ShellCodeError
  647. endif
  648. goto setfailed
  649. ;
  650. ; Shelling error
  651. ;
  652. ShellCodeError = +
  653. set DlgType = "MessageBox"
  654. set STF_MB_TITLE = $(ShellCodeErrorTitle)
  655. set STF_MB_TEXT = $(ShellCodeErrorText)
  656. set STF_MB_TYPE = 1
  657. set STF_MB_ICON = 3
  658. set STF_MB_DEF = 1
  659. ui start "Error Message"
  660. goto setfailed
  661. setfailed = +
  662. set CommonStatus = STATUS_FAILED
  663. Ifint $(RegistryErrorIndex) == TCPIP_NONEXIST_ERROR_FTPD
  664. set CommonStatus = STATUS_USERCANCEL
  665. endif
  666. ;
  667. ; If OEM_ABANDON_ON, we need to clean up the registry
  668. ;
  669. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  670. set OEM_ABANDON_ON = FALSE
  671. goto removeadapter
  672. endif
  673. goto end
  674. end = +
  675. freeLibrary $(!TCPCFG_HANDLE)
  676. goto term
  677. term = +
  678. Return $(CommonStatus)
  679. ;***************************************************************
  680. ; Get File Size SECTIONS
  681. ;***************************************************************
  682. [GetFilesSize]
  683. set FileSizeList = ^(Files-FTPD,3)
  684. set TotalSize = 0
  685. ForListDo $(FileSizeList)
  686. Split-String $($) "=" SplitString
  687. set Size = *($(SplitString),3)
  688. set-add TotalSize = $(TotalSize) $(Size)
  689. EndForListDo
  690. set-div SizeInK = $(TotalSize) 1024
  691. return $(SizeInK)
  692. ;***************************************************************
  693. ; INSTALL SECTIONS
  694. ;***************************************************************
  695. [Install-Option]
  696. set STF_VITAL = ""
  697. ifstr(i) $(AddCopy) == "YES"
  698. ;
  699. ; Add the files to the copy list
  700. ;
  701. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
  702. endif
  703. ifstr(i) $(DoCopy) == "YES"
  704. ;
  705. ; Copy files in the copy list
  706. ;
  707. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  708. CopyFilesInCopyList
  709. endif
  710. ifstr(i) $(DoConfig) == "YES"
  711. ;
  712. ; Add product to registry
  713. ;
  714. ;
  715. ; Finish up
  716. endif
  717. Exit
  718. [Install-Update]
  719. set STF_VITAL = ""
  720. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  721. ;set STF_VERSION = "YES"
  722. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
  723. exit
  724.