home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 November / CDVD1105.ISO / Util / Drivere / Via / VIAHyperion4in1456v / WINNT / VIAIDE.INF < prev   
INI File  |  2005-06-06  |  22KB  |  725 lines

  1.  
  2. ;-----------------------------------------------------------------------
  3. ; OPTION TYPE
  4. ; -----------
  5. ; This identifies the Option type we are dealing with.  The different
  6. ; possible types are:
  7. ;
  8. ; COMPUTER, VIDEO, POINTER, KEYBOARD, LAYOUT, SCSI, TAPE, PRINTER, ...
  9. ;-----------------------------------------------------------------------
  10.  
  11. [Identification]
  12.     OptionType = SCSI
  13.  
  14. ;-----------------------------------------------------------------------
  15. ; LANGUAGES SUPPORTED
  16. ; -------------------
  17. ;
  18. ; The languages supported by the INF, For every language supported
  19. ; we need to have a separate text section for every displayable text
  20. ; section.
  21. ;
  22. ;-----------------------------------------------------------------------
  23.  
  24. [LanguagesSupported]
  25.     ENG
  26.  
  27.  
  28. ;-----------------------------------------------------------------------
  29. ; OPTION LIST
  30. ; -----------
  31. ; This section lists the Option key names.  These keys are locale
  32. ; independent and used to represent the option in a locale independent
  33. ; manner.
  34. ;
  35. ;-----------------------------------------------------------------------
  36.  
  37. [Options]
  38.     "VIADSK"    = viadsk
  39.  
  40. ;-----------------------------------------------------------------------
  41. ; OPTION TEXT SECTION
  42. ; -------------------
  43. ; These are text strings used to identify the option to the user.  There
  44. ; are separate sections for each language supported.  The format of the
  45. ; section name is "OptionsText" concatenated with the Language represented
  46. ; by the section.
  47. ;
  48. ;-----------------------------------------------------------------------
  49.  
  50. [OptionsTextENG]
  51.     "VIADSK"    = "VIA bus master IDE drivers"
  52.  
  53.  
  54. ;-----------------------------------------------------------------------------------------
  55. ; SCSI MINIPORT DRIVERS:
  56. ;
  57. ; Order of the information:
  58. ;
  59. ; Class driver = Type, Group, ErrorControl, Tag, EventMessageFile, TypesSupported
  60. ;
  61. ;-----------------------------------------------------------------------------------------
  62.  
  63. [MiniportDrivers]
  64.     viadsk  = !SERVICE_KERNEL_DRIVER, "SCSI Miniport", !SERVICE_ERROR_NORMAL,  17, %SystemRoot%\System32\IoLogMsg.dll , 7
  65.  
  66. ;---------------------------------------------------------------------------
  67. ; 1. Identify
  68. ;
  69. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  70. ;                as we are choosing currently.
  71. ;
  72. ; INPUT:         None
  73. ;
  74. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  75. ;                $($R1): Option Type (COMPUTER ...)
  76. ;                $($R2): Diskette description
  77. ;---------------------------------------------------------------------------
  78.  
  79. [Identify]
  80.     ;
  81.     ;
  82.     read-syms Identification
  83.  
  84.     set Status     = STATUS_SUCCESSFUL
  85.     set Identifier = $(OptionType)
  86.     set Media      = #("Source Media Descriptions", 1, 1)
  87.  
  88.     Return $(Status) $(Identifier) $(Media)
  89.  
  90.  
  91.  
  92. ;------------------------------------------------------------------------
  93. ; 2. ReturnOptions:
  94. ;
  95. ; DESCRIPTION:   To return the option list supported by this INF and the
  96. ;                localised text list representing the options.
  97. ;
  98. ;
  99. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  100. ;
  101. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  102. ;                                STATUS_NOLANGUAGE
  103. ;                                STATUS_FAILED
  104. ;
  105. ;                $($R1): Option List
  106. ;                $($R2): Option Text List
  107. ;------------------------------------------------------------------------
  108.  
  109. [ReturnOptions]
  110.     ;
  111.     ;
  112.     set Status        = STATUS_FAILED
  113.     set OptionList     = {}
  114.     set OptionTextList = {}
  115.  
  116.     ;
  117.     ; Check if the language requested is supported
  118.     ;
  119.     set LanguageList = ^(LanguagesSupported, 1)
  120.     Ifcontains(i) $($0) in $(LanguageList)
  121.     goto returnoptions
  122.     else
  123.     set Status = STATUS_NOLANGUAGE
  124.     goto finish_ReturnOptions
  125.     endif
  126.  
  127.     ;
  128.     ; form a list of all the options and another of the text representing
  129.     ;
  130.  
  131. returnoptions = +
  132.     set OptionList     = ^(Options, 0)
  133.     set OptionTextList = ^(OptionsText$($0), 1)
  134.     set Status         = STATUS_SUCCESSFUL
  135.  
  136. finish_ReturnOptions = +
  137.     Return $(Status) $(OptionList) $(OptionTextList)
  138.  
  139.  
  140. ;
  141. ; 3. InstallOption:
  142. ;
  143. ; FUNCTION:  To copy files representing Options
  144. ;            To configure the installed option
  145. ;            To update the registry for the installed option
  146. ;
  147. ; INPUT:     $($0):  Language to use
  148. ;            $($1):  OptionID to install
  149. ;            $($2):  SourceDirectory
  150. ;            $($3):  AddCopy  (YES | NO)
  151. ;            $($4):  DoCopy   (YES | NO)
  152. ;            $($5):  DoConfig (YES | NO)
  153. ;
  154. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  155. ;                            STATUS_NOLANGUAGE |
  156. ;                            STATUS_USERCANCEL |
  157. ;                            STATUS_FAILED
  158. ;
  159.  
  160. [InstallOption]
  161.  
  162.     ;
  163.     ; Set parameters for VIA IDE
  164.     ;
  165.     set SndChIRQ        = 15
  166.     set Disk0_DMA_Time  = 120
  167.     set Disk0_PIO_Time  = 120
  168.     set Disk0_DMA_Mode  = 1
  169.     set Disk0_Blk_Size  = 16 
  170.     set Disk1_DMA_Time  = 0
  171.     set Disk1_PIO_Time  = 0
  172.     set Disk1_DMA_Mode  = 1
  173.     set Disk1_Blk_Size  = 0
  174.     set Disk2_DMA_Time  = 0
  175.     set Disk2_PIO_Time  = 0
  176.     set Disk2_DMA_Mode  = 1
  177.     set Disk2_Blk_Size  = 0
  178.     set Disk3_DMA_Time  = 0
  179.     set Disk3_PIO_Time  = 0
  180.     set Disk3_DMA_Mode  = 1
  181.     set Disk3_Blk_Size  = 0
  182.  
  183.     ;
  184.     ; Delete VIAIDE service key to modify parameters
  185.     ;
  186.     shell "utility.inf" RemoveService viaide "NO"
  187.  
  188.     ;
  189.     ; Set default values for
  190.     ;
  191.     set Status = STATUS_FAILED
  192.     set DrivesToFree = {}
  193.  
  194.     ;
  195.     ; extract parameters
  196.     ;
  197.     set Option   = $($1)
  198.     set SrcDir   = $($2)
  199.     set AddCopy  = $($3)
  200.     set DoCopy   = $($4)
  201.     set DoConfig = $($5)
  202.  
  203.     ;
  204.     ; Check if the language requested is supported
  205.     ;
  206.     set LanguageList = ^(LanguagesSupported, 1)
  207.     Ifcontains(i) $($0) in $(LanguageList)
  208.     else
  209.     set Status = STATUS_NOLANGUAGE
  210.     goto finish_InstallOption
  211.     endif
  212.     read-syms Strings$($0)
  213.  
  214.     ;
  215.     ; check to see if Option is supported.
  216.     ;
  217.  
  218.     set OptionList = ^(Options, 0)
  219.     ifcontains $(Option) in $(OptionList)
  220.     else
  221.     Debug-Output "SCSI.INF: SCSI option is not supported."
  222.     goto finish_InstallOption
  223.     endif
  224.     set OptionList = ""
  225.  
  226.     ;
  227.     ; Option has been defined already
  228.     ;
  229.  
  230.     set MiniportDriver   =   #(Options,         $(Option),         1)
  231.     set Type             = $(#(MiniportDrivers, $(MiniportDriver), 1))
  232.     set Group            =   #(MiniportDrivers, $(MiniportDriver), 2)
  233.     set ErrorControl     = $(#(MiniportDrivers, $(MiniportDriver), 3))
  234.     set Tag              =   #(MiniportDrivers, $(MiniportDriver), 4)
  235.     set EventMessageFile =   #(MiniportDrivers, $(MiniportDriver), 5)
  236.     set TypesSupported   =   #(MiniportDrivers, $(MiniportDriver), 6)
  237.  
  238.     set Start            =   $(!SERVICE_BOOT_START)
  239.  
  240.     set ReferenceBIOS    = 0;
  241.     ; ReferenceBIOS is a flag for specified customer used.
  242.  
  243. installtheoption = +
  244.  
  245.     ;
  246.     ; Code to add files to copy list
  247.     ;
  248.  
  249. ;hc01_s
  250. ;*set AddCopy = NO
  251. ;hc01_e
  252.  
  253.     ifstr(i) $(AddCopy) == "YES"
  254.     set DoActualCopy = NO
  255.     set FileToCheck = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  256.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
  257.     ifstr(i) $(STATUS) == NO
  258.         set DoActualCopy = YES
  259.     endif
  260.  
  261.     ifstr(i) $(DoActualCopy) == NO
  262.         shell "subroutn.inf" DriversExist $($0) $(String1)
  263.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  264.         Debug-Output "SCSI.INF: shelling DriversExist failed"
  265.         goto finish_InstallOption
  266.         endif
  267.  
  268.         ifstr(i) $($R0) == STATUS_CURRENT
  269.         else-ifstr(i) $($R0) == STATUS_NEW
  270.         set DoActualCopy = YES
  271.         else-ifstr(i) $($R0) == STATUS_USERCANCEL
  272.         Debug-Output "SCSI.INF: User cancelled SCSI installation"
  273.         goto finish_InstallOption
  274.         else
  275.         Debug-Output "SCSI.INF: Error reported in DriversExist routine in SUBROUTN.INF"
  276.         goto finish_InstallOption
  277.         endif
  278.     endif
  279.  
  280.     ifstr(i) $(DoActualCopy) == YES
  281.  
  282.         shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
  283.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  284.         Debug-Output "SCSI.INF: shelling DoAskSourceEx failed"
  285.         goto finish_InstallOption
  286.         endif
  287.  
  288.         ifstr(i) $($R0) == STATUS_SUCCESSFUL
  289.         set SrcDir = $($R1)
  290.         ifstr(i) $($R2) != ""
  291.             set DrivesToFree = >($(DrivesToFree), $($R2))
  292.         endif
  293.         else
  294.         Debug-Output "SCSI.INF: User cancelled asking source."
  295.         goto finish_InstallOption
  296.         endif
  297.  
  298.         install Install-AddCopyOption
  299.         ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  300.         Debug-Output "Adding SCSI files to copy list failed"
  301.         goto finish_InstallOption
  302.         endif
  303.     else
  304.         set DoCopy = NO
  305.     endif
  306.  
  307.     endif
  308.  
  309. ;hc01_s
  310. ;*set DoCopy = NO
  311. ;hc01_e
  312.  
  313.     ifstr(i) $(DoCopy) == "YES"
  314.     read-syms ProgressCopy$($0)
  315.     install Install-DoCopyOption
  316.     ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  317.         Debug-Output "Copying files failed"
  318.         goto finish_InstallOption
  319.     else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  320.         set Status = STATUS_USERCANCEL
  321.         goto finish_InstallOption
  322.     endif
  323.     endif
  324. ;hc01_s
  325.     set DoConfig = YES
  326. ;hc01_e
  327.  
  328.     ifstr(i) $(DoConfig) == "YES"
  329.     ;
  330.     ; first run a privilege check on modifying the setup node
  331.     ;
  332.  
  333.     shell "registry.inf" CheckSetupModify
  334.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  335.         goto finish_InstallOption
  336.     endif
  337.  
  338.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  339.         goto finish_InstallOption
  340.     endif
  341.  
  342.     ;
  343.     ; then make a new SCSI entry, the entry is created automatically
  344.     ; enabled
  345.     ;
  346.  
  347.     set ServiceNode   = $(MiniportDriver)
  348.     set ServiceBinary = System32\drivers\#(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  349.  
  350.     set ServicesValues   = { +
  351.         {Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
  352.         {Start,          0, $(!REG_VT_DWORD),     $(Start)                 }, +
  353.         {Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
  354.         {ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
  355.         {Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
  356.         {BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }, +
  357.         {ReferenceBIOS,  0, $(!REG_VT_DWORD),     $(ReferenceBIOS)         }, +
  358.         }
  359.  
  360.     set DeviceValues     = {}
  361.     set EventLogValues   = { +
  362.         {EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
  363.         {TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
  364.         }
  365.  
  366.     ;
  367.     ; These parameters will be at
  368.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\SNDCHIRQ
  369.     ;
  370.     set ParametersValues = { +
  371.         {SNDCHIRQ,     0, $(!REG_VT_DWORD),    $(SndChIRQ)  }, +
  372.         }
  373.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  374.                         $(ServicesValues)   +
  375.                         $(ParametersValues) +
  376.                         $(DeviceValues)     +
  377.                         $(EventLogValues)   +
  378.                         SNDCHIRQ
  379.     ;
  380.     ; These parameters will be at
  381.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\Parameters0
  382.     ;
  383. ;HC_02S
  384.     set ParametersValues = { +
  385. ;                {DMA_TIME,     0, $(!REG_VT_DWORD),    $(Disk0_DMA_Time) }, +
  386. ;                {PIO_TIME,     0, $(!REG_VT_DWORD),    $(Disk0_PIO_Time) }, +
  387.         {SET_DMAM,     0, $(!REG_VT_DWORD),    $(Disk0_DMA_Mode) }, +
  388. ;                {BLCKSIZE,     0, $(!REG_VT_DWORD),    $(Disk0_Blk_Size) }, +
  389.            }
  390. ;HC_02E
  391.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  392.                         $(ServicesValues)   +
  393.                         $(ParametersValues) +
  394.                         $(DeviceValues)     +
  395.                         $(EventLogValues)   +
  396.                         Parameters0
  397.     ;
  398.     ; These parameters will be at
  399.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\Parameters1
  400.     ;
  401. ;HC_02S
  402.     set ParametersValues = { +
  403. ;                {DMA_TIME,     0, $(!REG_VT_DWORD),    $(Disk1_DMA_Time) }, +
  404. ;                {PIO_TIME,     0, $(!REG_VT_DWORD),    $(Disk1_PIO_Time) }, +
  405.         {SET_DMAM,     0, $(!REG_VT_DWORD),    $(Disk1_DMA_Mode) }, +
  406. ;                {BLCKSIZE,     0, $(!REG_VT_DWORD),    $(Disk1_Blk_Size) }, +
  407.         }
  408. ;HC_02E
  409.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  410.                         $(ServicesValues)   +
  411.                         $(ParametersValues) +
  412.                         $(DeviceValues)     +
  413.                         $(EventLogValues)   +
  414.                         Parameters1
  415.     ;
  416.     ; These parameters will be at
  417.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\Parameters2
  418.     ;
  419. ;HC_02S
  420.     set ParametersValues = { +
  421. ;                {DMA_TIME,     0, $(!REG_VT_DWORD),    $(Disk2_DMA_Time) }, +
  422. ;                {PIO_TIME,     0, $(!REG_VT_DWORD),    $(Disk2_PIO_Time) }, +
  423.         {SET_DMAM,     0, $(!REG_VT_DWORD),    $(Disk2_DMA_Mode) }, +
  424. ;                {BLCKSIZE,     0, $(!REG_VT_DWORD),    $(Disk2_Blk_Size) }, +
  425.         }
  426. ;HC_02E
  427.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  428.                         $(ServicesValues)   +
  429.                         $(ParametersValues) +
  430.                         $(DeviceValues)     +
  431.                         $(EventLogValues)   +
  432.                         Parameters2
  433.     ;
  434.     ; These parameters will be at
  435.     ;  \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\viadsk\Parameters3
  436.     ;
  437. ;HC_02S
  438.     set ParametersValues = { +
  439. ;                {DMA_TIME,     0, $(!REG_VT_DWORD),    $(Disk3_DMA_Time) }, +
  440. ;                {PIO_TIME,     0, $(!REG_VT_DWORD),    $(Disk3_PIO_Time) }, +
  441.         {SET_DMAM,     0, $(!REG_VT_DWORD),    $(Disk3_DMA_Mode) }, +
  442. ;                {BLCKSIZE,     0, $(!REG_VT_DWORD),    $(Disk3_Blk_Size) }, +
  443.         }
  444. ;HC_02E
  445.     shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  446.                         $(ServicesValues)   +
  447.                         $(ParametersValues) +
  448.                         $(DeviceValues)     +
  449.                         $(EventLogValues)   +
  450.                         Parameters3
  451.  
  452.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  453.         Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
  454.         goto finish_InstallOption
  455.     endif
  456.  
  457.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  458.         Debug-Output "MakeServicesEntry failed for SCSI"
  459.         goto finish_InstallOption
  460.     endif
  461. ;Frank_S
  462.     shell "registry.inf" ModifyServicesEntry atapi $(!SERVICE_DISABLED)
  463.     shell "registry.inf" ModifyServicesEntry atdisk $(!SERVICE_DISABLED)
  464. ;HC03_S
  465.     shell "registry.inf" GetServicesEntryStart "imgatapi"
  466.     ifstr(i) $($R0) == "STATUS_SUCCESSFUL"
  467.     shell "registry.inf" ModifyServicesEntry imgatapi $(!SERVICE_DISABLED)
  468.     endif
  469. ;HC03_E
  470.     set KeyName = "Software\Microsoft\Windows NT\CurrentVersion"
  471.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_READ) KeyHandle
  472.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  473.       Debug-Output "REGISTRY.INF: Couldn't open windows nt software key for read access"
  474.       goto finish_InstallOption
  475.     endif
  476.  
  477.     GetRegValue $(KeyHandle) "CurrentVersion" VerInf
  478.     set NtVer  = *($(VerInf),4)
  479.  
  480. ;        ifstr(i) $(NtVer) == "4.0"
  481. ;          shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  482. ;          shell "registry.inf" ModifyServicesEntry scsicdrm $(!SERVICE_SYSTEM_START)
  483. ;        endif
  484.  
  485.     ifstr(i) $(NtVer) == "3.50"
  486.       shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  487.       shell "registry.inf" ModifyServicesEntry scsicdrm $(!SERVICE_SYSTEM_START)
  488.     endif
  489.     ifstr(i) $(NtVer) == "3.51"
  490.       shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  491.       shell "registry.inf" ModifyServicesEntry scsicdrm $(!SERVICE_SYSTEM_START)
  492.     endif
  493.     CloseRegKey $(KeyHandle)
  494.     ;shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  495.     ;shell "registry.inf" ModifyServicesEntry scsicdrm $(!SERVICE_SYSTEM_START)
  496.     ;shell "registry.inf" ModifyServicesEntry atapi $(!SERVICE_DISABLED)
  497.     ;shell "registry.inf" ModifyServicesEntry atdisk $(!SERVICE_DISABLED)
  498. ;Frank_E
  499.     endif
  500.  
  501.     set Status = STATUS_SUCCESSFUL
  502. finish_InstallOption = +
  503.     ForListDo $(DrivesToFree)
  504.     LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  505.     EndForListDo
  506.  
  507.     Return $(Status)
  508.  
  509.  
  510. [Install-AddCopyOption]
  511.  
  512.     ;
  513.     ; Add the files to the copy list
  514.     ;
  515.     AddSectionKeyFileToCopyList   Files-ScsiMiniportDrivers         +
  516.                   $(MiniportDriver)                 +
  517.                   $(SrcDir)                      +
  518.                   $(!STF_WINDOWSSYSPATH)\drivers
  519.  
  520.     exit
  521.  
  522.  
  523. [Install-DoCopyOption]
  524.  
  525.     ;
  526.     ; Copy files in the copy list
  527.     ;
  528.     CopyFilesInCopyList
  529.     exit
  530.  
  531. ;-------------------------------------------------------------------------
  532. ; 4. DeInstallOption:
  533. ;
  534. ; FUNCTION:  To remove files representing Option
  535. ;            To remove the registry entry corresponding to the Option
  536. ;
  537. ; INPUT:     $($0):  Language to use
  538. ;            $($1):  OptionID to install
  539. ;
  540. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  541. ;                            STATUS_NOLANGUAGE |
  542. ;                            STATUS_USERCANCEL |
  543. ;                            STATUS_FAILED
  544. ;-------------------------------------------------------------------------
  545. [DeInstallOption]
  546.     ;
  547.     ; Set default values for
  548.     ;
  549.     set Status   = STATUS_FAILED
  550.     ;
  551.     ; extract parameters
  552.     ;
  553.     set Option   = $($1)
  554.  
  555.     ;
  556.     ; Check if the language requested is supported
  557.     ;
  558.     set LanguageList = ^(LanguagesSupported, 1)
  559.     Ifcontains(i) $($0) in $(LanguageList)
  560.     else
  561.     set Status = STATUS_NOLANGUAGE
  562.     goto finish_DeInstallOption
  563.     endif
  564.     read-syms Strings$($0)
  565.  
  566.     ;
  567.     ; check to see if Option is supported.
  568.     ;
  569.  
  570.     set OptionList = ^(Options, 0)
  571.     ifcontains $(Option) in $(OptionList)
  572.     else
  573.     goto finish_DeInstallOption
  574.     endif
  575.     set OptionList = ""
  576.  
  577.     ;
  578.     ; fetch details about option
  579.     ;
  580.  
  581.     set MiniportDriver = #(Options, $(Option), 1)
  582.     set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  583.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  584.  
  585.     ;
  586.     ; check to see if file is installed
  587.     ; if not give success
  588.     ;
  589.  
  590.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  591.     ifstr(i) $(STATUS) == "NO"
  592.     set Status = STATUS_SUCCESSFUL
  593.     goto finish_DeInstallOption
  594.     endif
  595.  
  596.     shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  597.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  598.     ; this could happen if there is no start value or there is no
  599.     ; key, in which case the option is not installed
  600.     set Status = STATUS_SUCCESSFUL
  601.     goto finish_DeInstallOption
  602.     endif
  603.  
  604.     ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
  605.     shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(String3)
  606.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  607.         goto do_removal
  608.     endif
  609.     ifstr(i) $($R1) == "CANCEL"
  610.         goto finish_DeInstallOption
  611.     endif
  612.     endif
  613.  
  614. do_removal =+
  615.     ;
  616.     ; disable the registry entry
  617.     ;
  618.  
  619.     shell "registry.inf" RemoveServicesEntry $(MiniportDriver)
  620.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  621.     Debug-Output "SCSI.INF: Failed to shell RemoveServicesEntry"
  622.     goto finish_DeInstallOption
  623.     endif
  624.  
  625.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  626.     Debug-Output "SCSI.INF: Failed to disable services entry"
  627.     goto finish_DeInstallOption
  628.     endif
  629.  
  630.     ;
  631.     ; we won't remove the file because we can only do so during the next boot.
  632.     ; if the user chooses to reinstall the same driver during this boot
  633.     ; he will still end up deleting the driver on next boot. if the file
  634.     ; should be deleted a warning should be put up saying that the user should
  635.     ; not try to reinstall the driver during this boot
  636.     ;
  637.     ;    AddFileToDeleteList $(FilePath)
  638.  
  639.     set Status = STATUS_SUCCESSFUL
  640.  
  641. finish_DeInstallOption =+
  642.     return $(Status)
  643.  
  644.  
  645. ;-------------------------------------------------------------------------
  646. ; 5. GetInstalledOptions:
  647. ;
  648. ; FUNCTION:  To find out the list of options which are installed
  649. ;
  650. ; INPUT:     $($0): Language to Use
  651. ;
  652. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  653. ;                            STATUS_FAILED
  654. ;
  655. ;            $($R1): List of options installed
  656. ;            $($R2): Option installed Text List
  657. ;-------------------------------------------------------------------------
  658. [GetInstalledOptions]
  659.     set Status = STATUS_FAILED
  660.     set InstalledOptions = {}
  661.     set InstalledOptionsText = {}
  662.  
  663.     ;
  664.     ; Check if the language requested is supported
  665.     ;
  666.     set LanguageList = ^(LanguagesSupported, 1)
  667.     Ifcontains(i) $($0) in $(LanguageList)
  668.     else
  669.     set Status = STATUS_NOLANGUAGE
  670.     goto finish_GetInstalledOptions
  671.     endif
  672.  
  673.     set OptionList = ^(Options, 0)
  674.     ForListDo $(OptionList)
  675.     set MiniportDriver = #(Options, $($), 1)
  676.     set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  677.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  678.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  679.     ifstr(i) $(STATUS) == "YES"
  680.         shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  681.         ifint $($ShellCode) == $(!SHELL_CODE_OK)
  682.         ifstr(i) $($R0) == STATUS_SUCCESSFUL
  683.             ifstr(i) $($R1) != $(!SERVICE_DISABLED)
  684.  
  685.             set OptionText = #(OptionsText$($0), $($), 1)
  686.             set InstalledOptions     = >($(InstalledOptions), $($))
  687.             set InstalledOptionsText = >($(InstalledOptionsText), $(OptionText))
  688.  
  689.             endif
  690.         endif
  691.         endif
  692.     endif
  693.     EndForListDo
  694.     set Status = STATUS_SUCCESSFUL
  695. finish_GetInstalledOptions =+
  696.     Return $(Status) $(InstalledOptions) $(InstalledOptionsText)
  697.  
  698.  
  699. ;**************************************************************************
  700. ; PROGRESS GUAGE VARIABLES
  701. ;**************************************************************************
  702.  
  703. [ProgressCopyENG]
  704.     ProCaption   = "Windows NT Setup"
  705.     ProCancel    = "Cancel"
  706.     ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
  707.            "to cancel copying files?"
  708.     ProCancelCap = "Setup Message"
  709.     ProText1     = "Copying:"
  710.     ProText2     = "To:"
  711.  
  712. [StringsENG]
  713.     String1 = "PCI IDE DISK Adapter"
  714.     String2 = "Please enter the full path to the VIA VT82C580 PCI IDE DISK "+
  715.           "Adapter file.  Then choose Continue."
  716.     String3 = "The VT82C580 PCI IDE DISK Adapter has been marked as a boot device.  Removing "+
  717.           "it may cause the system not to boot."$(!LF)$(!LF)"Are you sure "+
  718.           "you want to remove the Adapter."
  719.  
  720. [Source Media Descriptions]
  721.     1  = "VT82C580"  , TAGFILE = vtdisk
  722.  
  723. [Files-ScsiMiniportDrivers]
  724. viadsk = 1 , viadsk.sys , SIZE=999
  725.