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