home *** CD-ROM | disk | FTP | other *** search
/ Media Gallery 1996 January / MG_0196.ISO / spea / install / stplus / nt / oemsetup.inf < prev    next >
INI File  |  1995-02-06  |  18KB  |  550 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, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  8. ;-----------------------------------------------------------------------
  9.  
  10. [Identification]
  11.     OptionType = VIDEO
  12.  
  13. ;-----------------------------------------------------------------------
  14. ; LANGUAGES SUPPORTED
  15. ; -------------------
  16. ;
  17. ; The languages supported by the OEM 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. ; OPTION LIST
  28. ; -----------
  29. ; This section lists the OEM Option key names.  These keys are locale
  30. ; independent and used to represent the option in a locale independent
  31. ; manner.
  32. ;
  33. ;-----------------------------------------------------------------------
  34.  
  35. ;
  36. ; Option list order: Option = Miniport driver, BitsPerPel, XResolution, YResolution, VRefresh, Interlaced
  37. ;
  38. ; If you don't want to create a VRefresh or Interlaced value under the service
  39. ; parameters then use the value ""
  40. ;
  41.  
  42. [Options]
  43.    "Tseng Labs Accelerated W32" = w32
  44.  
  45. ;
  46. ; This maps detected options into the options we support
  47. ;
  48. ; Format: DetectedOption = MappedOption
  49. ;
  50.  
  51. [MapOfOptions]
  52.     "VGA"                       = "VGA"
  53.     "TSENGLAB VGA ET3000"       = "VGA"
  54.     "TSENGLAB VGA ET4000"       = "TSENGLAB VGA ET4000"
  55. ;
  56. ; Order of the information:
  57. ;
  58. ; Port driver = Type, Group, ErrorControl, Tag, InstalledDisplay, VgaCompatible( 0/1 ), EventMessageFile, TypesSupported
  59. ;
  60.  
  61. [MiniportDrivers]
  62.     w32 = !SERVICE_KERNEL_DRIVER, Video, !SERVICE_ERROR_NORMAL, 11, {w32}, 1 , %SystemRoot%\System32\IoLogMsg.dll , 7
  63.  
  64. ;-----------------------------------------------------------------------
  65. ; OPTION TEXT SECTION
  66. ; -------------------
  67. ; These are text strings used to identify the option to the user.  There
  68. ; are separate sections for each language supported.  The format of the
  69. ; section name is "OptionsText" concatenated with the Language represented
  70. ; by the section.
  71. ;
  72. ;-----------------------------------------------------------------------
  73.  
  74. [OptionsTextENG]
  75.     "Tseng Labs Accelerated W32" = "Tseng Labs Accelerated W32"
  76.  
  77. ;---------------------------------------------------------------------------
  78. ; 1. Identify
  79. ;
  80. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  81. ;                as we are choosing currently.
  82. ;
  83. ; INPUT:         None
  84. ;
  85. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  86. ;                $($R1): Option Type (COMPUTER ...)
  87. ;                $($R2): Diskette description
  88. ;---------------------------------------------------------------------------
  89.  
  90. [Identify]
  91.     ;
  92.     ;
  93.     read-syms Identification
  94.  
  95.     set Status     = STATUS_SUCCESSFUL
  96.     set Identifier = $(OptionType)
  97.     set Media      = #("Source Media Descriptions", 1, 1)
  98.  
  99.     Return $(Status) $(Identifier) $(Media)
  100.  
  101.  
  102.  
  103. ;------------------------------------------------------------------------
  104. ; 2. ReturnOptions:
  105. ;
  106. ; DESCRIPTION:   To return the option list supported by this INF and the
  107. ;                localised text list representing the options.
  108. ;
  109. ;
  110. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  111. ;
  112. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  113. ;                                STATUS_NOLANGUAGE
  114. ;                                STATUS_FAILED
  115. ;
  116. ;                $($R1): Option List
  117. ;                $($R2): Option Text List
  118. ;------------------------------------------------------------------------
  119.  
  120. [ReturnOptions]
  121.     ;
  122.     ;
  123.     set Status        = STATUS_FAILED
  124.     set OptionList     = {}
  125.     set OptionTextList = {}
  126.  
  127.     ;
  128.     ; Check if the language requested is supported
  129.     ;
  130.     set LanguageList = ^(LanguagesSupported, 1)
  131.     Ifcontains(i) $($0) in $(LanguageList)
  132.         goto returnoptions
  133.     else
  134.         set Status = STATUS_NOLANGUAGE
  135.         goto finish_ReturnOptions
  136.     endif
  137.  
  138.     ;
  139.     ; form a list of all the options and another of the text representing
  140.     ;
  141.  
  142. returnoptions = +
  143.     set OptionList     = ^(Options, 0)
  144.     set OptionTextList = ^(OptionsText$($0), 1)
  145.     set Status         = STATUS_SUCCESSFUL
  146.  
  147. finish_ReturnOptions = +
  148.     Return $(Status) $(OptionList) $(OptionTextList)
  149.  
  150.  
  151.  
  152. ;---------------------------------------------------------------------------
  153. ; MapToSupportedOption
  154. ;
  155. ; DESCRIPTION:   To map a hardware detected option to the NT Supported
  156. ;                option which represents it.
  157. ;
  158. ; INPUT:         $($0): Option
  159. ;
  160. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  161. ;                $($R1): Mapped Option
  162. ;
  163. ;---------------------------------------------------------------------------
  164.  
  165. [MapToSupportedOption]
  166.     ;
  167.     set Status = STATUS_FAILED
  168.     set MappedOption = $($0)
  169.  
  170.     ;
  171.     ; If the option is one we can support using one of our standard options
  172.     ; then map it to the standard option else map it to the default option
  173.     ; which is VGA.
  174.     ;
  175.  
  176.     set OptionList = ^(MapOfOptions, 0)
  177.     ifcontains $($0) in $(OptionList)
  178.     Debug-Output "We are setting the option list here."
  179.     set MappedOption = #(MapOfOptions, $($0), 1)
  180.     else
  181.         set MappedOption = "VGA"
  182.     endif
  183.  
  184.     set Status = STATUS_SUCCESSFUL
  185.     Return $(Status) $(MappedOption)
  186.  
  187.  
  188.  
  189. [ServicesEntry]
  190.     CurrentEntry = "" ? $(!LIBHANDLE) GetDevicemapValue Video \Device\Video0
  191.  
  192.  
  193. ;
  194. ; InstallOption:
  195. ;
  196. ; FUNCTION:  To copy files representing Options
  197. ;            To configure the installed option
  198. ;            To update the registry for the installed option
  199. ;
  200. ; INPUT:     $($0):  Language to use
  201. ;            $($1):  OptionID to install
  202. ;            $($2):  SourceDirectory
  203. ;            $($3):  AddCopy  (YES | NO)
  204. ;            $($4):  DoCopy   (YES | NO)
  205. ;            $($5):  DoConfig (YES | NO)
  206. ;
  207. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  208. ;                            STATUS_NOLANGUAGE |
  209. ;                            STATUS_USERCANCEL |
  210. ;                            STATUS_FAILED
  211. ;
  212.  
  213. [InstallOption]
  214.  
  215.     Debug-Output "We are entering Install Option."
  216.  
  217.     ;
  218.     ; Set default values for
  219.     ;
  220.     set Status       = STATUS_FAILED
  221.     set DrivesToFree = {}
  222.  
  223.     ;
  224.     ; extract parameters
  225.     ;
  226.     set Option   = $($1)
  227.     set SrcDir   = $($2)
  228.     set AddCopy  = $($3)
  229.     set DoCopy   = $($4)
  230.     set DoConfig = $($5)
  231.  
  232.     ;
  233.     ; Check if the language requested is supported
  234.     ;
  235.     set LanguageList = ^(LanguagesSupported, 1)
  236.     Ifcontains(i) $($0) in $(LanguageList)
  237.     else
  238.         set Status = STATUS_NOLANGUAGE
  239.         goto finish_InstallOption
  240.     endif
  241.     read-syms Strings$($0)
  242.  
  243.     ;
  244.     ; check to see if Option is supported.
  245.     ;
  246.  
  247.     set OptionList = ^(Options, 0)
  248.     ifcontains $(Option) in $(OptionList)
  249.     else
  250.         goto finish_InstallOption
  251.     endif
  252.     set OptionList = ""
  253.  
  254.     ;
  255.     ; Option has been defined already
  256.     ;
  257.     set MiniportDriver    = #(Options, $(Option), 1)
  258.  
  259.     set Type              = $(#(MiniportDrivers, $(MiniportDriver), 1))
  260.     set Group             =   #(MiniportDrivers, $(MiniportDriver), 2)
  261.     set ErrorControl      = $(#(MiniportDrivers, $(MiniportDriver), 3))
  262.     set Tag               =   #(MiniportDrivers, $(MiniportDriver), 4)
  263.     set InstalledDisplays =   #(MiniportDrivers, $(MiniportDriver), 5)
  264.     set VgaCompatible     =   #(MiniportDrivers, $(MiniportDriver), 6)
  265.     set EventMessageFile  =   #(MiniportDrivers, $(MiniportDriver), 7)
  266.     set TypesSupported    =   #(MiniportDrivers, $(MiniportDriver), 8)
  267.  
  268.     read-syms ServicesEntry
  269.     detect    ServicesEntry
  270.  
  271. installtheoption = +
  272.  
  273.     ;
  274.     ; Code to add files to copy list
  275.     ;
  276.  
  277.     ifstr(i) $(AddCopy) == "YES"
  278.         set DoActualCopy = NO
  279.         set FileToCheck = #(Files-DisplayMiniportDrivers, $(MiniportDriver), 2)
  280.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
  281.         ifstr(i) $(STATUS) == NO
  282.             set DoActualCopy = YES
  283.             goto addfiles
  284.         endif
  285.         ForListDo $(InstalledDisplays)
  286.             set FileToCheck = #(Files-DisplayDLLs, $($), 2)
  287.             LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\"$(FileToCheck)
  288.             ifstr(i) $(STATUS) == NO
  289.                 set DoActualCopy = YES
  290.             endif
  291.         EndForListDo
  292.  
  293. addfiles = +
  294.         ifstr(i) $(DoActualCopy) == NO
  295.             shell "subroutn.inf" DriversExist $($0) $(String1)
  296.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  297.                 Debug-Output "VIDEO.INF: shelling DriversExist failed"
  298.                 goto finish_InstallOption
  299.             endif
  300.  
  301.             ifstr(i) $($R0) == STATUS_CURRENT
  302.             else-ifstr(i) $($R0) == STATUS_NEW
  303.                 set DoActualCopy = YES
  304.             else-ifstr(i) $($R0) == STATUS_USERCANCEL
  305.                 Debug-Output "VIDEO.INF: User cancelled video installation"
  306.                 goto finish_InstallOption
  307.             else
  308.                 Debug-Output "VIDEO.INF: Error reported in DriversExist routine in SUBROUTN.INF"
  309.                 goto finish_InstallOption
  310.             endif
  311.         endif
  312.  
  313.         ifstr(i) $(DoActualCopy) == YES
  314.  
  315.             shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
  316.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  317.                 Debug-Output "VIDEO.INF: shelling DoAskSourceEx failed"
  318.                 goto finish_InstallOption
  319.             endif
  320.  
  321.             ifstr(i) $($R0) == STATUS_SUCCESSFUL
  322.                 set SrcDir = $($R1)
  323.                 ifstr(i) $($R2) != ""
  324.                     set DrivesToFree = >($(DrivesToFree), $($R2))
  325.                 endif
  326.             else
  327.                 Debug-Output "VIDEO.INF: User cancelled asking source."
  328.                 goto finish_InstallOption
  329.             endif
  330.  
  331.             install Install-AddCopyOption
  332.             ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  333.                 Debug-Output "VIDEO.INF: Adding video files to copy list failed"
  334.                 goto finish_InstallOption
  335.             endif
  336.         else
  337.             set DoCopy = NO
  338.         endif
  339.  
  340.     endif
  341.  
  342.     ifstr(i) $(DoCopy) == "YES"
  343.         read-syms ProgressCopy$($0)
  344.         install Install-DoCopyOption
  345.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  346.             Debug-Output "Copying files failed"
  347.             goto finish_InstallOption
  348.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  349.             set Status = STATUS_USERCANCEL
  350.             goto finish_InstallOption
  351.         endif
  352.     endif
  353.  
  354.     ifstr(i) $(DoConfig) == "YES"
  355.  
  356.         ;
  357.         ; first run a privilege check on modifying the setup node
  358.         ;
  359.  
  360.         shell "registry.inf" CheckSetupModify
  361.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  362.             goto finish_InstallOption
  363.         endif
  364.  
  365.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  366.             goto finish_InstallOption
  367.         endif
  368.  
  369.         ;
  370.         ; first make a new video entry, the entry is created automatically
  371.         ; enabled
  372.         ;
  373.  
  374.         set ServiceNode   = $(MiniportDriver)
  375.         set ServiceBinary = %SystemRoot%\System32\drivers\#(Files-DisplayMiniportDrivers, $(MiniportDriver), 2)
  376.  
  377.         set ServicesValues   = { +
  378.                 {Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
  379.                 {Start,          0, $(!REG_VT_DWORD),     $(!SERVICE_SYSTEM_START) }, +
  380.                 {Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
  381.                 {ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
  382.                 {Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
  383.                 {BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }  +
  384.                 }
  385.  
  386.         set ParametersValues = { +
  387.                 {InstalledDisplayDrivers,     0, $(!REG_VT_MULTI_SZ), $(InstalledDisplays) }, +
  388.                 {VgaCompatible,               0, $(!REG_VT_DWORD),    $(VgaCompatible)     }, +
  389.                 {DefaultSettings.BitsPerPel,  0, $(!REG_VT_DWORD),    $(BitsPerPel)        }, +
  390.         {DefaultSettings.VRefresh,    0, $(!REG_VT_DWORD),    $(VRefresh)       }, +
  391.         {DefaultSettings.Interlaced,  0, $(!REG_VT_DWORD),    $(Interlaced)       }, +
  392.         {DefaultSettings.XResolution, 0, $(!REG_VT_DWORD),    $(XResolution)       }, +
  393.                 {DefaultSettings.YResolution, 0, $(!REG_VT_DWORD),    $(YResolution)       }  +
  394.         }
  395.  
  396.         ifstr(i) $(VRefresh) != ""
  397.             set VRefreshValue = {DefaultSettings.VRefresh, 0, $(!REG_VT_DWORD), $(VRefresh)}
  398.             set ParametersValue = >($(ParametersValue), $(VRefreshValue))
  399.         endif
  400.  
  401.         ifstr(i) $(Interlaced) != ""
  402.             set InterlacedValue = {DefaultSettings.Interlaced, 0, $(!REG_VT_DWORD), $(Interlaced)}
  403.             set ParametersValue = >($(ParametersValue), $(InterlacedValue))
  404.         endif
  405.  
  406.         set DeviceValues     = {}
  407.         set EventLogValues   = { +
  408.                 {EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
  409.                 {TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
  410.                 }
  411.  
  412.         shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  413.                                                 $(ServicesValues)   +
  414.                                                 $(ParametersValues) +
  415.                                                 $(DeviceValues)     +
  416.                                                 $(EventLogValues)   +
  417.                                                 Device0
  418.  
  419.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  420.             Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
  421.             goto finish_InstallOption
  422.         endif
  423.  
  424.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  425.             Debug-Output "MakeServicesEntry failed for video"
  426.             goto finish_InstallOption
  427.         endif
  428.  
  429.         ;
  430.         ;
  431.         ; then disable the previous video entry
  432.         ;
  433.  
  434.         ifstr(i) $(CurrentEntry) != $(MiniportDriver)
  435.             ifstr(i) $(CurrentEntry) != VGA
  436.                 ifstr(i) $(CurrentEntry) != ""
  437.                     shell "registry.inf" ModifyServicesEntry $(CurrentEntry) $(!SERVICE_DISABLED)
  438.  
  439.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  440.                         Debug-Output "Couldn't find DisableServicesEntry in registry.inf"
  441.                         goto errorconfig
  442.                     endif
  443.  
  444.                     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  445.                         Debug-Output "DisableServices entry failed"
  446.                     endif
  447.                 endif
  448.             endif
  449.         endif
  450.  
  451.         goto configdone
  452.  
  453. errorconfig = +
  454.         ifstr(i) $(CurrentEntry) != $(MiniportDriver)
  455.             shell "registry.inf" ModifyServicesEntry $(MiniportDriver) $(!SERVICE_DISABLED)
  456.             ifstr(i) $(CurrentEntry) != ""
  457.                 shell "registry.inf" ModifyServicesEntry $(CurrentEntry) $(!SERVICE_SYSTEM_START)
  458.             endif
  459.         endif
  460.         goto finish_InstallOption
  461.  
  462. configdone = +
  463.  
  464.     endif
  465.  
  466.     set Status = STATUS_SUCCESSFUL
  467.  
  468. finish_InstallOption = +
  469.     ForListDo $(DrivesToFree)
  470.         LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  471.     EndForListDo
  472.  
  473.     Return $(Status)
  474.  
  475.  
  476. [Install-AddCopyOption]
  477.  
  478.     set STF_VITAL = ""
  479.     ;
  480.     ; Add the files to the copy list
  481.     ;
  482.     AddSectionKeyFileToCopyList   Files-DisplayMiniportDrivers   +
  483.                                   $(MiniportDriver)              +
  484.                                   $(SrcDir)                      +
  485.                                   $(!STF_WINDOWSSYSPATH)\drivers
  486.  
  487.     ForListDo $(InstalledDisplays)
  488.         AddSectionKeyFileToCopyList   Files-DisplayDLLs          +
  489.                                       $($)                       +
  490.                                       $(SrcDir)                  +
  491.                                       $(!STF_WINDOWSSYSPATH)
  492.  
  493.     EndForListDo
  494.  
  495.     exit
  496.  
  497.  
  498. [Install-DoCopyOption]
  499.  
  500.     ;
  501.     ; Copy files in the copy list
  502.     ;
  503.     CopyFilesInCopyList
  504.     exit
  505.  
  506. ;**************************************************************************
  507. ; PROGRESS GUAGE VARIABLES
  508. ;**************************************************************************
  509.  
  510. [ProgressCopyENG]
  511.     ProCaption   = "Windows NT Setup"
  512.     ProCancel    = "Cancel"
  513.     ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
  514.                    "to cancel copying files?"
  515.     ProCancelCap = "Setup Message"
  516.     ProText1     = "Copying:"
  517.     ProText2     = "To:"
  518.  
  519. [StringsENG]
  520.     String1 = "Display"
  521.     String2 = "Please enter the full path to the OEM Display "+
  522.               "driver files.  Then choose Continue."
  523.  
  524. ;-----------------------------------------------------------------------
  525. ; SOURCE MEDIA DESCRIPTIONS
  526. ; -------------------------
  527. ; The OEM should list all the diskette labels here.  The source media
  528. ; description is used during copy to prompt the user for a diskette
  529. ; if the source is diskettes.
  530. ;
  531. ; Use 1 = "Diskette 1 Label" , TAGFILE = disk1
  532. ;     2 = "Diskette 2 Label" , TAGFILE = disk2
  533. ;     ...
  534. ;-----------------------------------------------------------------------
  535.  
  536. ;--------------------------------------------------------------------
  537. ; THE SECTIONS BELOW SHOULD BE AUTOMATICALLY GENERATED BY THE EXCEL
  538. ; SPREAD SHEETS
  539. ;--------------------------------------------------------------------
  540.  
  541. [Source Media Descriptions]
  542.     1  = "TsengLabsSETUP (VIDEO)", TAGFILE = tseng1
  543.  
  544. [Files-DisplayDLLs]
  545. w32 = 1,w32.dll , SIZE=999
  546.  
  547. [Files-DisplayMiniportDrivers]
  548. w32 = 1,w32.sys , SIZE=999
  549. 
  550.