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.

293 lines
11 KiB

  1. [Identification]
  2. OptionType = PRINTER
  3. [Options]
  4. " Windows 3.1 Compatible Fax Driver" = wowfaxui, wowfax, wowfax
  5. [Identify]
  6. read-syms Identification
  7. set Status = STATUS_SUCCESSFUL
  8. set Identifier = $(OptionType)
  9. set Media = #("Source Media Descriptions", 1, 1)
  10. Return $(Status) $(Identifier) $(Media)
  11. [ReturnOptions]
  12. set Status = STATUS_FAILED
  13. set OptionList = {}
  14. set OptionTextList = {}
  15. set LanguageList = ^(LanguagesSupported, 1)
  16. Ifcontains(i) $($0) in $(LanguageList)
  17. goto returnoptions
  18. else
  19. set Status = STATUS_NOLANGUAGE
  20. goto finish_ReturnOptions
  21. endif
  22. returnoptions = +
  23. set OptionList = ^(Options, 0)
  24. set OptionTextList = ^(OptionsText$($0), 1)
  25. set Status = STATUS_SUCCESSFUL
  26. finish_ReturnOptions = +
  27. Return $(Status) $(OptionList) $(OptionTextList)
  28. [InstallOption]
  29. set Status = STATUS_FAILED
  30. set Option = $($1)
  31. set SrcDir = $($2)
  32. set AddCopy = $($3)
  33. set DoCopy = $($4)
  34. set DoConfig = $($5)
  35. set LanguageList = ^(LanguagesSupported, 1)
  36. Ifcontains(i) $($0) in $(LanguageList)
  37. else
  38. set Status = STATUS_NOLANGUAGE
  39. goto finish_InstallOption
  40. endif
  41. read-syms Strings$($0)
  42. set OptionList = ^(Options, 0)
  43. ifcontains $(Option) in $(OptionList)
  44. else
  45. goto finish_InstallOption
  46. endif
  47. set OptionList = ""
  48. set ConfigOption = #(Options, $(Option), 1)
  49. set DataOption = #(Options, $(Option), 2)
  50. set DriverOption = #(Options, $(Option), 3)
  51. installtheoption = +
  52. ifstr(i) $(AddCopy) == "YES"
  53. install Install-AddCopyOption
  54. ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  55. Debug-Output "Adding video files to copy list failed"
  56. goto finish_InstallOption
  57. endif
  58. endif
  59. ifstr(i) $(DoCopy) == "YES"
  60. read-syms ProgressCopy$($0)
  61. install Install-DoCopyOption
  62. ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  63. Debug-Output "Copying files failed"
  64. goto finish_InstallOption
  65. else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  66. set Status = STATUS_USERCANCEL
  67. goto finish_InstallOption
  68. endif
  69. endif
  70. ifstr(i) $(DoConfig) == "YES"
  71. set DriverPath = $(!STF_PRNDRIVERPATH)"\"#(Files-PrinterDriver, $(DriverOption), 2)
  72. set DataFilePath = $(!STF_PRNDRIVERPATH)"\"#(Files-PrinterData, $(DataOption), 2)
  73. set ConfigFilePath = $(!STF_PRNDRIVERPATH)"\"#(Files-PrinterConfig, $(ConfigOption), 2)
  74. LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(DriverPath)
  75. ifstr(i) $(STATUS) == YES
  76. LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(DataFilePath)
  77. ifstr(i) $(STATUS) == YES
  78. LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(ConfigFilePath)
  79. endif
  80. endif
  81. ifstr(i) $(STATUS) == NO
  82. set OptionText = #(OptionsText$($0), $(Option), 1)
  83. shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String4)$(OptionText)$(String5)
  84. Debug-Output "Copying printer files failed"
  85. goto finish_InstallOption
  86. endif
  87. install Install-Configure
  88. ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  89. Debug-Output "Installing printer driver failed"
  90. goto finish_InstallOption
  91. else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  92. set Status = STATUS_USERCANCEL
  93. goto finish_InstallOption
  94. endif
  95. ifstr(i) $(STATUS) != "ADDED"
  96. set OptionText = #(OptionsText$($0), $(Option), 1)
  97. ifstr(i) $(STATUS) == "PRESENT"
  98. shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String1)$(OptionText)$(String2)
  99. set Status = STATUS_SUCCESSFUL
  100. else-ifstr(i) $(STATUS) == "DENIED"
  101. shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String6)
  102. else
  103. shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String1)$(OptionText)$(String7)
  104. endif
  105. goto finish_InstallOption
  106. endif
  107. endif
  108. set Status = STATUS_SUCCESSFUL
  109. finish_InstallOption = +
  110. Return $(Status)
  111. [Install-AddCopyOption]
  112. set STF_VITAL = ""
  113. set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  114. AddSectionKeyFileToCopyList Files-PrinterConfig +
  115. $(ConfigOption) +
  116. $(SrcDir) +
  117. $(!STF_PRNDRIVERPATH)
  118. AddSectionKeyFileToCopyList Files-PrinterData +
  119. $(DataOption) +
  120. $(SrcDir) +
  121. $(!STF_PRNDRIVERPATH)
  122. AddSectionKeyFileToCopyList Files-PrinterDriver +
  123. $(DriverOption) +
  124. $(SrcDir) +
  125. $(!STF_PRNDRIVERPATH)
  126. AddSectionKeyFileToCopyList Files-PrinterDriverHelp +
  127. $(DriverOption) +
  128. $(SrcDir) +
  129. $(!STF_PRNDRIVERPATH)
  130. exit
  131. [Install-DoCopyOption]
  132. CopyFilesInCopyList
  133. exit
  134. [Install-Configure]
  135. set Model = $(Option)
  136. set Driver = #(Files-PrinterDriver, $(DriverOption), 2)
  137. set DataFile = #(Files-PrinterData, $(DataOption), 2)
  138. set ConfigFile = #(Files-PrinterConfig, $(ConfigOption), 2)
  139. LibraryProcedure STATUS,$(!LIBHANDLE), SetupAddPrinterDriver +
  140. $(Model) +
  141. $(!STF_PRNENVIRONM) +
  142. $(Driver) +
  143. $(DataFile) +
  144. $(ConfigFile) +
  145. $(!STF_PRINTSERVER)
  146. exit
  147. [ExternalInstallOption]
  148. Set !G:DebugOutputControl = 0
  149. set Exit_Code = $(!SETUP_ERROR_GENERAL)
  150. set DrivesToFree = {}
  151. install LoadSetupLibrary
  152. ifstr(i) $(STF_LANGUAGE) == ""
  153. goto end
  154. else-ifstr(i) $(OPTION) == ""
  155. goto end
  156. else-ifstr(i) $(ADDCOPY) == ""
  157. goto end
  158. else-ifstr(i) $(DOCOPY) == ""
  159. goto end
  160. else-ifstr(i) $(DOCONFIG) == ""
  161. goto end
  162. endif
  163. read-syms PlatformID
  164. read-syms ProductType
  165. ifstr(i) $(STF_PLATFORM) == $(PlatformID_I386)
  166. set STF_PRNPLATFORM = "w32x86"
  167. set STF_PRNENVIRONM = "Windows NT x86"
  168. else-ifstr(i) $(STF_PLATFORM) == $(PlatformID_Mips)
  169. set STF_PRNPLATFORM = "w32mips"
  170. set STF_PRNENVIRONM = "Windows NT R4000"
  171. else-ifstr(i) $(STF_PLATFORM) == $(PlatformID_PPC)
  172. set STF_PRNPLATFORM = "w32ppc"
  173. set STF_PRNENVIRONM = "Windows NT PowerPC"
  174. else-ifstr(i) $(STF_PLATFORM) == $(PlatformID_Alpha)
  175. set STF_PRNPLATFORM = "w32alpha"
  176. set STF_PRNENVIRONM = "Windows NT Alpha_AXP"
  177. else
  178. goto end
  179. endif
  180. read-syms UiVars
  181. detect UiVars
  182. read-syms Strings$(STF_LANGUAGE)
  183. ifstr(i) $(STF_SRCDIR) != $(STF_CWDDIR)
  184. goto skip_asksource
  185. endif
  186. set STF_SRCDIR = A:\
  187. shell "registry.inf" GetNTSource
  188. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  189. else-ifstr(i) $($R0) != STATUS_SUCCESSFUL
  190. else
  191. set STF_SRCDIR = $($R1)
  192. endif
  193. shell "subroutn.inf" DoAskSource $(STF_SRCDIR)
  194. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  195. Debug-Output "shelling DoAskSource failed"
  196. goto end
  197. endif
  198. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  199. set STF_SRCDIR = $($R1)
  200. ifstr(i) $($R2) != ""
  201. set DrivesToFree = >($(DrivesToFree), $($R2))
  202. endif
  203. else
  204. goto end
  205. endif
  206. skip_asksource = +
  207. LibraryProcedure IsFullPath, $(!LIBHANDLE), CheckPathFullPathSpec $(STF_PRNDRIVERPATH)
  208. ifstr(i) $(IsFullPath) == "NO"
  209. LibraryProcedure STATUS, $(!LIBHANDLE), ProcessForUNC $(STF_PRNDRIVERPATH)
  210. ifstr(i) $(STATUS) == "ERROR"
  211. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
  212. goto end
  213. else-ifstr(i) $(STATUS) == "NOT-UNC"
  214. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
  215. goto end
  216. else-ifstr(i) $(STATUS) == "UNC-FAILCONNECT"
  217. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
  218. goto end
  219. else
  220. set STF_PRNDRIVERPATH = $(STATUS)
  221. endif
  222. endif
  223. shell "" InstallOption $(STF_LANGUAGE) $(OPTION) $(STF_SRCDIR) $(ADDCOPY) $(DOCOPY) $(DOCONFIG)
  224. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  225. Debug-Output "Execing InstallOption failed"
  226. goto end
  227. endif
  228. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  229. set Exit_Code = $(!SETUP_ERROR_SUCCESS)
  230. else-ifstr(i) $($R0) == STATUS_USERCANCEL
  231. set Exit_Code = $(!SETUP_ERROR_USERCANCEL)
  232. endif
  233. end =+
  234. ForListDo $(DrivesToFree)
  235. LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  236. EndForListDo
  237. install FreeSetupLibrary
  238. exit
  239. [LoadSetupLibrary]
  240. LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  241. exit
  242. [FreeSetupLibrary]
  243. FreeLibrary $(!LIBHANDLE)
  244. exit
  245. [PlatformID]
  246. PlatformID_I386 = I386
  247. PlatformID_Mips = Mips
  248. PlatformID_Alpha = Alpha
  249. PlatformID_PPC = ppc
  250. [UiVars]
  251. STF_CONTROLSET = CurrentControlSet
  252. STF_WINDOWSPATH = "" ? $(!LIBHANDLE) GetWindowsNtDir
  253. STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  254. STF_PRNDRIVERPATH = "" ? $(!LIBHANDLE) GetPrinterDriverDir $(!STF_PRINTSERVER) $(!STF_PRNENVIRONM)
  255. [Source Media Descriptions]
  256. 1 = "Windows NT Workstation CD-ROM" , TAGFILE = cdrom.w
  257. [Signature]
  258. FileType = MICROSOFT_FILE
  259. [GetSignature]
  260. read-syms Signature
  261. return $(FileType)
  262. [ProductType]
  263. STF_PRODUCT = Winnt
  264. STF_PLATFORM = I386
  265. [Files-PrinterConfig]
  266. wowfaxui = 1,wowfaxui.DLL , SIZE=999
  267. [Files-PrinterData]
  268. wowfax = 1, wowfax.DLL, SIZE=999
  269. [Files-PrinterDriver]
  270. wowfax = 1,wowfax.DLL , SIZE=999
  271. [Files-PrinterDriverHelp]
  272. wowfax = 1,wowfax.hlp, SIZE=999
  273. [LanguagesSupported]
  274. ENG
  275. [OptionsTextENG]
  276. "Windows 3.1 Compatible Fax Driver" = "Windows 3.1 Compatible Fax Driver"
  277. [StringsENG]
  278. String1 = "The printer model "
  279. String2 = " is already installed."
  280. String3 = "Failed to connect to the print server."
  281. String4 = "The driver files for the printer model "
  282. String5 = " couldn't be copied. Failed to install the printer model."
  283. String6 = "Access is denied. You must be logged on as a member of the Administrators "+
  284. "group to carry out this operation."
  285. String7 = " could not be installed."
  286. [ProgressCopyENG]
  287. ProCaption = "Windows NT Setup"
  288. ProCancel = "Cancel"
  289. ProCancelMsg = "Windows NT is not correctly installed. Are you sure you want "+
  290. "to cancel copying files?"
  291. ProCancelCap = "Setup Message"
  292. ProText1 = "Copying:"
  293. ProText2 = "To:"