home *** CD-ROM | disk | FTP | other *** search
/ Dave Lowe: Page Master Game Boy Backup 1994.05.20 / Lowe_PageMasterGameBoyBackup_1994.05.20.img / WNTSTUFF / PCI / OEMSETUP.INF < prev   
Encoding:
INI File  |  1997-05-27  |  18.9 KB  |  587 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.     "IomegNT"      = IomegNT
  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.     "IomegNT"      = "Iomega Jaz Jet PCI ( NT 3.51/4.0 ) 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.     IomegNT    = !SERVICE_KERNEL_DRIVER, "SCSI Miniport", !SERVICE_ERROR_NORMAL,  17, %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 SrcDir   = "A:\wntstuff\pci"
  171.     set Option   = $($1)
  172.     set AddCopy  = $($3)
  173.     set DoCopy   = $($4)
  174.     set DoConfig = $($5)
  175.  
  176.     ;
  177.     ; Check if the language requested is supported
  178.     ;
  179.     set LanguageList = ^(LanguagesSupported, 1)
  180.     Ifcontains(i) $($0) in $(LanguageList)
  181.     else
  182.         set Status = STATUS_NOLANGUAGE
  183.         goto finish_InstallOption
  184.     endif
  185.     read-syms Strings$($0)
  186.  
  187.     ;
  188.     ; check to see if Option is supported.
  189.     ;
  190.  
  191.     set OptionList = ^(Options, 0)
  192.     ifcontains $(Option) in $(OptionList)
  193.     else
  194.         Debug-Output "OEMSETUP.INF: SCSI option is not supported."
  195.         goto finish_InstallOption
  196.     endif
  197.     set OptionList = ""
  198.  
  199.     ;
  200.     ; Option has been defined already
  201.     ;
  202.  
  203.     set MiniportDriver   =   #(Options,         $(Option),         1)
  204.     set Type             = $(#(MiniportDrivers, $(MiniportDriver), 1))
  205.     set Group            =   #(MiniportDrivers, $(MiniportDriver), 2)
  206.     set ErrorControl     = $(#(MiniportDrivers, $(MiniportDriver), 3))
  207.     set Tag              =   #(MiniportDrivers, $(MiniportDriver), 4)
  208.     set EventMessageFile =   #(MiniportDrivers, $(MiniportDriver), 5)
  209.     set TypesSupported   =   #(MiniportDrivers, $(MiniportDriver), 6)
  210.  
  211.     set Start            =   $(!SERVICE_BOOT_START)
  212.  
  213. installtheoption = +
  214.  
  215.     ;
  216.     ; Code to add files to copy list
  217.     ;
  218.  
  219.     ifstr(i) $(AddCopy) == "YES"
  220.         set DoActualCopy = NO
  221.         set FileToCheck = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  222.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
  223.         ifstr(i) $(STATUS) == NO
  224.             set DoActualCopy = YES
  225.         endif
  226.  
  227.         ifstr(i) $(DoActualCopy) == NO
  228.             shell "subroutn.inf" DriversExist $($0) $(String1)
  229.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  230.                 Debug-Output "OEMSETUP.INF: shelling DriversExist failed"
  231.                 goto finish_InstallOption
  232.             endif
  233.  
  234.             ifstr(i) $($R0) == STATUS_CURRENT
  235.             else-ifstr(i) $($R0) == STATUS_NEW
  236.                 set DoActualCopy = YES
  237.             else-ifstr(i) $($R0) == STATUS_USERCANCEL
  238.                 Debug-Output "OEMSETUP.INF: User cancelled SCSI installation"
  239.                 goto finish_InstallOption
  240.             else
  241.                 Debug-Output "OEMSETUP.INF: Error reported in DriversExist routine in SUBROUTN.INF"
  242.                 goto finish_InstallOption
  243.             endif
  244.         endif
  245.  
  246.         ifstr(i) $(DoActualCopy) == YES
  247.  
  248.             shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
  249.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  250.                 Debug-Output "OEMSETUP.INF: shelling DoAskSourceEx failed"
  251.                 goto finish_InstallOption
  252.             endif
  253.  
  254.             ifstr(i) $($R0) == STATUS_SUCCESSFUL
  255.                 set SrcDir = $($R1)
  256.                 ifstr(i) $($R2) != ""
  257.                     set DrivesToFree = >($(DrivesToFree), $($R2))
  258.                 endif
  259.             else
  260.                 Debug-Output "OEMSETUP.INF: User cancelled asking source."
  261.                 goto finish_InstallOption
  262.             endif
  263.  
  264.             install Install-AddCopyOption
  265.             ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  266.                 Debug-Output "Adding SCSI files to copy list failed"
  267.                 goto finish_InstallOption
  268.             endif
  269.         else
  270.             set DoCopy = NO
  271.         endif
  272.  
  273.     endif
  274.  
  275.     ifstr(i) $(DoCopy) == "YES"
  276.         read-syms ProgressCopy$($0)
  277.         install Install-DoCopyOption
  278.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  279.             Debug-Output "Copying files failed"
  280.             goto finish_InstallOption
  281.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  282.             set Status = STATUS_USERCANCEL
  283.             goto finish_InstallOption
  284.         endif
  285.     endif
  286.  
  287.     ifstr(i) $(DoConfig) == "YES"
  288.         ;
  289.         ; first run a privilege check on modifying the setup node
  290.         ;
  291.  
  292.         shell "registry.inf" CheckSetupModify
  293.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  294.             goto finish_InstallOption
  295.         endif
  296.  
  297.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  298.             goto finish_InstallOption
  299.         endif
  300.  
  301.         ;
  302.         ; then make a new SCSI entry, the entry is created automatically
  303.         ; enabled
  304.         ;
  305.  
  306.         set ServiceNode   = $(MiniportDriver)
  307.         set ServiceBinary = System32\drivers\#(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  308.  
  309.         set ServicesValues   = { +
  310.                 {Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
  311.                 {Start,          0, $(!REG_VT_DWORD),     $(Start)                 }, +
  312.                 {Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
  313.                 {ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
  314.                 {Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
  315.                 {BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }  +
  316.                 }
  317.         set ParametersValues = ""
  318.         set DeviceValues     = {}
  319.         set EventLogValues   = { +
  320.                 {EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
  321.                 {TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
  322.                 }
  323.  
  324.         shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  325.                                                 $(ServicesValues)   +
  326.                                                 $(ParametersValues) +
  327.                                                 $(DeviceValues)     +
  328.                                                 $(EventLogValues)   +
  329.                                                 Parameters
  330.  
  331.     ;===========================================================================
  332.     ;Make Scsidisk a system device if currently set to disabled.
  333.  
  334.     set KeyName = "System\CurrentControlSet\Services\Scsidisk"
  335.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_ALL_ACCESS) ScsidiskKeyHandle
  336.     set ScsiDiskExists = 0
  337.     ifstr(i) $(ScsidiskKeyHandle) != ""
  338.         set ScsiDiskExists = 1
  339.         GetRegValue $(ScsidiskKeyHandle) Start StartInfo
  340.         ifint *($(StartInfo),4) == 4      
  341.             SetRegValue    $(ScsidiskKeyHandle) {Start,0,$(!REG_VT_DWORD),1}
  342.         endif
  343.     endif
  344.     CloseRegKey $(ScsidiskKeyHandle)
  345.     ;===========================================================================
  346.  
  347.     ;// added 8/1/96 to disable atapi.sys by Iomega
  348.     ;===========================================================================
  349.  
  350.  
  351.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  352.             Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
  353.             goto finish_InstallOption
  354.         endif
  355.  
  356.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  357.             Debug-Output "MakeServicesEntry failed for SCSI"
  358.             goto finish_InstallOption
  359.         endif
  360.  
  361.     endif
  362.  
  363.     set Status = STATUS_SUCCESSFUL
  364. finish_InstallOption = +
  365.     ForListDo $(DrivesToFree)
  366.         LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  367.     EndForListDo
  368.  
  369.     Return $(Status)
  370.  
  371.  
  372. [Install-AddCopyOption]
  373.  
  374.     ;
  375.     ; Add the files to the copy list
  376.     ;
  377.     AddSectionKeyFileToCopyList   Files-ScsiMiniportDrivers         +
  378.                                   $(MiniportDriver)                 +
  379.                                   $(SrcDir)                      +
  380.                                   $(!STF_WINDOWSSYSPATH)\drivers
  381.  
  382.     exit
  383.  
  384.  
  385. [Install-DoCopyOption]
  386.  
  387.     ;
  388.     ; Copy files in the copy list
  389.     ;
  390.     CopyFilesInCopyList
  391.     exit
  392.  
  393. ;-------------------------------------------------------------------------
  394. ; 4. DeInstallOption:
  395. ;
  396. ; FUNCTION:  To remove files representing Option
  397. ;            To remove the registry entry corresponding to the Option
  398. ;
  399. ; INPUT:     $($0):  Language to use
  400. ;            $($1):  OptionID to install
  401. ;
  402. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  403. ;                            STATUS_NOLANGUAGE |
  404. ;                            STATUS_USERCANCEL |
  405. ;                            STATUS_FAILED
  406. ;-------------------------------------------------------------------------
  407. [DeInstallOption]
  408.     ;
  409.     ; Set default values for
  410.     ;
  411.     set Status   = STATUS_FAILED
  412.     ;
  413.     ; extract parameters
  414.     ;
  415.     set Option   = $($1)
  416.  
  417.     ;
  418.     ; Check if the language requested is supported
  419.     ;
  420.     set LanguageList = ^(LanguagesSupported, 1)
  421.     Ifcontains(i) $($0) in $(LanguageList)
  422.     else
  423.         set Status = STATUS_NOLANGUAGE
  424.         goto finish_DeInstallOption
  425.     endif
  426.     read-syms Strings$($0)
  427.  
  428.     ;
  429.     ; check to see if Option is supported.
  430.     ;
  431.  
  432.     set OptionList = ^(Options, 0)
  433.     ifcontains $(Option) in $(OptionList)
  434.     else
  435.         goto finish_DeInstallOption
  436.     endif
  437.     set OptionList = ""
  438.  
  439.     ;
  440.     ; fetch details about option
  441.     ;
  442.  
  443.     set MiniportDriver = #(Options, $(Option), 1)
  444.     set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  445.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  446.  
  447.     ;
  448.     ; check to see if file is installed
  449.     ; if not give success
  450.     ;
  451.  
  452.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  453.     ifstr(i) $(STATUS) == "NO"
  454.         set Status = STATUS_SUCCESSFUL
  455.         goto finish_DeInstallOption
  456.     endif
  457.  
  458.     shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  459.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  460.         ; this could happen if there is no start value or there is no
  461.         ; key, in which case the option is not installed
  462.         set Status = STATUS_SUCCESSFUL
  463.         goto finish_DeInstallOption
  464.     endif
  465.  
  466.     ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
  467.         shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(String3)
  468.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  469.             goto do_removal
  470.         endif
  471.         ifstr(i) $($R1) == "CANCEL"
  472.             goto finish_DeInstallOption
  473.         endif
  474.     endif
  475.  
  476. do_removal =+
  477.     ;
  478.     ; disable the registry entry
  479.     ;
  480.  
  481.     shell "registry.inf" RemoveServicesEntry $(MiniportDriver)
  482.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  483.         Debug-Output "OEMSETUP.INF: Failed to shell RemoveServicesEntry"
  484.         goto finish_DeInstallOption
  485.     endif
  486.  
  487.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  488.         Debug-Output "OEMSETUP.INF: Failed to disable services entry"
  489.         goto finish_DeInstallOption
  490.     endif
  491.  
  492.     ;
  493.     ; we won't remove the file because we can only do so during the next boot.
  494.     ; if the user chooses to reinstall the same driver during this boot
  495.     ; he will still end up deleting the driver on next boot. if the file
  496.     ; should be deleted a warning should be put up saying that the user should
  497.     ; not try to reinstall the driver during this boot
  498.     ;
  499.     ;    AddFileToDeleteList $(FilePath)
  500.  
  501.     set Status = STATUS_SUCCESSFUL
  502.  
  503. finish_DeInstallOption =+
  504.     return $(Status)
  505.  
  506.  
  507. ;-------------------------------------------------------------------------
  508. ; 5. GetInstalledOptions:
  509. ;
  510. ; FUNCTION:  To find out the list of options which are installed
  511. ;
  512. ; INPUT:     $($0): Language to Use
  513. ;
  514. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  515. ;                            STATUS_FAILED
  516. ;
  517. ;            $($R1): List of options installed
  518. ;            $($R2): Option installed Text List
  519. ;-------------------------------------------------------------------------
  520. [GetInstalledOptions]
  521.     set Status = STATUS_FAILED
  522.     set InstalledOptions = {}
  523.     set InstalledOptionsText = {}
  524.  
  525.     ;
  526.     ; Check if the language requested is supported
  527.     ;
  528.     set LanguageList = ^(LanguagesSupported, 1)
  529.     Ifcontains(i) $($0) in $(LanguageList)
  530.     else
  531.         set Status = STATUS_NOLANGUAGE
  532.         goto finish_GetInstalledOptions
  533.     endif
  534.  
  535.     set OptionList = ^(Options, 0)
  536.     ForListDo $(OptionList)
  537.         set MiniportDriver = #(Options, $($), 1)
  538.         set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  539.         set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  540.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  541.         ifstr(i) $(STATUS) == "YES"
  542.             shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  543.             ifint $($ShellCode) == $(!SHELL_CODE_OK)
  544.                 ifstr(i) $($R0) == STATUS_SUCCESSFUL
  545.                     ifstr(i) $($R1) != $(!SERVICE_DISABLED)
  546.  
  547.                         set OptionText = #(OptionsText$($0), $($), 1)
  548.                         set InstalledOptions     = >($(InstalledOptions), $($))
  549.                         set InstalledOptionsText = >($(InstalledOptionsText), $(OptionText))
  550.  
  551.                     endif
  552.                 endif
  553.             endif
  554.         endif
  555.     EndForListDo
  556.     set Status = STATUS_SUCCESSFUL
  557. finish_GetInstalledOptions =+
  558.     Return $(Status) $(InstalledOptions) $(InstalledOptionsText)
  559.  
  560.  
  561. ;**************************************************************************
  562. ; PROGRESS GUAGE VARIABLES
  563. ;**************************************************************************
  564.  
  565. [ProgressCopyENG]
  566.     ProCaption   = "Windows NT Setup"
  567.     ProCancel    = "Cancel"
  568.     ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
  569.                    "to cancel copying files?"
  570.     ProCancelCap = "Setup Message"
  571.     ProText1     = "Copying:"
  572.     ProText2     = "To:"
  573.  
  574. [StringsENG]
  575.     String1 = "SCSI Adapter"
  576.     String2 = "Please enter the full path to the OEM SCSI "+
  577.               "Adapter files.  Then choose Continue."
  578.     String3 = "The SCSI Adapter has been marked as a boot device.  Removing "+
  579.               "it may cause the system not to boot."$(!LF)$(!LF)"Are you sure "+
  580.               "you want to remove the Adapter."
  581.  
  582. [Source Media Descriptions]
  583.     1  = "Iomega NT 3.51/4.0 SCSI Adapter Driver Disk"  , TAGFILE = disk1
  584.  
  585. [Files-ScsiMiniportDrivers]
  586. IomegNT = 1, ascNT.sys , SIZE=999
  587.