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.

778 lines
23 KiB

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