home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / utils / tcfax / printer.inf < prev    next >
INI File  |  1995-05-18  |  12KB  |  379 lines

  1. [Identification]
  2.     OptionType = PRINTER
  3.  
  4. [LanguagesSupported]
  5.     ENG
  6.  
  7. [Options]
  8.     "Telcom FAX Print-to-FAX"    = ptfui, ptfdata, ptf
  9.  
  10. [OptionsTextENG]
  11.     "Telcom FAX Print-to-FAX"    = "Telcom FAX Print-to-FAX"
  12.  
  13. [StringsENG]
  14.     String1 = "The printer model '"
  15.     String2 = "' is already installed."
  16.     String3 = "Failed to connect to the print server."
  17.     String4 = "The driver files for the printer model "
  18.     String5 = " couldn't be copied.  Failed to install the printer model."
  19.     String6 = "Access is denied. You must be logged on as a member of the Administrators "+
  20.               "group to carry out this operation."
  21.     String7 = " could not be installed."
  22.  
  23.  
  24.  
  25.  
  26. [Identify]
  27.     Set !G:DebugOutputControl = 1
  28.     Debug-Output "Identify - called"
  29.  
  30.     read-syms Identification
  31.     set Status     = STATUS_SUCCESSFUL
  32.     set Identifier = $(OptionType)
  33.     set Media      = #("Source Media Descriptions", 1, 1)
  34.     Return $(Status) $(Identifier) $(Media)
  35.  
  36.  
  37.  
  38.  
  39. [ReturnOptions]
  40.     Set !G:DebugOutputControl = 1
  41.     Debug-Output "ReturnOptions - called"
  42.  
  43.     set Status        = STATUS_FAILED
  44.     set OptionList     = {}
  45.     set OptionTextList = {}
  46.     set LanguageList = ^(LanguagesSupported, 1)
  47.     Ifcontains(i) $($0) in $(LanguageList)
  48.     else
  49.         set Status = STATUS_NOLANGUAGE
  50.         goto finish_ReturnOptions
  51.     endif
  52.  
  53.     set OptionList     = ^(Options, 0)
  54.     set OptionTextList = ^(OptionsText$($0), 1)
  55.     set Status         = STATUS_SUCCESSFUL
  56.  
  57. finish_ReturnOptions = +
  58.     Return $(Status) $(OptionList) $(OptionTextList)
  59.  
  60.  
  61.  
  62.  
  63. [InstallOption]
  64.     Set !G:DebugOutputControl = 1
  65.     Debug-Output "InstallOption - called"
  66.  
  67.     set Status   = STATUS_FAILED
  68.     set Option   = $($1)
  69.     set SrcDir   = $($2)
  70.     set AddCopy  = $($3)
  71.     set DoCopy   = $($4)
  72.     set DoConfig = $($5)
  73.     set LanguageList = ^(LanguagesSupported, 1)
  74.     Ifcontains(i) $($0) in $(LanguageList)
  75.     else
  76.         set Status = STATUS_NOLANGUAGE
  77.         goto finish_InstallOption
  78.     endif
  79.  
  80.     read-syms Strings$($0)
  81.     set OptionList = ^(Options, 0)
  82.     ifcontains $(Option) in $(OptionList)
  83.     else
  84.         goto finish_InstallOption
  85.     endif
  86.  
  87.     set OptionList = ""
  88.     set ConfigOption = #(Options, $(Option), 1)
  89.     set DataOption   = #(Options, $(Option), 2)
  90.     set DriverOption = #(Options, $(Option), 3)
  91.  
  92.  
  93. installtheoption = +
  94.     ifstr(i) $(AddCopy) == "YES"
  95.         install Install-AddCopyOption
  96.         ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  97.             Debug-Output "Adding printer files to copy list failed"
  98.             goto finish_InstallOption
  99.         endif
  100.     endif
  101.  
  102.  
  103.     ifstr(i) $(DoCopy) == "YES"
  104.         read-syms ProgressCopy$($0)
  105.         install Install-DoCopyOption
  106.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  107.             Debug-Output "Copying files failed"
  108.             goto finish_InstallOption
  109.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  110.             set Status = STATUS_USERCANCEL
  111.             goto finish_InstallOption
  112.         endif
  113.     endif
  114.  
  115.  
  116.     ifstr(i) $(DoConfig) == "YES"
  117.         Set !G:DebugOutputControl = 1
  118.         Debug-Output "InstallOption - setting up for Install-Configure"
  119.  
  120.         set DriverPath      = $(!STF_PRNDRIVERPATH)"\"#(Files-PrinterDriver, $(DriverOption), 2)
  121.         set DataFilePath    = $(!STF_PRNDRIVERPATH)"\"#(Files-PrinterData,   $(DataOption),   2)
  122.         set ConfigFilePath  = $(!STF_PRNDRIVERPATH)"\"#(Files-PrinterConfig, $(ConfigOption), 2)
  123.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(DriverPath)
  124.  
  125.         ifstr(i) $(STATUS) == YES
  126.             LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(DataFilePath)
  127.             ifstr(i) $(STATUS) == YES
  128.                 LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(ConfigFilePath)
  129.             endif
  130.         endif
  131.  
  132.         ifstr(i) $(STATUS) == NO
  133.             set OptionText = #(OptionsText$($0), $(Option), 1)
  134.             shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String4)$(OptionText)$(String5)
  135.             Debug-Output "Copying printer files failed"
  136.             goto finish_InstallOption
  137.         endif
  138.  
  139.         install Install-Configure
  140.  
  141.         Debug-Output "InstallOption - back from Install-Configure"
  142.  
  143.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  144.             Debug-Output "InstallOption - installing printer driver failed"
  145.             goto finish_InstallOption
  146.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  147.             set Status = STATUS_USERCANCEL
  148.             goto finish_InstallOption
  149.         endif
  150.  
  151.         ifstr(i) $(STATUS) != "ADDED"
  152.             Debug-Output "InstallOption - status is not ADDED"
  153.  
  154.             set OptionText = #(OptionsText$($0), $(Option), 1)
  155.  
  156.             ifstr(i) $(STATUS) == "PRESENT"
  157.                 shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String1)$(OptionText)$(String2)
  158.             else-ifstr(i) $(STATUS) == "DENIED"
  159.                 shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String6)
  160.             else
  161.                 shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String1)$(OptionText)$(String7)
  162.             endif
  163.             goto finish_InstallOption
  164.         endif
  165.     endif
  166.     set Status = STATUS_SUCCESSFUL
  167.  
  168.  
  169. finish_InstallOption = +
  170.     Return $(Status)
  171.  
  172.  
  173.  
  174.  
  175. [Install-AddCopyOption]
  176.     Set !G:DebugOutputControl = 1
  177.     Debug-Output "AddCopyOption - called"
  178.  
  179.     set STF_VITAL = ""
  180.     set STF_OVERWRITE   = "VERIFYSOURCEOLDER"
  181.     AddSectionKeyFileToCopyList   Files-PrinterConfig          +
  182.                                   $(ConfigOption)              +
  183.                                   $(SrcDir)                    +
  184.                                   $(!STF_PRNDRIVERPATH)
  185.     AddSectionKeyFileToCopyList   Files-PrinterData            +
  186.                                   $(DataOption)                +
  187.                                   $(SrcDir)                    +
  188.                                   $(!STF_PRNDRIVERPATH)
  189.     AddSectionKeyFileToCopyList   Files-PrinterDriver          +
  190.                                   $(DriverOption)              +
  191.                                   $(SrcDir)                    +
  192.                                   $(!STF_PRNDRIVERPATH)
  193.     exit
  194.  
  195.  
  196.  
  197. [Install-DoCopyOption]
  198.     Set !G:DebugOutputControl = 1
  199.     Debug-Output "CoCopyOption - called"
  200.  
  201.     CopyFilesInCopyList
  202.     exit
  203.  
  204.  
  205.  
  206. [Install-Configure]
  207.     Set !G:DebugOutputControl = 1
  208.     Debug-Output "InstallConfigure - called"
  209.  
  210.     set Model       = $(Option)
  211.     ifstr(i) $(!STF_PRNPLATFORM) == "w32x86"
  212.         set Environment = "Windows NT x86"
  213.     else-ifstr(i) $(!STF_PRNPLATFORM) == "w32mips"
  214.         set Environment = "Windows NT R4000"
  215.     else
  216.         set Environment = ""
  217.     endif
  218.     set Driver      = #(Files-PrinterDriver, $(DriverOption), 2)
  219.     set DataFile    = #(Files-PrinterData,   $(DataOption),   2)
  220.     set ConfigFile  = #(Files-PrinterConfig, $(ConfigOption), 2)
  221.     LibraryProcedure STATUS,$(!LIBHANDLE), SetupAddPrinterDriver  +
  222.                                                $(Model)           +
  223.                                                $(Environment)     +
  224.                                                $(Driver)          +
  225.                                                $(DataFile)        +
  226.                                                $(ConfigFile)      +
  227.                                                $(!STF_PRINTSERVER)
  228.     exit
  229.  
  230.  
  231.  
  232. [ProgressCopyENG]
  233.     ProCaption   = "Windows NT Setup"
  234.     ProCancel    = "Cancel"
  235.     ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
  236.                    "to cancel copying files?"
  237.     ProCancelCap = "Setup Message"
  238.     ProText1     = "Copying:"
  239.     ProText2     = "To:"
  240.  
  241.  
  242.  
  243. [ExternalInstallOption]
  244.   Set !G:DebugOutputControl = 1
  245.  
  246.   Debug-Output "ExternalInstallOption - called"
  247.  
  248.   set Exit_Code    = $(!SETUP_ERROR_GENERAL)
  249.   set DrivesToFree = {}
  250.  
  251.   install LoadSetupLibrary
  252.  
  253.   Debug-Output "ExternalInstallOption - checking global variables"
  254.   ifstr(i)      $(STF_LANGUAGE)  == ""
  255.     goto end
  256.   else-ifstr(i) $(OPTION)        == ""
  257.     goto end
  258.   else-ifstr(i) $(ADDCOPY)       == ""
  259.     goto end
  260.   else-ifstr(i) $(DOCOPY)        == ""
  261.     goto end
  262.   else-ifstr(i) $(DOCONFIG)      == ""
  263.     goto end
  264.   else-ifstr(i) $(!STF_SRCDIR)   == ""
  265.     goto end
  266.   endif
  267.  
  268.   Debug-Output "ExternalInstallOption - reading &detecting symbols"
  269.   read-syms UiVars
  270.   detect    UiVars
  271.   read-syms ProductType
  272.   read-syms Strings$(STF_LANGUAGE)
  273.  
  274.   ifstr(i) $(STF_PLATFORM) == $(PlatformID_I386)
  275.     set STF_PRNPLATFORM = "w32x86"
  276.   else-ifstr(i) $(STF_PLATFORM) == $(PlatformID_Mips)
  277.     set STF_PRNPLATFORM = "w32mips"
  278.   else
  279.     goto end
  280.   endif
  281.  
  282.  
  283.   ; set STF_PRNDRIVERPATH = $(!STF_SRCDIR)
  284.  
  285.   LibraryProcedure IsFullPath, $(!LIBHANDLE), CheckPathFullPathSpec $(STF_PRNDRIVERPATH)
  286.  
  287.   ifstr(i) $(IsFullPath) == "NO"
  288.     Debug-Output "ExternalInstallOption - IsFullPath == 'NO'"
  289.  
  290.     LibraryProcedure STATUS, $(!LIBHANDLE), ProcessForUNC $(STF_PRNDRIVERPATH)
  291.     ifstr(i) $(STATUS) == "ERROR"
  292.       shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
  293.       goto end
  294.     else-ifstr(i) $(STATUS) == "NOT-UNC"
  295.       shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
  296.       goto end
  297.     else-ifstr(i) $(STATUS) == "UNC-NOFREEDRIVE"
  298.       shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
  299.       goto end
  300.     else-ifstr(i) $(STATUS) == "UNC-FAILCONNECT"
  301.       shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String3)
  302.       goto end
  303.     else
  304.       set STF_PRNDRIVERPATH = $(STATUS)
  305.       GetDriveInPath Drive $(STF_PRNDRIVERPATH)
  306.       set DrivesToFree = >($(DrivesToFree), $(Drive))
  307.     endif
  308.   endif
  309.  
  310.   Debug-Output "ExternalInstallOption - shelling InstallOption"
  311.   shell "" InstallOption $(STF_LANGUAGE) $(OPTION) $(STF_SRCDIR) $(ADDCOPY) $(DOCOPY) $(DOCONFIG)
  312.  
  313.   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  314.     Debug-Output "Execing InstallOption failed"
  315.     goto end
  316.   endif
  317.  
  318.   ifstr(i) $($R0) == STATUS_SUCCESSFUL
  319.     set Exit_Code = $(!SETUP_ERROR_SUCCESS)
  320.   else-ifstr(i) $($R0) == STATUS_USERCANCEL
  321.     set Exit_Code = $(!SETUP_ERROR_USERCANCEL)
  322.   endif
  323.  
  324. end =+
  325.   ForListDo $(DrivesToFree)
  326.     LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  327.   EndForListDo
  328.  
  329.   install FreeSetupLibrary
  330.  
  331.   exit
  332.  
  333. ; end [ExternalInstallOption]
  334.  
  335.  
  336.  
  337.  
  338. [LoadSetupLibrary]
  339.     Set !G:DebugOutputControl = 1
  340.     Debug-Output "LoadSetupLibrary - called"
  341.  
  342.     LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  343.     exit
  344.  
  345.  
  346.  
  347. [FreeSetupLibrary]
  348.     Set !G:DebugOutputControl = 1
  349.     Debug-Output "FreeSetupLibrary - called"
  350.  
  351.     FreeLibrary $(!LIBHANDLE)
  352.     exit
  353.  
  354.  
  355.  
  356. [UiVars]
  357.     PlatformID_I386  = I386
  358.     PlatformID_Mips  = Mips
  359.     STF_CONTROLSET     = CurrentControlSet
  360.     STF_WINDOWSPATH    = "" ? $(!LIBHANDLE) GetWindowsNtDir
  361.     STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  362.     STF_PRNDRIVERPATH  = "" ? $(!LIBHANDLE) GetPrinterDriverDir $(!STF_PRINTSERVER)
  363.  
  364. [Source Media Descriptions]
  365.     1  = "Telcom installation disk #1", TAGFILE = disk1
  366.  
  367. [ProductType]
  368.     STF_PRODUCT  = Winnt
  369.     STF_PLATFORM = I386
  370.  
  371. [Files-PrinterConfig]
  372.     ptfui = 1, ptfui.dll, SIZE=999
  373.  
  374. [Files-PrinterData]
  375.     ptfdata = 1, ptf.dat, SIZE=999
  376.  
  377. [Files-PrinterDriver]
  378.     ptf = 1, ptf.dll, SIZE=999
  379.