home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 August / VPR9708B.ISO / BIOS / free / 686 / bmeide.exe / BMIDE_NT.EXE / PIIXDRV.Z / OEMSETUP.INF < prev    next >
INI File  |  1996-12-20  |  18KB  |  472 lines

  1. ;;/*++
  2. ;;
  3. ;;Copyright:    (c) 1996, Intel Corporation
  4. ;;
  5. ;;File Name:    oemsetup.inf
  6. ;;
  7. ;;Abstract:     Device Information File (INF) for the PIIX Bus Master IDE 
  8. ;;              device driver for Windows NT* 3.5x and 4.x.
  9. ;;
  10. ;;Environment:  Windows NT* 3.5x, 4.x
  11. ;;
  12. ;;Notes:        
  13. ;;
  14. ;;Items in file:
  15. ;;
  16. ;;Revision History:
  17. ;;    07 Jun, 1996  Created the file.
  18. ;;    30 Aug, 1996  Added checks to make the file compatible 3.5x and 4.x.
  19. ;;--*/
  20. [Identification]
  21.     OptionType = SCSI
  22. [MiniportDrivers]
  23.     piixide    = !SERVICE_KERNEL_DRIVER, "SCSI Miniport", !SERVICE_ERROR_NORMAL, 25, %SystemRoot%\System32\IoLogMsg.dll , 7
  24. [Identify]
  25.     read-syms Identification
  26.     set Status     = STATUS_SUCCESSFUL
  27.     set Identifier = $(OptionType)
  28.     set Media      = #("Source Media Descriptions", 1, 1)
  29.     Return $(Status) $(Identifier) $(Media)
  30. [ReturnOptions]
  31.     set Status        = STATUS_FAILED
  32.     set OptionList     = {}
  33.     set OptionTextList = {}
  34.     set LanguageList = ^(LanguagesSupported, 1)
  35.     Ifcontains(i) $($0) in $(LanguageList)
  36.         goto returnoptions
  37.     else
  38.         set Status = STATUS_NOLANGUAGE
  39.         goto finish_ReturnOptions
  40.     endif
  41. returnoptions = +
  42.     set OptionList     = ^(Options, 0)
  43.     set OptionTextList = ^(OptionsText$($0), 1)
  44.     set Status         = STATUS_SUCCESSFUL
  45. finish_ReturnOptions = +
  46.     Return $(Status) $(OptionList) $(OptionTextList)
  47. [InstallOption]
  48.     set Status = STATUS_FAILED
  49.     set DrivesToFree = {}
  50.     set Option   = $($1)
  51.     set SrcDir   = $($2)
  52.     set AddCopy  = $($3)
  53.     set DoCopy   = $($4)
  54.     set DoConfig = $($5)
  55.     set LanguageList = ^(LanguagesSupported, 1)
  56.     Ifcontains(i) $($0) in $(LanguageList)
  57.     else
  58.         set Status = STATUS_NOLANGUAGE
  59.         goto finish_InstallOption
  60.     endif
  61.     read-syms Strings$($0)
  62.     set OptionList = ^(Options, 0)
  63.     ifcontains $(Option) in $(OptionList)
  64.     else
  65.         Debug-Output "OEMSETUP.INF: SCSI option is not supported."
  66.         goto finish_InstallOption
  67.     endif
  68.     set OptionList = ""
  69.     set MiniportDriver   =   #(Options,         $(Option),         1)
  70.     set Type             = $(#(MiniportDrivers, $(MiniportDriver), 1))
  71.     set Group            =   #(MiniportDrivers, $(MiniportDriver), 2)
  72.     set ErrorControl     = $(#(MiniportDrivers, $(MiniportDriver), 3))
  73.     set Tag              =   #(MiniportDrivers, $(MiniportDriver), 4)
  74.     set EventMessageFile =   #(MiniportDrivers, $(MiniportDriver), 5)
  75.     set TypesSupported   =   #(MiniportDrivers, $(MiniportDriver), 6)
  76.     set Start            =   $(!SERVICE_BOOT_START)
  77. installtheoption = +
  78.     ifstr(i) $(AddCopy) == "YES"
  79.         set DoActualCopy = NO
  80.         set FileToCheck = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  81.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
  82.         ifstr(i) $(STATUS) == NO
  83.             set DoActualCopy = YES
  84.         endif
  85.         ifstr(i) $(DoActualCopy) == NO
  86.             shell "subroutn.inf" DriversExist $($0) $(String1)
  87.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  88.                 Debug-Output "OEMSETUP.INF: shelling DriversExist failed"
  89.                 goto finish_InstallOption
  90.             endif
  91.             ifstr(i) $($R0) == STATUS_CURRENT
  92.             else-ifstr(i) $($R0) == STATUS_NEW
  93.                 set DoActualCopy = YES
  94.             else-ifstr(i) $($R0) == STATUS_USERCANCEL
  95.                 Debug-Output "OEMSETUP.INF: User cancelled SCSI installation"
  96.                 goto finish_InstallOption
  97.             else
  98.                 Debug-Output "OEMSETUP.INF: Error reported in DriversExist routine in SUBROUTN.INF"
  99.                 goto finish_InstallOption
  100.             endif
  101.         endif
  102.         ifstr(i) $(DoActualCopy) == YES
  103.             shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
  104.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  105.                 Debug-Output "OEMSETUP.INF: shelling DoAskSourceEx failed"
  106.                 goto finish_InstallOption
  107.             endif
  108.             ifstr(i) $($R0) == STATUS_SUCCESSFUL
  109.                 set SrcDir = $($R1)
  110.                 ifstr(i) $($R2) != ""
  111.                     set DrivesToFree = >($(DrivesToFree), $($R2))
  112.                 endif
  113.             else
  114.                 Debug-Output "OEMSETUP.INF: User cancelled asking source."
  115.                 goto finish_InstallOption
  116.             endif
  117.             install Install-AddCopyOption
  118.             ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  119.                 Debug-Output "Adding SCSI files to copy list failed"
  120.                 goto finish_InstallOption
  121.             endif
  122.         else
  123.             set DoCopy = NO
  124.         endif
  125.     endif
  126.     ifstr(i) $(DoCopy) == "YES"
  127.         read-syms ProgressCopy$($0)
  128.         install Install-DoCopyOption
  129.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  130.             Debug-Output "Copying files failed"
  131.             goto finish_InstallOption
  132.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  133.             set Status = STATUS_USERCANCEL
  134.             goto finish_InstallOption
  135.         endif
  136.     endif
  137.     ifstr(i) $(DoConfig) == "YES"
  138.         shell "registry.inf" CheckSetupModify
  139.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  140.             goto finish_InstallOption
  141.         endif
  142.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  143.             goto finish_InstallOption
  144.         endif
  145.         set ServiceNode   = $(MiniportDriver)
  146.         set ServiceBinary = System32\drivers\#(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  147.         set ServicesValues   = { +
  148.                 {Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
  149.                 {Start,          0, $(!REG_VT_DWORD),     $(Start)                 }, +
  150.                 {Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
  151.                 {ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
  152.                 {Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
  153.                 {BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }  +
  154.                 }
  155. ;*****************
  156. ;* PIIXIDE BEGIN *
  157. ;*****************
  158.         set ParametersValues = { +
  159.                 {UseLbaMode,          0, $(!REG_VT_DWORD), 4294967295} +
  160.                 {UseMultiBlock,       0, $(!REG_VT_DWORD), 4294967295} +
  161.                 {PrimaryMasterMode,   0, $(!REG_VT_DWORD), 4294967295} +
  162.                 {PrimarySlaveMode,    0, $(!REG_VT_DWORD), 4294967295} +
  163.                 {SecondaryMasterMode, 0, $(!REG_VT_DWORD), 4294967295} +
  164.                 {SecondarySlaveMode,  0, $(!REG_VT_DWORD), 4294967295} +
  165.                 {AutoConfiguration,   0, $(!REG_VT_DWORD), 4294967295} +    
  166.                 }
  167. ;*****************
  168. ;* PIIXIDE END   *
  169. ;*****************
  170.  
  171.         set DeviceValues     = {}
  172.         set EventLogValues   = { +
  173.                 {EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
  174.                 {TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
  175.                 }
  176.         shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  177.                                                 $(ServicesValues)   +
  178.                                                 $(ParametersValues) +
  179.  
  180.                                                 $(DeviceValues)     +
  181.                                                 $(EventLogValues)   +
  182.                                                 Parameters
  183.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  184.             Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
  185.             goto finish_InstallOption
  186.         endif
  187.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  188.             Debug-Output "MakeServicesEntry failed for SCSI"
  189.             goto finish_InstallOption
  190.         endif
  191.         ; now check for version of NT
  192.         ;
  193.         set NT_REL = "NT_40"
  194.         ; now look in HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion and check for 4.0/3.5X
  195.         set NTReleaseKey = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
  196.         OpenRegKey $(!REG_H_LOCAL) "" $(NTReleaseKey) $(!REG_KEY_QUERY_VALUE) CurVerHandle
  197.         
  198.         ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  199.            shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS "couldn't open registry key handle"
  200.         endif
  201.         GetRegValue $(CurVerHandle) CurrentVersion VersionValue 
  202.         ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  203.            shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS "couldn't get key value"
  204.         endif
  205.         
  206.         set NTOutput = *($(VersionValue),4)
  207.         
  208.  
  209.         ifstr(i) $(NTOutput) == "4.0"
  210.            shell "registry.inf" ModifyServicesEntry disk $(!SERVICE_BOOT_START)
  211. ;           shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS $(NTOutput) 
  212.         else-ifstr(i) $(NTOutput) == "3.51"
  213.            shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  214. ;           shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS $(NTOutput) 
  215.         else-ifstr(i) $(NTOutput) == "3.50"
  216.            shell "registry.inf" ModifyServicesEntry scsidisk $(!SERVICE_BOOT_START)
  217. ;           shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS $(NTOutput) 
  218.         else
  219.            shell "registry.inf" ModifyServicesEntry disk $(!SERVICE_BOOT_START)
  220. ;           shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) STATUS $(NTOutput) 
  221.         endif
  222.  
  223.  
  224.  
  225. ;*****************
  226. ;* PIIXIDE BEGIN *
  227. ;*****************
  228.         shell "registry.inf" GetServicesEntryStart "ATDISK"
  229.         ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  230.             set Status = STATUS_SUCCESSFUL
  231.             goto finish_InstallOption
  232.         endif
  233.  
  234.         shell "registry.inf" RemoveServicesEntry "ATDISK"
  235.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  236.             Debug-Output "OEMSETUP.INF: Failed to shell RemoveServicesEntry"
  237.             goto finish_InstallOption
  238.         endif
  239.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  240.             Debug-Output "OEMSETUP.INF: Failed to disable services entry"
  241.             goto finish_InstallOption
  242.         endif
  243.  
  244.         shell "registry.inf" GetServicesEntryStart "ATAPI"
  245.         ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  246.             set Status = STATUS_SUCCESSFUL
  247.             goto finish_InstallOption
  248.         endif
  249.  
  250.         shell "registry.inf" RemoveServicesEntry "ATAPI"
  251.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  252.             Debug-Output "OEMSETUP.INF: Failed to shell RemoveServicesEntry"
  253.             goto finish_InstallOption
  254.         endif
  255.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  256.             Debug-Output "OEMSETUP.INF: Failed to disable services entry"
  257.             goto finish_InstallOption
  258.         endif
  259. ;*****************
  260. ;* PIIXIDE END   *
  261. ;*****************
  262.     endif
  263.     set Status = STATUS_SUCCESSFUL
  264. finish_InstallOption = +
  265.     ForListDo $(DrivesToFree)
  266.         LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  267.     EndForListDo
  268.     Return $(Status)
  269. [Install-AddCopyOption]
  270.     AddSectionKeyFileToCopyList   Files-ScsiMiniportDrivers         +
  271.                                   $(MiniportDriver)                 +
  272.                                   $(SrcDir)                      +
  273.                                   $(!STF_WINDOWSSYSPATH)\drivers
  274.     exit
  275. [Install-DoCopyOption]
  276.     CopyFilesInCopyList
  277.     exit
  278. [DeInstallOption]
  279.     set Status   = STATUS_FAILED
  280.     set Option   = $($1)
  281.     set LanguageList = ^(LanguagesSupported, 1)
  282.     Ifcontains(i) $($0) in $(LanguageList)
  283.     else
  284.         set Status = STATUS_NOLANGUAGE
  285.         goto finish_DeInstallOption
  286.     endif
  287.     read-syms Strings$($0)
  288.     set OptionList = ^(Options, 0)
  289.     ifcontains $(Option) in $(OptionList)
  290.     else
  291.         goto finish_DeInstallOption
  292.     endif
  293.     set OptionList = ""
  294.     set MiniportDriver = #(Options, $(Option), 1)
  295.     set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  296.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  297.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  298.     ifstr(i) $(STATUS) == "NO"
  299.         set Status = STATUS_SUCCESSFUL
  300.         goto finish_DeInstallOption
  301.     endif
  302.     shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  303.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  304.         set Status = STATUS_SUCCESSFUL
  305.         goto finish_DeInstallOption
  306.     endif
  307. do_removal =+
  308.     shell "registry.inf" RemoveServicesEntry $(MiniportDriver)
  309.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  310.         Debug-Output "OEMSETUP.INF: Failed to shell RemoveServicesEntry"
  311.         goto finish_DeInstallOption
  312.     endif
  313.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  314.         Debug-Output "OEMSETUP.INF: Failed to disable services entry"
  315.         goto finish_DeInstallOption
  316.     endif
  317.     set Status = STATUS_SUCCESSFUL
  318. ;*****************
  319. ;* PIIXIDE BEGIN *
  320. ;*****************
  321.     ;
  322.     ; Determine the current driver configuration: depending on the configuration
  323.     ; re-enable the appropiate default driver.
  324.     ;
  325.     shell "" GetParameterValue $(MiniportDriver) "AtapiOnPrimary"
  326.     set AtapiOnPrimary = $($R1)
  327.  
  328.     shell "" GetParameterValue $(MiniportDriver) "AtapiOnSecondary"
  329.     set AtapiOnSecondary = $($R1)
  330.  
  331.     ;
  332.     ; turn on Atdisk and/or Atapi again
  333.     ; values of AtapiOnPrimary and AtapiOnSecondary:
  334.     ;   0       - only disk, no atapi
  335.     ;   1       - atapi exists
  336.     ;   others  - no any disk and atapi
  337.     ;
  338.  
  339.     ifint $(AtapiOnPrimary) == "0"
  340.         shell "registry.inf" ModifyServicesEntry "Atdisk" $(!SERVICE_BOOT_START)
  341.         ifint $(AtapiOnSecondary) == "1"
  342.             shell "registry.inf" ModifyServicesEntry "Atapi" $(!SERVICE_BOOT_START)
  343.         endif
  344.         goto finish_DeInstallOption
  345.     endif
  346.  
  347.     ifint $(AtapiOnPrimary) == "1"
  348.         shell "registry.inf" ModifyServicesEntry "Atapi" $(!SERVICE_BOOT_START)
  349.         ifint $(AtapiOnSecondary) == "0"
  350.             shell "registry.inf" ModifyServicesEntry "Atdisk" $(!SERVICE_BOOT_START)
  351.         endif
  352.         goto finish_DeInstallOption
  353.     endif
  354.  
  355.     ifint $(AtapiOnSecondary) == "0"
  356.         shell "registry.inf" ModifyServicesEntry "Atdisk" $(!SERVICE_BOOT_START)
  357.         goto finish_DeInstallOption
  358.     endif
  359.  
  360.     ifint $(AtapiOnSecondary) == "1"
  361.         shell "registry.inf" ModifyServicesEntry "Atapi" $(!SERVICE_BOOT_START)
  362.         goto finish_DeInstallOption
  363.     endif
  364. ;*****************
  365. ;* PIIXIDE END   *
  366. ;*****************
  367.  
  368. finish_DeInstallOption =+
  369.     return $(Status)
  370.  
  371. ;*****************
  372. ;* PIIXIDE END   *
  373. ;*****************
  374. [GetParameterValue]
  375.     set Status = STATUS_FAILED
  376.     set ParameterValue = ""
  377.  
  378.     ;read-syms RegistryConstants
  379.  
  380.     Debug-Output "Get driver parameter value: "$($0)", "$($1)
  381.  
  382.     set KeyName = "system\"$(!STF_CONTROLSET)"\services\"$($0)\"Parameters"
  383.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_READ) KeyHandle
  384.  
  385.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  386.         Debug-Output "Couldn't open key for read access"
  387.         goto finish_GetParameterValue
  388.     endif
  389.  
  390.     GetRegValue $(KeyHandle) $($1) ParameterValueList
  391.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  392.         Debug-Output "Couldn't read parameter value"
  393.         CloseRegKey $(KeyHandle)
  394.         goto finish_GetParameterValue
  395.     endif
  396.  
  397.     CloseRegKey $(KeyHandle)
  398.  
  399.     set ParameterValue = *($(ParameterValueList), 4)
  400.     set Status = STATUS_SUCCESSFUL
  401.  
  402. finish_GetParameterValue = +
  403.     Return $(Status) $(ParameterValue)
  404. ;*****************
  405. ;* PIIXIDE END   *
  406. ;*****************
  407.  
  408. [GetInstalledOptions]
  409.     set Status = STATUS_FAILED
  410.     set InstalledOptions = {}
  411.     set InstalledOptionsText = {}
  412.     set LanguageList = ^(LanguagesSupported, 1)
  413.     Ifcontains(i) $($0) in $(LanguageList)
  414.     else
  415.         set Status = STATUS_NOLANGUAGE
  416.         goto finish_GetInstalledOptions
  417.     endif
  418.     set OptionList = ^(Options, 0)
  419.     ForListDo $(OptionList)
  420.         set MiniportDriver = #(Options, $($), 1)
  421.         set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  422.         set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  423.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  424.         ifstr(i) $(STATUS) == "YES"
  425.             shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  426.             ifint $($ShellCode) == $(!SHELL_CODE_OK)
  427.                 ifstr(i) $($R0) == STATUS_SUCCESSFUL
  428.                     ifstr(i) $($R1) != $(!SERVICE_DISABLED)
  429.                         set OptionText = #(OptionsText$($0), $($), 1)
  430.                         set InstalledOptions     = >($(InstalledOptions), $($))
  431.                         set InstalledOptionsText = >($(InstalledOptionsText), $(OptionText))
  432.                     endif
  433.                 endif
  434.             endif
  435.         endif
  436.     EndForListDo
  437.     set Status = STATUS_SUCCESSFUL
  438. finish_GetInstalledOptions =+
  439.     Return $(Status) $(InstalledOptions) $(InstalledOptionsText)
  440. [Source Media Descriptions]
  441.     1 = "" , TAGFILE = disk1.nt
  442. [Signature]
  443.     FileType = MICROSOFT_FILE
  444. [GetSignature]
  445.     read-syms Signature
  446.     return $(FileType)
  447. [ProductType]
  448. STF_PRODUCT  = Winnt
  449. STF_PLATFORM = I386
  450. [Files-ScsiMiniportDrivers]
  451. piixide = 1, PIIXIDE.SYS , SIZE=999
  452. [LanguagesSupported]
  453.     ENG
  454. [OptionsTextENG]
  455.     "PIIXIDE"      = "Intel PIIX PCI Bus Master IDE Controller"
  456. [Options]
  457.     "PIIXIDE"      = piixide
  458. [ProgressCopyENG]
  459.     ProCaption   = "Windows NT Setup"
  460.     ProCancel    = "Cancel"
  461.     ProCancelMsg = "Windows NT is not correctly installed.  Are you sure you want "+
  462.                    "to cancel copying files?"
  463.     ProCancelCap = "Setup Message"
  464.     ProText1     = "Copying:"
  465.     ProText2     = "To:"
  466. [StringsENG]
  467.     String1 = "SCSI Adapter"
  468.     String2 = "Setup needs to copy SCSI driver files."$(!LF)$(!LF)+
  469.               "Setup will look for the files in the location specified below. If you want "+
  470.               "Setup to look in a different place, type the new location. When the location "+
  471.               "is correct, click Continue."
  472.