home *** CD-ROM | disk | FTP | other *** search
/ BUG 11 / BUGCD1998_02.ISO / util / _zip / iomgnt15.exe / PARALLEL / OEMSETUP.INF next >
INI File  |  1997-02-27  |  19KB  |  588 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, TAPE, PRINTER, ...
  8. ;-----------------------------------------------------------------------
  9.  
  10. [Identification]
  11.     OptionType = SCSI
  12.  
  13. ;-----------------------------------------------------------------------
  14. ; LANGUAGES SUPPORTED
  15. ; -------------------
  16. ;
  17. ; The languages supported by the 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.     ENG
  25.  
  26.  
  27. ;-----------------------------------------------------------------------
  28. ; OPTION LIST
  29. ; -----------
  30. ; This section lists the 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.     "PPA3NT"          = ppa3nt
  38.  
  39. ;-----------------------------------------------------------------------
  40. ; OPTION TEXT SECTION
  41. ; -------------------
  42. ; These are text strings used to identify the option to the user.  There
  43. ; are separate sections for each language supported.  The format of the
  44. ; section name is "OptionsText" concatenated with the Language represented
  45. ; by the section.
  46. ;
  47. ;-----------------------------------------------------------------------
  48.  
  49. [OptionsTextENG]
  50.  
  51.     "PPA3NT"          = "Iomega ZIP Parallel Port/Jaz Traveller Driver"
  52.  
  53. ;-----------------------------------------------------------------------------------------
  54. ; SCSI MINIPORT DRIVERS:
  55. ;
  56. ; Order of the information:
  57. ;
  58. ; Class driver = Type, Group, ErrorControl, Tag, EventMessageFile, TypesSupported
  59. ;
  60. ;-----------------------------------------------------------------------------------------
  61.  
  62. [MiniportDrivers]
  63.     ppa3nt      = !SERVICE_KERNEL_DRIVER, "SCSI Miniport", !SERVICE_ERROR_NORMAL,  , %SystemRoot%\System32\IoLogMsg.dll , 7
  64.  
  65. ;---------------------------------------------------------------------------
  66. ; 1. Identify
  67. ;
  68. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  69. ;                as we are choosing currently.
  70. ;
  71. ; INPUT:         None
  72. ;
  73. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  74. ;                $($R1): Option Type (COMPUTER ...)
  75. ;                $($R2): Diskette description
  76. ;---------------------------------------------------------------------------
  77.  
  78. [Identify]
  79.     ;
  80.     ;
  81.     read-syms Identification
  82.  
  83.     set Status     = STATUS_SUCCESSFUL
  84.     set Identifier = $(OptionType)
  85.     set Media      = #("Source Media Descriptions", 1, 1)
  86.  
  87.     Return $(Status) $(Identifier) $(Media)
  88.  
  89.  
  90.  
  91. ;------------------------------------------------------------------------
  92. ; 2. ReturnOptions:
  93. ;
  94. ; DESCRIPTION:   To return the option list supported by this INF and the
  95. ;                localised text list representing the options.
  96. ;
  97. ;
  98. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  99. ;
  100. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  101. ;                                STATUS_NOLANGUAGE
  102. ;                                STATUS_FAILED
  103. ;
  104. ;                $($R1): Option List
  105. ;                $($R2): Option Text List
  106. ;------------------------------------------------------------------------
  107.  
  108. [ReturnOptions]
  109.     ;
  110.     ;
  111.     set Status        = STATUS_FAILED
  112.     set OptionList     = {}
  113.     set OptionTextList = {}
  114.  
  115.     ;
  116.     ; Check if the language requested is supported
  117.     ;
  118.     set LanguageList = ^(LanguagesSupported, 1)
  119.     Ifcontains(i) $($0) in $(LanguageList)
  120.         goto returnoptions
  121.     else
  122.         set Status = STATUS_NOLANGUAGE
  123.         goto finish_ReturnOptions
  124.     endif
  125.  
  126.     ;
  127.     ; form a list of all the options and another of the text representing
  128.     ;
  129.  
  130. returnoptions = +
  131.     set OptionList     = ^(Options, 0)
  132.     set OptionTextList = ^(OptionsText$($0), 1)
  133.     set Status         = STATUS_SUCCESSFUL
  134.  
  135. finish_ReturnOptions = +
  136.     Return $(Status) $(OptionList) $(OptionTextList)
  137.  
  138.  
  139. ;
  140. ; 3. InstallOption:
  141. ;
  142. ; FUNCTION:  To copy files representing Options
  143. ;            To configure the installed option
  144. ;            To update the registry for the installed option
  145. ;
  146. ; INPUT:     $($0):  Language to use
  147. ;            $($1):  OptionID to install
  148. ;            $($2):  SourceDirectory
  149. ;            $($3):  AddCopy  (YES | NO)
  150. ;            $($4):  DoCopy   (YES | NO)
  151. ;            $($5):  DoConfig (YES | NO)
  152. ;
  153. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  154. ;                            STATUS_NOLANGUAGE |
  155. ;                            STATUS_USERCANCEL |
  156. ;                            STATUS_FAILED
  157. ;
  158.  
  159. [InstallOption]
  160.  
  161.     ;
  162.     ; Set default values for
  163.     ;
  164.     set Status = STATUS_FAILED
  165.     set DrivesToFree = {}
  166.  
  167.     ;
  168.     ; extract parameters
  169.     ;
  170.     set Option   = $($1)
  171.     set SrcDir   = $($2)
  172.     ; Added by Iomega 9-9-96
  173.     set SrcDir   = "wntstuff\parallel"
  174.     set AddCopy  = $($3)
  175.     set DoCopy   = $($4)
  176.     set DoConfig = $($5)
  177.  
  178.     ;
  179.     ; Check if the language requested is supported
  180.     ;
  181.     set LanguageList = ^(LanguagesSupported, 1)
  182.     Ifcontains(i) $($0) in $(LanguageList)
  183.     else
  184.         set Status = STATUS_NOLANGUAGE
  185.         goto finish_InstallOption
  186.     endif
  187.     read-syms Strings$($0)
  188.  
  189.     ;
  190.     ; check to see if Option is supported.
  191.     ;
  192.  
  193.     set OptionList = ^(Options, 0)
  194.     ifcontains $(Option) in $(OptionList)
  195.     else
  196.         Debug-Output "OEMSETUP.INF: SCSI option is not supported."
  197.         goto finish_InstallOption
  198.     endif
  199.     set OptionList = ""
  200.  
  201.     ;
  202.     ; Option has been defined already
  203.     ;
  204.  
  205.     set MiniportDriver   =   #(Options,         $(Option),         1)
  206.     set Type             = $(#(MiniportDrivers, $(MiniportDriver), 1))
  207.     set Group            =   #(MiniportDrivers, $(MiniportDriver), 2)
  208.     set ErrorControl     = $(#(MiniportDrivers, $(MiniportDriver), 3))
  209.     set Tag              =   #(MiniportDrivers, $(MiniportDriver), 4)
  210.     set EventMessageFile =   #(MiniportDrivers, $(MiniportDriver), 5)
  211.     set TypesSupported   =   #(MiniportDrivers, $(MiniportDriver), 6)
  212.  
  213.     set Start            =   $(!SERVICE_BOOT_START)
  214.  
  215. installtheoption = +
  216.  
  217.     ;
  218.     ; Code to add files to copy list
  219.     ;
  220.  
  221.     ifstr(i) $(AddCopy) == "YES"
  222.         set DoActualCopy = NO
  223.         set FileToCheck = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  224.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
  225.         ifstr(i) $(STATUS) == NO
  226.             set DoActualCopy = YES
  227.         endif
  228.  
  229.         ifstr(i) $(DoActualCopy) == NO
  230.             shell "subroutn.inf" DriversExist $($0) $(String1)
  231.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  232.                 Debug-Output "OEMSETUP.INF: shelling DriversExist failed"
  233.                 goto finish_InstallOption
  234.             endif
  235.  
  236.             ifstr(i) $($R0) == STATUS_CURRENT
  237.             else-ifstr(i) $($R0) == STATUS_NEW
  238.                 set DoActualCopy = YES
  239.             else-ifstr(i) $($R0) == STATUS_USERCANCEL
  240.                 Debug-Output "OEMSETUP.INF: User cancelled SCSI installation"
  241.                 goto finish_InstallOption
  242.             else
  243.                 Debug-Output "OEMSETUP.INF: Error reported in DriversExist routine in SUBROUTN.INF"
  244.                 goto finish_InstallOption
  245.             endif
  246.         endif
  247.  
  248.         ifstr(i) $(DoActualCopy) == YES
  249.  
  250.             shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
  251.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  252.                 Debug-Output "OEMSETUP.INF: shelling DoAskSourceEx failed"
  253.                 goto finish_InstallOption
  254.             endif
  255.  
  256.             ifstr(i) $($R0) == STATUS_SUCCESSFUL
  257.                 set SrcDir = $($R1)
  258.                 ifstr(i) $($R2) != ""
  259.                     set DrivesToFree = >($(DrivesToFree), $($R2))
  260.                 endif
  261.             else
  262.                 Debug-Output "OEMSETUP.INF: User cancelled asking source."
  263.                 goto finish_InstallOption
  264.             endif
  265.  
  266.             install Install-AddCopyOption
  267.             ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  268.                 Debug-Output "Adding SCSI files to copy list failed"
  269.                 goto finish_InstallOption
  270.             endif
  271.         else
  272.             set DoCopy = NO
  273.         endif
  274.  
  275.     endif
  276.  
  277.     ifstr(i) $(DoCopy) == "YES"
  278.         read-syms ProgressCopy$($0)
  279.         install Install-DoCopyOption
  280.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  281.             Debug-Output "Copying files failed"
  282.             goto finish_InstallOption
  283.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  284.             set Status = STATUS_USERCANCEL
  285.             goto finish_InstallOption
  286.         endif
  287.     endif
  288.  
  289.     ifstr(i) $(DoConfig) == "YES"
  290.         ;
  291.         ; first run a privilege check on modifying the setup node
  292.         ;
  293.  
  294.         shell "registry.inf" CheckSetupModify
  295.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  296.             goto finish_InstallOption
  297.         endif
  298.  
  299.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  300.             goto finish_InstallOption
  301.         endif
  302.  
  303.         ;
  304.         ; then make a new SCSI entry, the entry is created automatically
  305.         ; enabled
  306.         ;
  307.  
  308.         set ServiceNode   = $(MiniportDriver)
  309.         set ServiceBinary = System32\drivers\#(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  310.  
  311.         set ServicesValues   = { +
  312.                 {Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
  313.                 {Start,          0, $(!REG_VT_DWORD),     $(Start)                 }, +
  314.                 {Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
  315.                 {ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
  316.                 {Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
  317.                 {BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }  +
  318.                 }
  319.         set ParametersValues = ""
  320.         set DeviceValues     = {}
  321.         set EventLogValues   = { +
  322.                 {EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
  323.                 {TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
  324.                 }
  325.  
  326.         shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  327.                                                 $(ServicesValues)   +
  328.                                                 $(ParametersValues) +
  329.                                                 $(DeviceValues)     +
  330.                                                 $(EventLogValues)   +
  331.                                                 Parameters
  332.  
  333.     ;===========================================================================
  334.     ;Make Scsidisk a system device if currently set to disabled.
  335.  
  336.     set KeyName = "System\CurrentControlSet\Services\Scsidisk"
  337.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_ALL_ACCESS) ScsidiskKeyHandle
  338.     set ScsiDiskExists = 0
  339.     ifstr(i) $(ScsidiskKeyHandle) != ""
  340.         set ScsiDiskExists = 1
  341.         GetRegValue $(ScsidiskKeyHandle) Start StartInfo
  342.         ifint *($(StartInfo),4) == 4      
  343.             SetRegValue    $(ScsidiskKeyHandle) {Start,0,$(!REG_VT_DWORD),1}
  344.         endif
  345.     endif
  346.     CloseRegKey $(ScsidiskKeyHandle)
  347.     ;===========================================================================
  348.  
  349.     ;// added 8/1/96 to disable atapi.sys by Iomega
  350.     ;===========================================================================
  351.  
  352.  
  353.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  354.             Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
  355.             goto finish_InstallOption
  356.         endif
  357.  
  358.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  359.             Debug-Output "MakeServicesEntry failed for SCSI"
  360.             goto finish_InstallOption
  361.         endif
  362.  
  363.     endif
  364.  
  365.     set Status = STATUS_SUCCESSFUL
  366. finish_InstallOption = +
  367.     ForListDo $(DrivesToFree)
  368.         LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  369.     EndForListDo
  370.  
  371.     Return $(Status)
  372.  
  373.  
  374. [Install-AddCopyOption]
  375.  
  376.     ;
  377.     ; Add the files to the copy list
  378.     ;
  379.     AddSectionKeyFileToCopyList   Files-ScsiMiniportDrivers         +
  380.                                   $(MiniportDriver)                 +
  381.                                   $(SrcDir)                      +
  382.                                   $(!STF_WINDOWSSYSPATH)\drivers
  383.  
  384.     exit
  385.  
  386.  
  387. [Install-DoCopyOption]
  388.  
  389.     ;
  390.     ; Copy files in the copy list
  391.     ;
  392.     CopyFilesInCopyList
  393.     exit
  394.  
  395. ;-------------------------------------------------------------------------
  396. ; 4. DeInstallOption:
  397. ;
  398. ; FUNCTION:  To remove files representing Option
  399. ;            To remove the registry entry corresponding to the Option
  400. ;
  401. ; INPUT:     $($0):  Language to use
  402. ;            $($1):  OptionID to install
  403. ;
  404. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  405. ;                            STATUS_NOLANGUAGE |
  406. ;                            STATUS_USERCANCEL |
  407. ;                            STATUS_FAILED
  408. ;-------------------------------------------------------------------------
  409. [DeInstallOption]
  410.     ;
  411.     ; Set default values for
  412.     ;
  413.     set Status   = STATUS_FAILED
  414.     ;
  415.     ; extract parameters
  416.     ;
  417.     set Option   = $($1)
  418.  
  419.     ;
  420.     ; Check if the language requested is supported
  421.     ;
  422.     set LanguageList = ^(LanguagesSupported, 1)
  423.     Ifcontains(i) $($0) in $(LanguageList)
  424.     else
  425.         set Status = STATUS_NOLANGUAGE
  426.         goto finish_DeInstallOption
  427.     endif
  428.     read-syms Strings$($0)
  429.  
  430.     ;
  431.     ; check to see if Option is supported.
  432.     ;
  433.  
  434.     set OptionList = ^(Options, 0)
  435.     ifcontains $(Option) in $(OptionList)
  436.     else
  437.         goto finish_DeInstallOption
  438.     endif
  439.     set OptionList = ""
  440.  
  441.     ;
  442.     ; fetch details about option
  443.     ;
  444.  
  445.     set MiniportDriver = #(Options, $(Option), 1)
  446.     set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  447.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  448.  
  449.     ;
  450.     ; check to see if file is installed
  451.     ; if not give success
  452.     ;
  453.  
  454.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  455.     ifstr(i) $(STATUS) == "NO"
  456.         set Status = STATUS_SUCCESSFUL
  457.         goto finish_DeInstallOption
  458.     endif
  459.  
  460.     shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  461.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  462.         ; this could happen if there is no start value or there is no
  463.         ; key, in which case the option is not installed
  464.         set Status = STATUS_SUCCESSFUL
  465.         goto finish_DeInstallOption
  466.     endif
  467.  
  468.     ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
  469.         shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(String3)
  470.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  471.             goto do_removal
  472.         endif
  473.         ifstr(i) $($R1) == "CANCEL"
  474.             goto finish_DeInstallOption
  475.         endif
  476.     endif
  477.  
  478. do_removal =+
  479.     ;
  480.     ; disable the registry entry
  481.     ;
  482.  
  483.     shell "registry.inf" RemoveServicesEntry $(MiniportDriver)
  484.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  485.         Debug-Output "OEMSETUP.INF: Failed to shell RemoveServicesEntry"
  486.         goto finish_DeInstallOption
  487.     endif
  488.  
  489.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  490.         Debug-Output "OEMSETUP.INF: Failed to disable services entry"
  491.         goto finish_DeInstallOption
  492.     endif
  493.  
  494.     ;
  495.     ; we won't remove the file because we can only do so during the next boot.
  496.     ; if the user chooses to reinstall the same driver during this boot
  497.     ; he will still end up deleting the driver on next boot. if the file
  498.     ; should be deleted a warning should be put up saying that the user should
  499.     ; not try to reinstall the driver during this boot
  500.     ;
  501.     ;    AddFileToDeleteList $(FilePath)
  502.  
  503.     set Status = STATUS_SUCCESSFUL
  504.  
  505. finish_DeInstallOption =+
  506.     return $(Status)
  507.  
  508.  
  509. ;-------------------------------------------------------------------------
  510. ; 5. GetInstalledOptions:
  511. ;
  512. ; FUNCTION:  To find out the list of options which are installed
  513. ;
  514. ; INPUT:     $($0): Language to Use
  515. ;
  516. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  517. ;                            STATUS_FAILED
  518. ;
  519. ;            $($R1): List of options installed
  520. ;            $($R2): Option installed Text List
  521. ;-------------------------------------------------------------------------
  522. [GetInstalledOptions]
  523.     set Status = STATUS_FAILED
  524.     set InstalledOptions = {}
  525.     set InstalledOptionsText = {}
  526.  
  527.     ;
  528.     ; Check if the language requested is supported
  529.     ;
  530.     set LanguageList = ^(LanguagesSupported, 1)
  531.     Ifcontains(i) $($0) in $(LanguageList)
  532.     else
  533.         set Status = STATUS_NOLANGUAGE
  534.         goto finish_GetInstalledOptions
  535.     endif
  536.  
  537.     set OptionList = ^(Options, 0)
  538.     ForListDo $(OptionList)
  539.         set MiniportDriver = #(Options, $($), 1)
  540.         set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  541.         set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  542.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  543.         ifstr(i) $(STATUS) == "YES"
  544.             shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  545.             ifint $($ShellCode) == $(!SHELL_CODE_OK)
  546.                 ifstr(i) $($R0) == STATUS_SUCCESSFUL
  547.                     ifstr(i) $($R1) != $(!SERVICE_DISABLED)
  548.  
  549.                         set OptionText = #(OptionsText$($0), $($), 1)
  550.                         set InstalledOptions     = >($(InstalledOptions), $($))
  551.                         set InstalledOptionsText = >($(InstalledOptionsText), $(OptionText))
  552.  
  553.                     endif
  554.                 endif
  555.             endif
  556.         endif
  557.     EndForListDo
  558.     set Status = STATUS_SUCCESSFUL
  559. finish_GetInstalledOptions =+
  560.     Return $(Status) $(InstalledOptions) $(InstalledOptionsText)
  561.  
  562.  
  563. ;**************************************************************************
  564. ; PROGRESS GUAGE VARIABLES
  565. ;**************************************************************************
  566.  
  567. [ProgressCopyENG]
  568.     ProCaption   = "Windows NT Setup"
  569.     ProCancel    = "Cancel"
  570.     ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
  571.                    "to cancel copying files?"
  572.     ProCancelCap = "Setup Message"
  573.     ProText1     = "Copying:"
  574.     ProText2     = "To:"
  575.  
  576. [StringsENG]
  577.     String1 = "SCSI Adapter"
  578.     String2 = "Please enter the full path to the OEM SCSI "+
  579.               "Adapter files.  Then choose Continue."
  580.     String3 = "The SCSI Adapter has been marked as a boot device.  Removing "+
  581.               "it may cause the system not to boot."$(!LF)$(!LF)"Are you sure "+
  582.               "you want to remove the Adapter."
  583.  
  584. [Source Media Descriptions]
  585.     1  = "Iomega NT 3.51/4.0 SCSI Adapter Driver Disk"  , TAGFILE = disk1
  586.  
  587. [Files-ScsiMiniportDrivers]
  588. ppa3nt   = 1, ppa3nt.sys , SIZE=100000