home *** CD-ROM | disk | FTP | other *** search
/ ftp.sunet.se/pub/OS2/ / 2014.11.ftp.sunet.se_pub_OS2.tar / ftp.sunet.se / pub / OS2 / hobbes / os2 / system / drivers / storage / os2_2318.exe / WINNT / VIAIDE.INF < prev   
INI File  |  1999-05-25  |  22KB  |  720 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.     "VIADSK"    = viadsk
  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.     "VIADSK"    = "VIA bus master IDE drivers"
  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.     viadsk  = !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 parameters for VIA IDE
  163.     ;
  164.     set SndChIRQ        = 15
  165.     set Disk0_DMA_Time  = 120
  166.     set Disk0_PIO_Time  = 120
  167.     set Disk0_DMA_Mode  = 1
  168.     set Disk0_Blk_Size  = 16 
  169.     set Disk1_DMA_Time  = 0
  170.     set Disk1_PIO_Time  = 0
  171.     set Disk1_DMA_Mode  = 1
  172.     set Disk1_Blk_Size  = 0
  173.     set Disk2_DMA_Time  = 0
  174.     set Disk2_PIO_Time  = 0
  175.     set Disk2_DMA_Mode  = 1
  176.     set Disk2_Blk_Size  = 0
  177.     set Disk3_DMA_Time  = 0
  178.     set Disk3_PIO_Time  = 0
  179.     set Disk3_DMA_Mode  = 1
  180.     set Disk3_Blk_Size  = 0
  181.  
  182.     ;
  183.     ; Delete VIAIDE service key to modify parameters
  184.     ;
  185.     shell "utility.inf" RemoveService viaide "NO"
  186.  
  187.     ;
  188.     ; Set default values for
  189.     ;
  190.     set Status = STATUS_FAILED
  191.     set DrivesToFree = {}
  192.  
  193.     ;
  194.     ; extract parameters
  195.     ;
  196.     set Option   = $($1)
  197.     set SrcDir   = $($2)
  198.     set AddCopy  = $($3)
  199.     set DoCopy   = $($4)
  200.     set DoConfig = $($5)
  201.  
  202.     ;
  203.     ; Check if the language requested is supported
  204.     ;
  205.     set LanguageList = ^(LanguagesSupported, 1)
  206.     Ifcontains(i) $($0) in $(LanguageList)
  207.     else
  208.     set Status = STATUS_NOLANGUAGE
  209.     goto finish_InstallOption
  210.     endif
  211.     read-syms Strings$($0)
  212.  
  213.     ;
  214.     ; check to see if Option is supported.
  215.     ;
  216.  
  217.     set OptionList = ^(Options, 0)
  218.     ifcontains $(Option) in $(OptionList)
  219.     else
  220.     Debug-Output "SCSI.INF: SCSI option is not supported."
  221.     goto finish_InstallOption
  222.     endif
  223.     set OptionList = ""
  224.  
  225.     ;
  226.     ; Option has been defined already
  227.     ;
  228.  
  229.     set MiniportDriver   =   #(Options,         $(Option),         1)
  230.     set Type             = $(#(MiniportDrivers, $(MiniportDriver), 1))
  231.     set Group            =   #(MiniportDrivers, $(MiniportDriver), 2)
  232.     set ErrorControl     = $(#(MiniportDrivers, $(MiniportDriver), 3))
  233.     set Tag              =   #(MiniportDrivers, $(MiniportDriver), 4)
  234.     set EventMessageFile =   #(MiniportDrivers, $(MiniportDriver), 5)
  235.     set TypesSupported   =   #(MiniportDrivers, $(MiniportDriver), 6)
  236.  
  237.     set Start            =   $(!SERVICE_BOOT_START)
  238.  
  239. installtheoption = +
  240.  
  241.     ;
  242.     ; Code to add files to copy list
  243.     ;
  244.  
  245. ;hc01_s
  246. ;*set AddCopy = NO
  247. ;hc01_e
  248.  
  249.     ifstr(i) $(AddCopy) == "YES"
  250.     set DoActualCopy = NO
  251.     set FileToCheck = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  252.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
  253.     ifstr(i) $(STATUS) == NO
  254.         set DoActualCopy = YES
  255.     endif
  256.  
  257.     ifstr(i) $(DoActualCopy) == NO
  258.         shell "subroutn.inf" DriversExist $($0) $(String1)
  259.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  260.         Debug-Output "SCSI.INF: shelling DriversExist failed"
  261.         goto finish_InstallOption
  262.         endif
  263.  
  264.         ifstr(i) $($R0) == STATUS_CURRENT
  265.         else-ifstr(i) $($R0) == STATUS_NEW
  266.         set DoActualCopy = YES
  267.         else-ifstr(i) $($R0) == STATUS_USERCANCEL
  268.         Debug-Output "SCSI.INF: User cancelled SCSI installation"
  269.         goto finish_InstallOption
  270.         else
  271.         Debug-Output "SCSI.INF: Error reported in DriversExist routine in SUBROUTN.INF"
  272.         goto finish_InstallOption
  273.         endif
  274.     endif
  275.  
  276.     ifstr(i) $(DoActualCopy) == YES
  277.  
  278.         shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
  279.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  280.         Debug-Output "SCSI.INF: shelling DoAskSourceEx failed"
  281.         goto finish_InstallOption
  282.         endif
  283.  
  284.         ifstr(i) $($R0) == STATUS_SUCCESSFUL
  285.         set SrcDir = $($R1)
  286.         ifstr(i) $($R2) != ""
  287.             set DrivesToFree = >($(DrivesToFree), $($R2))
  288.         endif
  289.         else
  290.         Debug-Output "SCSI.INF: User cancelled asking source."
  291.         goto finish_InstallOption
  292.         endif
  293.  
  294.         install Install-AddCopyOption
  295.         ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  296.         Debug-Output "Adding SCSI files to copy list failed"
  297.         goto finish_InstallOption
  298.         endif
  299.     else
  300.         set DoCopy = NO
  301.     endif
  302.  
  303.     endif
  304.  
  305. ;hc01_s
  306. ;*set DoCopy = NO
  307. ;hc01_e
  308.  
  309.     ifstr(i) $(DoCopy) == "YES"
  310.     read-syms ProgressCopy$($0)
  311.     install Install-DoCopyOption
  312.     ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  313.         Debug-Output "Copying files failed"
  314.         goto finish_InstallOption
  315.     else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  316.         set Status = STATUS_USERCANCEL
  317.         goto finish_InstallOption
  318.     endif
  319.     endif
  320. ;hc01_s
  321.     set DoConfig = YES
  322. ;hc01_e
  323.  
  324.     ifstr(i) $(DoConfig) == "YES"
  325.     ;
  326.     ; first run a privilege check on modifying the setup node
  327.     ;
  328.  
  329.     shell "registry.inf" CheckSetupModify
  330.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  331.         goto finish_InstallOption
  332.     endif
  333.  
  334.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  335.         goto finish_InstallOption
  336.     endif
  337.  
  338.     ;
  339.     ; then make a new SCSI entry, the entry is created automatically
  340.     ; enabled
  341.     ;
  342.  
  343.     set ServiceNode   = $(MiniportDriver)
  344.     set ServiceBinary = System32\drivers\#(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  345.  
  346.     set ServicesValues   = { +
  347.         {Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
  348.         {Start,          0, $(!REG_VT_DWORD),     $(Start)                 }, +
  349.         {Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
  350.         {ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
  351.         {Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
  352.         {BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }  +
  353.         }
  354.  
  355.     set DeviceValues     = {}
  356.     set EventLogValues   = { +
  357.         {EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
  358.         {TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
  359.         }
  360.  
  361.     ;
  362.     ; These parameters will be at
  363.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\SNDCHIRQ
  364.     ;
  365.     set ParametersValues = { +
  366.         {SNDCHIRQ,     0, $(!REG_VT_DWORD),    $(SndChIRQ)  }, +
  367.         }
  368.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  369.                         $(ServicesValues)   +
  370.                         $(ParametersValues) +
  371.                         $(DeviceValues)     +
  372.                         $(EventLogValues)   +
  373.                         SNDCHIRQ
  374.     ;
  375.     ; These parameters will be at
  376.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\Parameters0
  377.     ;
  378. ;HC_02S
  379.     set ParametersValues = { +
  380. ;                {DMA_TIME,     0, $(!REG_VT_DWORD),    $(Disk0_DMA_Time) }, +
  381. ;                {PIO_TIME,     0, $(!REG_VT_DWORD),    $(Disk0_PIO_Time) }, +
  382.         {SET_DMAM,     0, $(!REG_VT_DWORD),    $(Disk0_DMA_Mode) }, +
  383. ;                {BLCKSIZE,     0, $(!REG_VT_DWORD),    $(Disk0_Blk_Size) }, +
  384.            }
  385. ;HC_02E
  386.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  387.                         $(ServicesValues)   +
  388.                         $(ParametersValues) +
  389.                         $(DeviceValues)     +
  390.                         $(EventLogValues)   +
  391.                         Parameters0
  392.     ;
  393.     ; These parameters will be at
  394.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\Parameters1
  395.     ;
  396. ;HC_02S
  397.     set ParametersValues = { +
  398. ;                {DMA_TIME,     0, $(!REG_VT_DWORD),    $(Disk1_DMA_Time) }, +
  399. ;                {PIO_TIME,     0, $(!REG_VT_DWORD),    $(Disk1_PIO_Time) }, +
  400.         {SET_DMAM,     0, $(!REG_VT_DWORD),    $(Disk1_DMA_Mode) }, +
  401. ;                {BLCKSIZE,     0, $(!REG_VT_DWORD),    $(Disk1_Blk_Size) }, +
  402.         }
  403. ;HC_02E
  404.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  405.                         $(ServicesValues)   +
  406.                         $(ParametersValues) +
  407.                         $(DeviceValues)     +
  408.                         $(EventLogValues)   +
  409.                         Parameters1
  410.     ;
  411.     ; These parameters will be at
  412.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\Parameters2
  413.     ;
  414. ;HC_02S
  415.     set ParametersValues = { +
  416. ;                {DMA_TIME,     0, $(!REG_VT_DWORD),    $(Disk2_DMA_Time) }, +
  417. ;                {PIO_TIME,     0, $(!REG_VT_DWORD),    $(Disk2_PIO_Time) }, +
  418.         {SET_DMAM,     0, $(!REG_VT_DWORD),    $(Disk2_DMA_Mode) }, +
  419. ;                {BLCKSIZE,     0, $(!REG_VT_DWORD),    $(Disk2_Blk_Size) }, +
  420.         }
  421. ;HC_02E
  422.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  423.                         $(ServicesValues)   +
  424.                         $(ParametersValues) +
  425.                         $(DeviceValues)     +
  426.                         $(EventLogValues)   +
  427.                         Parameters2
  428.     ;
  429.     ; These parameters will be at
  430.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\Parameters3
  431.     ;
  432. ;HC_02S
  433.     set ParametersValues = { +
  434. ;                {DMA_TIME,     0, $(!REG_VT_DWORD),    $(Disk3_DMA_Time) }, +
  435. ;                {PIO_TIME,     0, $(!REG_VT_DWORD),    $(Disk3_PIO_Time) }, +
  436.         {SET_DMAM,     0, $(!REG_VT_DWORD),    $(Disk3_DMA_Mode) }, +
  437. ;                {BLCKSIZE,     0, $(!REG_VT_DWORD),    $(Disk3_Blk_Size) }, +
  438.         }
  439. ;HC_02E
  440.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  441.                         $(ServicesValues)   +
  442.                         $(ParametersValues) +
  443.                         $(DeviceValues)     +
  444.                         $(EventLogValues)   +
  445.                         Parameters3
  446.  
  447.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  448.         Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
  449.         goto finish_InstallOption
  450.     endif
  451.  
  452.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  453.         Debug-Output "MakeServicesEntry failed for SCSI"
  454.         goto finish_InstallOption
  455.     endif
  456. ;Frank_S
  457.     shell "registry.inf" ModifyServicesEntry atapi $(!SERVICE_DISABLED)
  458.     shell "registry.inf" ModifyServicesEntry atdisk $(!SERVICE_DISABLED)
  459. ;HC03_S
  460.     shell "registry.inf" GetServicesEntryStart "imgatapi"
  461.     ifstr(i) $($R0) == "STATUS_SUCCESSFUL"
  462.     shell "registry.inf" ModifyServicesEntry imgatapi $(!SERVICE_DISABLED)
  463.     endif
  464. ;HC03_E
  465.     set KeyName = "Software\Microsoft\Windows NT\CurrentVersion"
  466.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_READ) KeyHandle
  467.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  468.       Debug-Output "REGISTRY.INF: Couldn't open windows nt software key for read access"
  469.       goto finish_InstallOption
  470.     endif
  471.  
  472.     GetRegValue $(KeyHandle) "CurrentVersion" VerInf
  473.     set NtVer  = *($(VerInf),4)
  474.  
  475. ;        ifstr(i) $(NtVer) == "4.0"
  476. ;          shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  477. ;          shell "registry.inf" ModifyServicesEntry scsicdrm $(!SERVICE_SYSTEM_START)
  478. ;        endif
  479.  
  480.     ifstr(i) $(NtVer) == "3.50"
  481.       shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  482.       shell "registry.inf" ModifyServicesEntry scsicdrm $(!SERVICE_SYSTEM_START)
  483.     endif
  484.     ifstr(i) $(NtVer) == "3.51"
  485.       shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  486.       shell "registry.inf" ModifyServicesEntry scsicdrm $(!SERVICE_SYSTEM_START)
  487.     endif
  488.     CloseRegKey $(KeyHandle)
  489.     ;shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  490.     ;shell "registry.inf" ModifyServicesEntry scsicdrm $(!SERVICE_SYSTEM_START)
  491.     ;shell "registry.inf" ModifyServicesEntry atapi $(!SERVICE_DISABLED)
  492.     ;shell "registry.inf" ModifyServicesEntry atdisk $(!SERVICE_DISABLED)
  493. ;Frank_E
  494.     endif
  495.  
  496.     set Status = STATUS_SUCCESSFUL
  497. finish_InstallOption = +
  498.     ForListDo $(DrivesToFree)
  499.     LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  500.     EndForListDo
  501.  
  502.     Return $(Status)
  503.  
  504.  
  505. [Install-AddCopyOption]
  506.  
  507.     ;
  508.     ; Add the files to the copy list
  509.     ;
  510.     AddSectionKeyFileToCopyList   Files-ScsiMiniportDrivers         +
  511.                   $(MiniportDriver)                 +
  512.                   $(SrcDir)                      +
  513.                   $(!STF_WINDOWSSYSPATH)\drivers
  514.  
  515.     exit
  516.  
  517.  
  518. [Install-DoCopyOption]
  519.  
  520.     ;
  521.     ; Copy files in the copy list
  522.     ;
  523.     CopyFilesInCopyList
  524.     exit
  525.  
  526. ;-------------------------------------------------------------------------
  527. ; 4. DeInstallOption:
  528. ;
  529. ; FUNCTION:  To remove files representing Option
  530. ;            To remove the registry entry corresponding to the Option
  531. ;
  532. ; INPUT:     $($0):  Language to use
  533. ;            $($1):  OptionID to install
  534. ;
  535. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  536. ;                            STATUS_NOLANGUAGE |
  537. ;                            STATUS_USERCANCEL |
  538. ;                            STATUS_FAILED
  539. ;-------------------------------------------------------------------------
  540. [DeInstallOption]
  541.     ;
  542.     ; Set default values for
  543.     ;
  544.     set Status   = STATUS_FAILED
  545.     ;
  546.     ; extract parameters
  547.     ;
  548.     set Option   = $($1)
  549.  
  550.     ;
  551.     ; Check if the language requested is supported
  552.     ;
  553.     set LanguageList = ^(LanguagesSupported, 1)
  554.     Ifcontains(i) $($0) in $(LanguageList)
  555.     else
  556.     set Status = STATUS_NOLANGUAGE
  557.     goto finish_DeInstallOption
  558.     endif
  559.     read-syms Strings$($0)
  560.  
  561.     ;
  562.     ; check to see if Option is supported.
  563.     ;
  564.  
  565.     set OptionList = ^(Options, 0)
  566.     ifcontains $(Option) in $(OptionList)
  567.     else
  568.     goto finish_DeInstallOption
  569.     endif
  570.     set OptionList = ""
  571.  
  572.     ;
  573.     ; fetch details about option
  574.     ;
  575.  
  576.     set MiniportDriver = #(Options, $(Option), 1)
  577.     set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  578.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  579.  
  580.     ;
  581.     ; check to see if file is installed
  582.     ; if not give success
  583.     ;
  584.  
  585.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  586.     ifstr(i) $(STATUS) == "NO"
  587.     set Status = STATUS_SUCCESSFUL
  588.     goto finish_DeInstallOption
  589.     endif
  590.  
  591.     shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  592.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  593.     ; this could happen if there is no start value or there is no
  594.     ; key, in which case the option is not installed
  595.     set Status = STATUS_SUCCESSFUL
  596.     goto finish_DeInstallOption
  597.     endif
  598.  
  599.     ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
  600.     shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(String3)
  601.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  602.         goto do_removal
  603.     endif
  604.     ifstr(i) $($R1) == "CANCEL"
  605.         goto finish_DeInstallOption
  606.     endif
  607.     endif
  608.  
  609. do_removal =+
  610.     ;
  611.     ; disable the registry entry
  612.     ;
  613.  
  614.     shell "registry.inf" RemoveServicesEntry $(MiniportDriver)
  615.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  616.     Debug-Output "SCSI.INF: Failed to shell RemoveServicesEntry"
  617.     goto finish_DeInstallOption
  618.     endif
  619.  
  620.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  621.     Debug-Output "SCSI.INF: Failed to disable services entry"
  622.     goto finish_DeInstallOption
  623.     endif
  624.  
  625.     ;
  626.     ; we won't remove the file because we can only do so during the next boot.
  627.     ; if the user chooses to reinstall the same driver during this boot
  628.     ; he will still end up deleting the driver on next boot. if the file
  629.     ; should be deleted a warning should be put up saying that the user should
  630.     ; not try to reinstall the driver during this boot
  631.     ;
  632.     ;    AddFileToDeleteList $(FilePath)
  633.  
  634.     set Status = STATUS_SUCCESSFUL
  635.  
  636. finish_DeInstallOption =+
  637.     return $(Status)
  638.  
  639.  
  640. ;-------------------------------------------------------------------------
  641. ; 5. GetInstalledOptions:
  642. ;
  643. ; FUNCTION:  To find out the list of options which are installed
  644. ;
  645. ; INPUT:     $($0): Language to Use
  646. ;
  647. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  648. ;                            STATUS_FAILED
  649. ;
  650. ;            $($R1): List of options installed
  651. ;            $($R2): Option installed Text List
  652. ;-------------------------------------------------------------------------
  653. [GetInstalledOptions]
  654.     set Status = STATUS_FAILED
  655.     set InstalledOptions = {}
  656.     set InstalledOptionsText = {}
  657.  
  658.     ;
  659.     ; Check if the language requested is supported
  660.     ;
  661.     set LanguageList = ^(LanguagesSupported, 1)
  662.     Ifcontains(i) $($0) in $(LanguageList)
  663.     else
  664.     set Status = STATUS_NOLANGUAGE
  665.     goto finish_GetInstalledOptions
  666.     endif
  667.  
  668.     set OptionList = ^(Options, 0)
  669.     ForListDo $(OptionList)
  670.     set MiniportDriver = #(Options, $($), 1)
  671.     set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  672.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  673.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  674.     ifstr(i) $(STATUS) == "YES"
  675.         shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  676.         ifint $($ShellCode) == $(!SHELL_CODE_OK)
  677.         ifstr(i) $($R0) == STATUS_SUCCESSFUL
  678.             ifstr(i) $($R1) != $(!SERVICE_DISABLED)
  679.  
  680.             set OptionText = #(OptionsText$($0), $($), 1)
  681.             set InstalledOptions     = >($(InstalledOptions), $($))
  682.             set InstalledOptionsText = >($(InstalledOptionsText), $(OptionText))
  683.  
  684.             endif
  685.         endif
  686.         endif
  687.     endif
  688.     EndForListDo
  689.     set Status = STATUS_SUCCESSFUL
  690. finish_GetInstalledOptions =+
  691.     Return $(Status) $(InstalledOptions) $(InstalledOptionsText)
  692.  
  693.  
  694. ;**************************************************************************
  695. ; PROGRESS GUAGE VARIABLES
  696. ;**************************************************************************
  697.  
  698. [ProgressCopyENG]
  699.     ProCaption   = "Windows NT Setup"
  700.     ProCancel    = "Cancel"
  701.     ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
  702.            "to cancel copying files?"
  703.     ProCancelCap = "Setup Message"
  704.     ProText1     = "Copying:"
  705.     ProText2     = "To:"
  706.  
  707. [StringsENG]
  708.     String1 = "PCI IDE DISK Adapter"
  709.     String2 = "Please enter the full path to the VIA VT82C580 PCI IDE DISK "+
  710.           "Adapter file.  Then choose Continue."
  711.     String3 = "The VT82C580 PCI IDE DISK Adapter has been marked as a boot device.  Removing "+
  712.           "it may cause the system not to boot."$(!LF)$(!LF)"Are you sure "+
  713.           "you want to remove the Adapter."
  714.  
  715. [Source Media Descriptions]
  716.     1  = "VT82C580"  , TAGFILE = vtdisk
  717.  
  718. [Files-ScsiMiniportDrivers]
  719. viadsk = 1 , viadsk.sys , SIZE=999
  720.