home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 October / VPR9810B.BIN / BIOS / free / sis5596 / sis5596.exe / NT35 / OEMSETUP.INF next >
INI File  |  1996-10-14  |  22KB  |  589 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.30"
  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" RemoveServicesEntry "siside"
  355.         shell "registry.inf" ModifyServicesEntry "Scsidisk" +
  356.               $(!SERVICE_BOOT_START)
  357.  
  358.     endif
  359.  
  360.  
  361.     set Status = STATUS_SUCCESSFUL
  362.  
  363. finish_InstallOption = +
  364.         ForListDo $(DrivesToFree)
  365.                 LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  366.         EndForListDo
  367.  
  368.         Return $(Status)
  369.  
  370.  
  371. [Install-AddCopyOption]
  372.  
  373.         ;
  374.         ; Add the files to the copy list
  375.         ;
  376.         AddSectionKeyFileToCopyList   Files-ScsiMiniportDrivers         +
  377.                                                                   $(MiniportDriver)                 +
  378.                                                                   $(SrcDir)                      +
  379.                                                                   $(!STF_WINDOWSSYSPATH)\drivers
  380.  
  381.         exit
  382.  
  383.  
  384. [Install-DoCopyOption]
  385.  
  386.         ;
  387.         ; Copy files in the copy list
  388.         ;
  389.         CopyFilesInCopyList
  390.         exit
  391.  
  392. ;-------------------------------------------------------------------------
  393. ; 4. DeInstallOption:
  394. ;
  395. ; FUNCTION:  To remove files representing Option
  396. ;            To remove the registry entry corresponding to the Option
  397. ;
  398. ; INPUT:     $($0):  Language to use
  399. ;            $($1):  OptionID to install
  400. ;
  401. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  402. ;                            STATUS_NOLANGUAGE |
  403. ;                            STATUS_USERCANCEL |
  404. ;                            STATUS_FAILED
  405. ;-------------------------------------------------------------------------
  406. [DeInstallOption]
  407.         ;
  408.         ; Set default values for
  409.         ;
  410.         set Status   = STATUS_FAILED
  411.         ;
  412.         ; extract parameters
  413.         ;
  414.         set Option   = $($1)
  415.  
  416.         ;
  417.         ; Check if the language requested is supported
  418.         ;
  419.         set LanguageList = ^(LanguagesSupported, 1)
  420.         Ifcontains(i) $($0) in $(LanguageList)
  421.         else
  422.                 set Status = STATUS_NOLANGUAGE
  423.                 goto finish_DeInstallOption
  424.         endif
  425.         read-syms Strings$($0)
  426.  
  427.         ;
  428.         ; check to see if Option is supported.
  429.         ;
  430.  
  431.         set OptionList = ^(Options, 0)
  432.         ifcontains $(Option) in $(OptionList)
  433.         else
  434.                 goto finish_DeInstallOption
  435.         endif
  436.         set OptionList = ""
  437.  
  438.         ;
  439.         ; fetch details about option
  440.         ;
  441.  
  442.         set MiniportDriver = #(Options, $(Option), 1)
  443.         set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  444.         set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  445.  
  446.         ;
  447.         ; check to see if file is installed
  448.         ; if not give success
  449.         ;
  450.  
  451.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  452.         ifstr(i) $(STATUS) == "NO"
  453.                 set Status = STATUS_SUCCESSFUL
  454.                 goto finish_DeInstallOption
  455.         endif
  456.  
  457.         shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  458.         ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  459.                 ; this could happen if there is no start value or there is no
  460.                 ; key, in which case the option is not installed
  461.                 set Status = STATUS_SUCCESSFUL
  462.                 goto finish_DeInstallOption
  463.         endif
  464.  
  465.         ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
  466.                 shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(String3)
  467.                 ifstr(i) $($R0) != STATUS_SUCCESSFUL
  468.                         goto do_removal
  469.                 endif
  470.                 ifstr(i) $($R1) == "CANCEL"
  471.                         goto finish_DeInstallOption
  472.                 endif
  473.         endif
  474.  
  475. do_removal =+
  476.         ;
  477.         ; disable the registry entry
  478.         ;
  479.  
  480.         shell "registry.inf" ModifyServicesEntry "Atdisk" +
  481.               $(!SERVICE_BOOT_START)
  482.  
  483.         shell "registry.inf" RemoveServicesEntry $(MiniportDriver)
  484.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  485.                 Debug-Output "SCSI.INF: Failed to shell RemoveServicesEntry"
  486.                 goto finish_DeInstallOption
  487.         endif
  488.  
  489.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  490.                 Debug-Output "SCSI.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  = "SiS MASTER IDE Miniport DRIVERS"  , TAGFILE = sistag
  586.  
  587. [Files-ScsiMiniportDrivers]
  588. sisidedv = 1,siside.sys , SIZE=999
  589.