home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 April / VPR0004A.BIN / W2KDRVS / BROTHER / PT9200PC / MONITOR.INF < prev    next >
INI File  |  1998-08-07  |  15KB  |  509 lines

  1. ;-----------------------------------------------------------------------
  2. ; OPTION TYPE
  3. ; -----------
  4. ; This identifies the Option type we are dealing with.  The different
  5. ; possible types are:
  6. ;
  7. ; COMPUTER, VIDEO, POINTER, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  8. ;-----------------------------------------------------------------------
  9.  
  10. [Identification]
  11.     OptionType = MONITOR
  12.  
  13. ;-----------------------------------------------------------------------
  14. ; LANGUAGES SUPPORTED
  15. ; -------------------
  16. ;
  17. ; The languages supported by the OEM INF, For every language supported
  18. ; we need to have a separate text section for every displayable text
  19. ; section.
  20. ;
  21. ;-----------------------------------------------------------------------
  22.  
  23. [LanguagesSupported]
  24.     JPN
  25.     ENG
  26.  
  27. ;-----------------------------------------------------------------------
  28. ; OPTION LIST
  29. ; -----------
  30. ; This section lists the OEM Option key names.  These keys are locale
  31. ; independent and used to represent the option in a locale independent
  32. ; manner.
  33. ;
  34. ;-----------------------------------------------------------------------
  35.  
  36. [Options]
  37.     "Brother P-touch Serial Port" = PTPROP
  38.  
  39.  
  40. ;-----------------------------------------------------------------------
  41. ; OPTION TEXT SECTION
  42. ; -------------------
  43. ; These are text strings used to identify the option to the user.  There
  44. ; are separate sections for each language supported.  The format of the
  45. ; section name is "OptionsText" concatenated with the Language represented
  46. ; by the section.
  47. ;
  48. ;-----------------------------------------------------------------------
  49.  
  50. [OptionsTextENG]
  51.     "Brother P-touch Serial Port" = "Brother P-touch Serial Port"
  52.  
  53.  
  54. [StringsENG]
  55.     String1 = "The monitor files for the selected monitor "
  56.     String2 = " couldn't be copied.  Failed to install the monitor."
  57.     String3 = "The monitor "
  58.     String4 = " is already installed."
  59.     String5 = "Access is denied. You must be logged on as a member of the Administrators "+
  60.               "group to carry out this operation."
  61.     String6 = " could not be installed."
  62.     String7 = "Failed to connect to the print server."
  63.  
  64. [StringsJPN]
  65.     String1 = "選択されたモニタ ファイル"
  66.     String2 = " をコピーできませんでした。このモニタのインストールに失敗しました。"
  67.     String3 = "モニタ "
  68.     String4 = " は既にインストールされています。"
  69.     String5 = "アクセスが拒否されました。この操作を行うには、管理者グループの"+
  70.               "メンバーとしてログオンしなければなりません。"
  71.     String6 = " をインストールできませんでした。"
  72.     String7 = "プリント サーバーへの接続に失敗しました。"
  73.  
  74.  
  75. ;---------------------------------------------------------------------------
  76. ; 1. Identify
  77. ;
  78. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  79. ;                as we are choosing currently.
  80. ;
  81. ; INPUT:         None
  82. ;
  83. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  84. ;                $($R1): Option Type (COMPUTER ...)
  85. ;                $($R2): Diskette description
  86. ;---------------------------------------------------------------------------
  87.  
  88. [Identify]
  89.     ;
  90.     ;
  91.     read-syms Identification
  92.  
  93.     set Status     = STATUS_SUCCESSFUL
  94.     set Identifier = $(OptionType)
  95.     set Media      = #("Source Media Descriptions", 1, 1)
  96.  
  97.     Return $(Status) $(Identifier) $(Media)
  98.  
  99.  
  100.  
  101. ;------------------------------------------------------------------------
  102. ; 2. ReturnOptions:
  103. ;
  104. ; DESCRIPTION:   To return the option list supported by this INF and the
  105. ;                localised text list representing the options.
  106. ;
  107. ;
  108. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  109. ;
  110. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  111. ;                                STATUS_NOLANGUAGE
  112. ;                                STATUS_FAILED
  113. ;
  114. ;                $($R1): Option List
  115. ;                $($R2): Option Text List
  116. ;------------------------------------------------------------------------
  117.  
  118. [ReturnOptions]
  119.     ;
  120.     ;
  121.     set Status        = STATUS_FAILED
  122.     set OptionList     = {}
  123.     set OptionTextList = {}
  124.  
  125.     ;
  126.     ; Check if the language requested is supported
  127.     ;
  128.     set LanguageList = ^(LanguagesSupported, 1)
  129.     Ifcontains(i) $($0) in $(LanguageList)
  130.         goto returnoptions
  131.     else
  132.         set Status = STATUS_NOLANGUAGE
  133.         goto finish_ReturnOptions
  134.     endif
  135.  
  136.     ;
  137.     ; form a list of all the options and another of the text representing
  138.     ;
  139.  
  140. returnoptions = +
  141.     set OptionList     = ^(Options, 0)
  142.     set OptionTextList = ^(OptionsText$($0), 1)
  143.     set Status         = STATUS_SUCCESSFUL
  144.  
  145. finish_ReturnOptions = +
  146.     Return $(Status) $(OptionList) $(OptionTextList)
  147.  
  148.  
  149.  
  150. ;***************************************
  151. ; INTERNAL INSTALL ENTRY POINT FROM INF
  152. ;***************************************
  153. ;
  154. ; 3. InstallOption:
  155. ;
  156. ; FUNCTION:  To copy files representing OEM Options
  157. ;            To configure the installed option
  158. ;            To update the registry for the installed option
  159. ;
  160. ; INPUT:     $($0):  Language to use
  161. ;            $($1):  OptionID to install
  162. ;            $($2):  SourceDirectory
  163. ;            $($4):  AddCopy  (YES | NO)
  164. ;            $($5):  DoCopy   (YES | NO)
  165. ;            $($6):  DoConfig (YES | NO)
  166. ;
  167. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  168. ;                            STATUS_NOLANGUAGE |
  169. ;                            STATUS_USERCANCEL |
  170. ;                            STATUS_FAILED
  171. ;
  172.  
  173. [InstallOption]
  174.  
  175.     ;
  176.     ; Set default values for
  177.     ;
  178.     set Status   = STATUS_FAILED
  179.  
  180.     ;
  181.     ; extract parameters
  182.     ;
  183.     set Option   = $($1)
  184.     set SrcDir   = $($2)
  185.     set AddCopy  = $($3)
  186.     set DoCopy   = $($4)
  187.     set DoConfig = $($5)
  188.  
  189.     ;
  190.     ; Check if the language requested is supported
  191.     ;
  192.     set LanguageList = ^(LanguagesSupported, 1)
  193.     Ifcontains(i) $($0) in $(LanguageList)
  194.     else
  195.         set Status = STATUS_NOLANGUAGE
  196.         goto finish_InstallOption
  197.     endif
  198.     read-syms Strings$($0)
  199.     read-syms UiVars
  200.     detect    UiVars
  201.  
  202.     ;
  203.     ; check to see if Option is supported.
  204.     ;
  205.  
  206.     set OptionList = ^(Options, 0)
  207.     ifcontains $(Option) in $(OptionList)
  208.     else
  209.         goto finish_InstallOption
  210.     endif
  211.     set OptionList = ""
  212.  
  213.  
  214.     set OptionFile = #(Options, $(Option), 1)
  215.  
  216. installtheoption = +
  217.     ;
  218.     ; Code to add files to copy list
  219.     ;
  220.  
  221.     ifstr(i) $(AddCopy) == "YES"
  222.         install Install-AddCopyOption
  223.         ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  224.             Debug-Output "Adding port monitor files to copy list failed"
  225.             goto finish_InstallOption
  226.         endif
  227.     endif
  228.  
  229.     ifstr(i) $(DoCopy) == "YES"
  230.         read-syms ProgressCopy$($0)
  231.         install Install-DoCopyOption
  232.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  233.             Debug-Output "Copying files failed"
  234.             goto finish_InstallOption
  235.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  236.             set Status = STATUS_USERCANCEL
  237.             goto finish_InstallOption
  238.         endif
  239.     endif
  240.  
  241.     ifstr(i) $(DoConfig) == "YES"
  242.         set MonitorPath = $(STF_WINDOWSSYSPATH)"\"#(Files-Layout, $(OptionFile), 2)
  243.         set OptionText = #(OptionsText$($0), $(Option), 1)
  244.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(MonitorPath)
  245.         ifstr(i) $(STATUS) == "NO"
  246.             shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String1)$(OptionText)$(String2)
  247.             Debug-Output "Copying port monitor files failed"
  248.             goto finish_InstallOption
  249.         endif
  250.  
  251.         install Install-Configure
  252.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  253.             Debug-Output "Installing port monitor failed"
  254.             goto finish_InstallOption
  255.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  256.             set Status = STATUS_USERCANCEL
  257.             goto finish_InstallOption
  258.         endif
  259.  
  260.         ifstr(i) $(STATUS) != "ADDED"
  261.             ifstr(i) $(STATUS) == "PRESENT"
  262.                 shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String3)$(OptionText)$(String4)
  263.                 set Status = STATUS_SUCCESSFUL
  264.             else-ifstr(i) $(STATUS) == "DENIED"
  265.                 shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String5)
  266.                 goto finish_InstallOption
  267.             else
  268.                 LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(MonitorPath)
  269.                 ifstr(i) $(STATUS) != "YES"
  270.                     shell "subroutn.inf" SetupMessage $($0) "NONFATAL" $(String3)$(OptionText)$(String6)
  271.                     goto finish_InstallOption
  272.                 endif
  273.             endif
  274.         endif
  275.     endif
  276.  
  277.     set Status = STATUS_SUCCESSFUL
  278.  
  279. finish_InstallOption = +
  280.     Return $(Status)
  281.  
  282.  
  283.  
  284. [Install-AddCopyOption]
  285.  
  286.     set STF_VITAL = ""
  287.     set STF_OVERWRITE   = "VERIFYSOURCEOLDER"
  288.     ;
  289.     ; Add the files to the copy list
  290.     ;
  291.     AddSectionKeyFileToCopyList   Files-Layout               +
  292.                                   $(OptionFile)              +
  293.                                   $(SrcDir)                  +
  294.                                   $(!STF_MONITORPATH)
  295.  
  296.     AddSectionFilesToCopyList     Files-$(OptionFile)        +
  297.                                   $(SrcDir)                  +
  298.                                   $(!STF_MONITORPATH)
  299.  
  300.     exit
  301.  
  302.  
  303. [Install-DoCopyOption]
  304.  
  305.     ;
  306.     ; Copy files in the copy list
  307.     ;
  308.     CopyFilesInCopyList
  309.     exit
  310.  
  311. [Install-Configure]
  312.     set Model       = $(Option)
  313.     set Monitor      = #(Files-Layout, $(OptionFile), 2)
  314.     LibraryProcedure STATUS,$(!LIBHANDLE), SetupAddPrinterMonitor   +
  315.                                                $(Model)            +
  316.                                                $(!STF_PRNENVIRONM) +
  317.                                                $(Monitor)           +
  318.                                                $(!STF_PRINTSERVER)
  319.  
  320.     exit
  321.  
  322. ;**************************************************************************
  323. ; PROGRESS GUAGE VARIABLES
  324. ;**************************************************************************
  325.  
  326. [ProgressCopyENG]
  327.     ProCaption   = "Windows NT Setup"
  328.     ProCancel    = "Cancel"
  329.     ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
  330.                    "to cancel copying files?"
  331.     ProCancelCap = "Setup Message"
  332.     ProText1     = "Copying:"
  333.     ProText2     = "To:"
  334.  
  335. [ProgressCopyJPN]
  336.     ProCaption   = "Windows NT セットアップ"
  337.     ProCancel    = "キャンセル"
  338.     ProCancelMsg = "Windows NT は正しくインストールされていません。"+
  339.                    "ファイルのコピーを中止しますか?"
  340.     ProCancelCap = "セットアップ メッセージ"
  341.     ProText1     = "コピー元:"
  342.     ProText2     = "コピー先:"
  343.  
  344.  
  345. ;***************************************************************
  346. ; EXTERNAL INSTALL ENTRY POINT FROM CONTROL PANEL
  347. ;***************************************************************
  348.  
  349. ;
  350.  
  351. ;
  352. ; 4. ExternalInstallOption:
  353. ;
  354. ; FUNCTION:  To copy files representing OEM Options
  355. ;            To configure the installed option
  356. ;            To update the registry for the installed option
  357. ;
  358. ; INPUT:     /t STF_LANGUAGE = Language to use   (ENG)
  359. ;            /t OPTION       = Option to install (eg. 0010209)
  360. ;            /t ADDCOPY      = YES | NO
  361. ;            /t DOCOPY       = YES | NO
  362. ;            /t DOCONFIG     = YES | NO
  363. ;
  364. ; OUTPUT:    Exit code from process = 0 if okay
  365. ;            Anything else --> Error
  366. ;
  367.  
  368.  
  369. [ExternalInstallOption]
  370.     ;
  371.     ; set this to a non-zero value if you want to see debug-output statements
  372.     ; under ntsd
  373.     ;
  374.     Set !G:DebugOutputControl = 0
  375.     ;
  376.     ; Set up global variables needed by install option
  377.     ;
  378.     set Exit_Code = $(!SETUP_ERROR_GENERAL)
  379.     set DrivesToFree = {}
  380.     install LoadSetupLibrary
  381.  
  382.     ; check externally passed parameters
  383.  
  384.     ifstr(i)      $(STF_LANGUAGE)  == ""
  385.         goto end
  386.     else-ifstr(i) $(OPTION)        == ""
  387.         goto end
  388.     else-ifstr(i) $(ADDCOPY)       == ""
  389.         goto end
  390.     else-ifstr(i) $(DOCOPY)        == ""
  391.         goto end
  392.     else-ifstr(i) $(DOCONFIG)      == ""
  393.         goto end
  394.     endif
  395.  
  396.  
  397.     read-syms PlatformID
  398.     read-syms ProductType
  399.     set STF_PRNPLATFORM = "w32x86"
  400.     set STF_PRNENVIRONM = "Windows NT x86"
  401.  
  402.  
  403.     read-syms UiVars
  404.     detect    UiVars
  405.     read-syms Strings$(STF_LANGUAGE)
  406.     ifstr(i) $(STF_SRCDIR) != $(STF_CWDDIR)
  407.         goto skip_asksource
  408.     endif
  409.  
  410.     set STF_SRCDIR = A:\
  411.     shell "registry.inf" GetNTSource
  412.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  413.     else-ifstr(i) $($R0) != STATUS_SUCCESSFUL
  414.     else
  415.         set STF_SRCDIR = $($R1)
  416.     endif
  417.  
  418.     ;
  419.     ; ask for the setup sources
  420.     ;
  421.     shell "subroutn.inf" DoAskSource $(STF_SRCDIR)
  422.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  423.         Debug-Output "shelling DoAskSource failed"
  424.         goto end
  425.     endif
  426.     ifstr(i) $($R0) == STATUS_SUCCESSFUL
  427.         set STF_SRCDIR = $($R1)
  428.         ifstr(i) $($R2) != ""
  429.             set DrivesToFree = >($(DrivesToFree), $($R2))
  430.         endif
  431.     else
  432.         goto end
  433.     endif
  434.  
  435. skip_asksource = +
  436.     ;
  437.     LibraryProcedure IsFullPath, $(!LIBHANDLE), CheckPathFullPathSpec $(STF_MONITORPATH)
  438.     ifstr(i) $(IsFullPath) == "NO"
  439.         LibraryProcedure STATUS, $(!LIBHANDLE), ProcessForUNC $(STF_MONITORPATH)
  440.         ifstr(i) $(STATUS) == "ERROR"
  441.             shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String7)
  442.             goto end
  443.         else-ifstr(i) $(STATUS) == "NOT-UNC"
  444.             shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String7)
  445.             goto end
  446.         else-ifstr(i) $(STATUS) == "UNC-FAILCONNECT"
  447.             shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String7)
  448.             goto end
  449.         else
  450.             set STF_MONITORPATH = $(STATUS)
  451.         endif
  452.     endif
  453.  
  454.     shell "" InstallOption $(STF_LANGUAGE) $(OPTION) $(STF_SRCDIR) $(ADDCOPY) $(DOCOPY) $(DOCONFIG)
  455.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  456.         Debug-Output "Execing Configuring hardware options failed"
  457.         goto end
  458.     endif
  459.     ifstr(i) $($R0) == STATUS_SUCCESSFUL
  460.         set Exit_Code = $(!SETUP_ERROR_SUCCESS)
  461.     else-ifstr(i) $($R0) == STATUS_USERCANCEL
  462.         set Exit_Code = $(!SETUP_ERROR_USERCANCEL)
  463.     endif
  464.  
  465. end =+
  466.     ForListDo $(DrivesToFree)
  467.         LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  468.     EndForListDo
  469.  
  470.     install   FreeSetupLibrary
  471.     exit
  472.  
  473. [LoadSetupLibrary]
  474.     LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  475.     exit
  476.  
  477. [FreeSetupLibrary]
  478.     FreeLibrary $(!LIBHANDLE)
  479.     exit
  480.  
  481. [PlatformID]
  482.     PlatformID_I386 = I386
  483.  
  484. [UiVars]
  485.     STF_CONTROLSET     = CurrentControlSet
  486.     STF_WINDOWSPATH    = "" ? $(!LIBHANDLE) GetWindowsNtDir
  487.     STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  488.     STF_MONITORPATH    = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  489.  
  490. [Source Media Descriptions]
  491.     1 = "Brother P-TOUCH PC Driver Disk", TAGFILE = Data.tag
  492.  
  493. [Signature]
  494.     FileType = MICROSOFT_FILE
  495.  
  496. [GetSignature]
  497.     read-syms Signature
  498.     return $(FileType)
  499.  
  500. [ProductType]
  501.     STF_PRODUCT  = Winnt
  502.     STF_PLATFORM = I386
  503.  
  504. [Files-Layout]
  505.     PTPROP =1,PTPROP.DLL , SIZE=999
  506.  
  507. [Files-PTPROP]
  508.     PTPROPR =1,PTPROPR.DLL , SIZE=999
  509.