home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 December / MICD_2000_12_NR1.iso / Dreamnet / drivery / SMC / 1211.exe / OEMSETUP.INF next >
INI File  |  1999-10-04  |  46KB  |  1,208 lines

  1. ;********************************************************************
  2. ;
  3. ;   The PCI Ethernet miniport driver oemsetup file
  4. ;   for WinNT 3.5x, WinNT 4.0
  5. ;   (NDIS 3.1/NDIS 4.0 driver)
  6. ;
  7. ;********************************************************************
  8.  
  9. [Identification]
  10.     OptionType = NetAdapter
  11.  
  12. [PlatformsSupported]
  13.     PCI
  14.  
  15. [Options]
  16.     SMC1211
  17.  
  18. [FileConstants]
  19.     UtilityInf                  = "UTILITY.INF"
  20.     subroutineinf               = "SUBROUTN.INF"
  21.     SoftwareType                = "driver"
  22.     Exit_Code                   = 0
  23.     NetEventDLL                 = "%SystemRoot%\System32\netevent.dll;%SystemRoot%\System32\drivers\SMC1211.SYS"
  24.     IoLogMsgDLL                 = "%SystemRoot%\System32\IoLogMsg.dll"
  25.  
  26.     Manufacturer                = "SMC"
  27.     ProductMajorVersion         = "01"
  28.     ProductMinorVersion         = "10"
  29.     ProductVersion              = $(ProductMajorVersion)"."$(ProductMinorVersion)
  30.     ProductSoftwareName         = "SMC1211"
  31.     ProductSoftwareImagePath    = "%SystemRoot%\System32\drivers\SMC1211.SYS"
  32.     NetRuleSoftwareType         = "SMC1211Sys ndisDriver SMC1211Driver"
  33.     NetRuleSoftwareUse          = $(SoftwareType)
  34.     NetRuleSoftwareBindForm     = """SMC1211Sys"" yes no container"
  35.     NetRuleSoftwareClass        = {"SMC1211Driver basic"}
  36.     NetRuleSoftwareBindable     = {"SMC1211Driver SMC1211Adapter non exclusive 100"}
  37.     ProductHardwareName         = "SMC1211"
  38.     NetRuleHardwareBindForm     = " yes yes container"
  39.  
  40.     ProductKeyName              = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  41.     ParamKeyName                = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  42.     VersionKeyName              = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion"
  43.  
  44.     FunctionTitle               = "SMC EZ Card 10/100 PCI (SMC1211 Series) Setup"
  45.     ProductSoftwareDescription  = "SMC EZ Card 10/100 PCI (SMC1211 Series) Driver"
  46.     ProductSoftwareTitle        = "SMC EZ Card 10/100 PCI (SMC1211 Series) Driver"
  47.  
  48.     ProductHardwareSMC1211Title   = "SMC EZ Card 10/100 PCI (SMC1211 Series)"
  49.     ProductHardwareSMC1211Description = "SMC EZ Card 10/100 PCI (SMC1211 Series)"
  50.     NetRuleHardwareSMC1211Type    = "SMC1211 SMC1211Adapter"
  51.     NetRuleHardwareSMC1211Class   = {"SMC1211Adapter basic"}
  52.  
  53.     AdapterSMC1211Type            = 5             ;; PCI board
  54.  
  55.     SMC1211CFID                   = 303108371    ;; 0x12111113
  56.  
  57. [GeneralConstants]
  58.     from      = ""
  59.     to        = ""
  60.     ExitCodeOk     = 0
  61.     ExitCodeCancel = 1
  62.     ExitCodeFatal  = 2
  63.     KeyNull         = ""
  64.     MAXIMUM_ALLOWED   = 33554432
  65.     RegistryErrorIndex = NO_ERROR
  66.     KeyProduct      = ""
  67.     KeyParameters   = ""
  68.     TRUE            = 1
  69.     FALSE           = 0
  70.     NoTitle            = 0
  71.     ExitState   = "Active"
  72.     OldVersionExisted = $(FALSE)
  73.     DriverPath      = $(!STF_NTPATH)\drivers
  74.     NT350VersionConstant = "3.50"
  75.     NT310VersionConstant = "3.10"
  76.  
  77. [date]
  78.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  79.  
  80. ;
  81. ; The [Identify] section is the first section executed by Setup. It
  82. ; returns information to Setup about the type of drivers that can
  83. ; be installed by this .INF file (in our case, network drivers).
  84. ;
  85. [Identify]
  86.     read-syms Identification
  87.     set Status     = STATUS_SUCCESSFUL
  88.     set Identifier = $(OptionType)
  89.     set Media      = #("Source Media Descriptions", 1, 1)
  90.     Return $(Status) $(Identifier) $(Media)
  91.  
  92. ;
  93. ; If the [Identify] section indicates that the .INF file supports
  94. ; the appropriate type of driver, Setup calls the [ReturnOptions]
  95. ; section.  Setup passes a single parameter to this section,
  96. ; indicating the language to be used for dialog strings.  This
  97. ; section returns information to the Setup program, listing the
  98. ; names of any drivers which can be installed by this .INF file.
  99. ; It also returns the text strings for each driver to be used in
  100. ; the dialog box asking the user to select the driver to install.
  101. ;
  102. [ReturnOptions]
  103.     ;
  104.     ; Initialize variables to failure state.
  105.     ;
  106.     set Status        = STATUS_FAILED
  107.     set OptionList     = {}
  108.     set OptionTextList = {}
  109.  
  110.     ;
  111.     ; See if our language list supports the language specified.
  112.     ; If a second parameter was passed in, see if it is a supported
  113.     ; platform.
  114.     ;
  115.     set LanguageList = ^(LanguagesSupported, 1)
  116.     Ifcontains(i) $($0) in $(LanguageList)
  117.     ifstr(i) $($1) == ""
  118.         goto returnoptions
  119.     endif
  120.         set PlatformList = ^(PlatformsSupported, 1)
  121.     Ifcontains(i) $($1) in $(PlatformList)
  122.         goto returnoptions
  123.     else
  124.         set Status = STATUS_NOTSUPPORTED
  125.         goto finish_ReturnOptions
  126.     endif
  127.     else
  128.         set Status = STATUS_NOLANGUAGE
  129.         goto finish_ReturnOptions
  130.     endif
  131.  
  132.  
  133.     ;
  134.     ; If we get here, we are successful, so return the option list.
  135.     ;
  136. returnoptions = +
  137.     set OptionList     = ^(Options, 1)
  138.     set OptionTextList = ^(OptionsText$($0), 1)
  139.     set Status         = STATUS_SUCCESSFUL
  140.  
  141.     ;
  142.     ; Exit from this section.
  143.     ;
  144. finish_ReturnOptions = +
  145.     Return $(Status) $(OptionList) $(OptionTextList)
  146.  
  147. ;
  148. ; If the [ReturnOptions] section returns successfully, indicating
  149. ; the language is supported, Setup displays a dialog box from which
  150. ; the user can select a driver to install.  Setup then calls the
  151. ; [InstallOption] section, with the following parameters:
  152. ;
  153. ;       Language to use
  154. ;       OptionID to install
  155. ;       SourceDirectory
  156. ;       AddCopy  (yes/no)
  157. ;       DoCopy   (yes/no)
  158. ;       DoConfig (yes/no)
  159. ;
  160. ; ScrDir seems to always be A:\, even when you later install from
  161. ; the oemnad#.inf which is copied to the system32 directory.
  162. ;
  163. ; AddCopy and DoCopy are valid only when NTN_InstallMode = install.
  164. ; AddCopy is yes if the files should be added to the copy list.
  165. ; DoCopy is yes if CopyFilesInCopyList should be called.
  166. ;
  167. ; DoConfig is not used for network cards.
  168. ;
  169. ; This .INF file is automatically copied to the SYSTEM32 directory,
  170. ; by WinNT, and renamed so as to have a unique name.
  171. ;
  172. [InstallOption]
  173.     ;;;
  174.     ;;; Change "Set !G:DebugOutputControl=0" to 1 in NCAPSHEL.INF for debug support.
  175.     ;;;
  176.     ;;; set !G:DebugOutputControl=1     ;; Debug output {1=turned on, 0= turned off}
  177.  
  178.     ;
  179.     ; Read input parameters.
  180.     ;
  181.     set Option   = $($1)
  182.     set SrcDir   = $($2)
  183.     set AddCopy  = $($3)
  184.     set DoCopy   = $($4)
  185.     set DoConfig = $($5)
  186.  
  187.     ;
  188.     ; Check if specified language is supported.
  189.     ;
  190.     set LanguageList = ^(LanguagesSupported, 1)
  191.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  192.     Return STATUS_NOLANGUAGE
  193.     endif
  194.  
  195.     ;
  196.     ; Set up local variables and constant values.
  197.     ;
  198.     set-subst LF = "\n"
  199.     read-syms GeneralConstants
  200.     read-syms FileConstants
  201. ;   set NetRuleSoftwareBindable = $($R1)
  202.     read-syms DialogConstants$(!STF_LANGUAGE)
  203.     ifstr(i) $(!NTN_Origination) == "NCPA"
  204.     set Continue = "OK"
  205.     endif
  206.     read-syms FileConstants$(!STF_LANGUAGE)
  207.     ;; read-syms FileDependentDlg$(!STF_LANGUAGE)
  208.     ;; SetHelpFile $(!STF_WINDOWSSYSPATH)"\"$(OptionHelpFile) $(MinHelpId) $(MaxHelpId)
  209.     detect date
  210.     set-title  $(Function$(Option)Title)
  211.     set to   = Begin
  212.     set from = Begin
  213.     set CommonStatus = STATUS_SUCCESSFUL
  214.     EndWait
  215.  
  216.     ;; ;
  217.     ;; ; Problem was discovered using unattend.txt files for automatic
  218.     ;; ; installation.  It was found that $2 passed into this section does
  219.     ;; ; not have an appropriate value when using unattend.txt.  It was
  220.     ;; ; found that during manual AND unattended installations, the variable
  221.     ;; ; STF_SRCDIR_OVERRIDE did contain an appropriate value.
  222.     ;; ;
  223.     ;; ifstr(i) $(!STF_SRCDIR_OVERRIDE) != ""
  224.     ;;     set SrcDir = $(!STF_SRCDIR_OVERRIDE)
  225.     ;; endif
  226.  
  227. Begin = +
  228.  
  229.     ;;
  230.     ;; Get the Version of Windows NT we are installing on.  This will allow us to use the
  231.     ;; PCI Support that will be included in NT v3.51
  232.     ;;
  233.     set CurrentVersionValue = ""
  234.     OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Windows Nt\CurrentVersion" $(!REG_KEY_READ) KeyNt
  235.     Ifstr(i) $(KeyNt) != ""
  236.     GetRegValue $(KeyNt) "CurrentVersion" CurrentVersionValue
  237.     Debug-Output "$(InfFile) $(Option): WinNT CurrentVersion ="$(CurrentVersionValue)
  238.     CloseRegKey $(KeyNt)
  239.     Endif
  240.  
  241.     ifstr(i) (*($(CurrentVersionValue),4)) == $(NT310VersionConstant)    ;; NT v3.10 not supported!
  242.         Debug-Output "$(InfFile) $(Option): Configureadapter"
  243.     set Error = "Windows NT v3.10 is not support by this product"
  244.     goto fatal
  245.     endif
  246.  
  247. ;    set ActivateDetection = FALSE
  248.  
  249.     ;
  250.     ; NTN_InstallMode
  251.     ;   install   - this is a primary or original installation, it
  252.     ;               may be an upgrade
  253.     ;   deinstall - this product and its binaries are to be removed
  254.     ;               from the disk
  255.     ;   configure - this product is to be (re-) configured
  256.     ;   bind      - this product's relationships to other products
  257.     ;               have changed and should be reviewed.
  258.     ;
  259.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  260.         set StartLabel = removeadapter
  261.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  262.         set StartLabel = UpgradeSoftware
  263.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  264.         set StartLabel = bindingadapter
  265.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  266.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  267.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  268.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  269.             goto ShellCodeError
  270.             endif
  271.             set Error = $($R0)
  272.             set from = end
  273.             set to = end
  274.             goto nonfatalinfo
  275.         else
  276.             set StartLabel = configureadapter
  277.         endif
  278.     else
  279.         set StartLabel = installadapter
  280.         set OEM_ABANDON_OPTIONS = {}
  281.         set OEM_ABANDON_SOFTWARE = FALSE
  282.         set OEM_ABANDON_ON = TRUE
  283.     endif
  284.  
  285.     ;; ;
  286.     ;; ; HARDWARE_PUT_IN_REGISTRY gets set to true once the hardware
  287.     ;; ; component is installed.  That way if we get an error we know
  288.     ;; ; to uninstall it.  HWList has the path to the hardware that
  289.     ;; ; is needed by RemoveHardwareComponent.
  290.     ;; ;
  291.     ;; ; SOFTWARE_PUT_IN_REGISTRY gets set to true once the software
  292.     ;; ; component is installed.
  293.     ;; ;
  294.     ;; set HARDWARE_PUT_IN_REGISTRY = $(FALSE)
  295.     ;; set HWList = ""
  296.     ;; set SOFTWARE_PUT_IN_REGISTRY = $(FALSE)
  297.  
  298.     Debug-Output "$(InfFile) $(Option): =================================================="
  299.     Debug-Output "$(InfFile) $(Option): STF_CWDIR is: "$(!STF_CWDIR)
  300.     Debug-Output "$(InfFile) $(Option): STF_SRCDIR is: "$(!STF_SRCDIR)
  301.     Debug-Output "$(InfFile) $(Option): STF_LANGUAGE is: "$(!STF_LANGUAGE)
  302.     Debug-Output "$(InfFile) $(Option): Option is: "$(Option)
  303.     Debug-Output "$(InfFile) $(Option): !STF_NCN_InstallMode is:"$(!NTN_InstallMode)
  304.     Debug-Output "$(InfFile) $(Option): !STF_NCDETECT  is: "$(!STF_NCDETECT)
  305.     Debug-Output "$(InfFile) $(Option): !STF_NCOPTION  is: "$(!STF_NCOPTION)
  306.     Debug-Output "$(InfFile) $(Option): !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  307.     Debug-Output "$(InfFile) $(Option): !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  308.     Debug-Output "$(InfFile) $(Option): !STF_GUI_UNATTENDED is: "$(!STF_GUI_UNATTENDED)
  309.     Debug-Output "$(InfFile) $(Option): !STF_BusType is $(!STF_BUSTYPE)"            ;; Primary Bus
  310.     Debug-Output "$(InfFile) $(Option): !STF_BusTypeList is $(!STF_BUSTYPELIST)"    ;; All Buses
  311.     Debug-Output "$(InfFile) $(Option): =================================================="
  312.  
  313.     set from = $(fatal)
  314.     set to = $(fatal)
  315.     goto $(StartLabel)
  316.  
  317. ;------------------------------------------------------------------------
  318. ; InstallMode = install
  319. ; Came here straight from figuring out which platform we are on.
  320. ; Option, SrcDir, AddCopy, DoCopy, and DoConfig are valid.
  321. ;
  322. installadapter = +
  323.  
  324.     OpenRegKey $(!REG_H_LOCAL) "" $(VersionKeyName) $(MAXIMUM_ALLOWED) KeyVersion
  325.     GetRegValue $(KeyVersion),"CurrentVersion",VersionStruct
  326.     CloseRegKey $(KeyVersion)
  327.     Set NTVersion = *($(VersionStruct),4)
  328.  
  329.      Ifstr(i) $(NTVersion) == "3.51"
  330.         set Source_Directory = "NDIS3"
  331.      else
  332.         set Source_Directory = ""
  333.      endif
  334. ;;    set Source_Directory = "WINNT"
  335.     Ifstr(i) $(DoCopy) == "YES"
  336.       Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  337.       Set SrcDir = $($R1)
  338.     Endif
  339.  
  340.     install "Install-Hlp"
  341.  
  342.     Debug-Output "$(InfFile) $(Option): Installadapter"
  343.     ;
  344.     ; Get open handle KeyProduct.
  345.     ; Returns an empty string if key does not exist.
  346.     ;
  347.     ; NTN_RegBase appears empty on the installation of the first card.
  348.     ; KeyProduct will be KeyNull on the installation of the first card.
  349.     ;
  350.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  351.     Ifstr $(KeyProduct) != $(KeyNull)
  352.         CloseRegKey $(KeyProduct)
  353.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  354. ;           Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  355. ;              $(ProductVersion)
  356.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  357.                 Debug-Output "ShellCode error: cannot get an error string."
  358.                 goto ShellCodeError
  359.             endif
  360.             goto end
  361.         else
  362. ;           Shell $(UtilityInf), CardExistedDlg
  363. ;           ifint $($ShellCode) != $(!SHELL_CODE_OK)
  364. ;               Debug-Output "ShellCode error: cannot get an error string."
  365. ;               goto ShellCodeError
  366. ;           endif
  367. ;           ifstr(i) $($R1) != "OK"
  368. ;               set CommonStatus = STATUS_USERCANCEL
  369. ;               goto end
  370. ;           endif
  371.             set OldVersionExisted = $(TRUE)
  372.         endif
  373.     Endif
  374. ;   Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
  375. ;   Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  376. ;       Goto ShellCodeError
  377. ;   Else-Ifstr(i) $($R0) == STATUS_FAILED
  378. ;       Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  379. ;       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  380. ;           goto ShellCodeError
  381. ;       endif
  382. ;       set Error = $($R0)
  383. ;       Goto fatal
  384. ;   Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  385. ;      Goto successful
  386. ;   Endif
  387.  
  388.  ;  Set SrcDir = $($R1)
  389.  ;  Set SrcDir = "A:\DRIVER"
  390.  
  391. ;      Goto adapteroptions
  392.           Goto installproduct
  393.  
  394. configureadapter = +
  395.     Debug-Output "$(InfFile) $(Option): Configureadapter"
  396.  
  397.    Ifstr(i) $(KeyProduct) == $(KeyNull)
  398.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  399.         Ifstr $(KeyProduct) == $(KeyNull)
  400.             Set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  401.            Goto fatalregistry
  402.         Endif
  403.     Endif
  404.     Shell $(UtilityInf) FindService, $(KeyProduct)
  405.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  406.         Goto ShellCodeError
  407.     Endif
  408.     Ifstr(i) $($R0) != NO_ERROR
  409.         Goto fatalregistry
  410.     endif
  411.     set KeyParameters = $($R2)
  412.     CloseRegKey $($R1)
  413.     Ifstr $(KeyParameters) == $(KeyNull)
  414.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  415.         goto fatalregistry
  416.     endif
  417.     set OldVersionExisted = $(TRUE)
  418.     set ValueName = ""
  419.     set ValueData = ""
  420.     set ValueStr  = ""
  421.     set ValueList = {}
  422.     EnumRegValue $(KeyParameters) ValueList
  423.     ForListDo $(ValueList)
  424.         set ValueItem = $($)
  425.         set ValueName = *($(ValueItem),1)
  426.         set ValueData = *($(ValueItem),4)
  427.         Ifstr(i) $(ValueName) == "DuplexMode"
  428.             set DuplexModeIndex = $(ValueData)
  429.         endif
  430.  
  431.         Ifstr(i) $(ValueName) == "ApmPme"
  432.             set ApmPmeIndex = $(ValueData)
  433.         endif
  434.         Ifstr(i) $(ValueName) == "LinkUp"
  435.             set LinkUpIndex = $(ValueData)
  436.         endif
  437.     EndForListDo
  438.     set DuplexModeValue = *($(DuplexModeList), ~($(DuplexModeValues),$(DuplexModeIndex)))
  439.     ifstr(i) $(DuplexModeValue) == ""
  440.         set DuplexModeValue = *($(DuplexModeList), 1)
  441.     endif
  442.     set ApmPmeValue = *($(ApmPmeList), ~($(ApmPmeValues),$(ApmPmeIndex)))
  443.     ifstr(i) $(ApmPmeValue) == ""
  444.         set ApmPmeValue = *($(ApmPmeList), 2)
  445.     endif
  446.     set LinkUpValue = *($(LinkUpList), ~($(LinkUpValues),$(LinkUpIndex)))
  447.     ifstr(i) $(LinkUpValue) == ""
  448.         set LinkUpValue = *($(LinkUpList), 1)
  449.     endif
  450. ;;;    set Error = "Cannot configure the software component"
  451. ;;;    goto fatal
  452.  
  453. adapteroptions = +
  454.     Debug-Output "$(InfFile) $(Option): Adapteroptions"
  455.     set from = adapteroptions
  456.  
  457.    read-syms FileDependentDlg$(!STF_LANGUAGE)
  458.    ;SetHelpFile $(!STF_WINDOWSSYSPATH)"\"$(OptionHelpFile) $(MinHelpId) $(MaxHelpId) $(Help$(Option)Id)
  459.      SetHelpFile $(!STF_WINDOWSSYSPATH)"\"smc1211.hlp 10 20 10
  460.    ui start "InputDlg"
  461.  
  462. ;   ifstr(i) $(DLGEVENT) == "CONTINUE"
  463. ;      set DuplexModeIndex = $(Combo1Out)
  464. ;      ui pop 1
  465. ;   else-ifstr(i) $(DLGEVENT) == "BACK"
  466. ;      set CommonStatus = STATUS_USERCANCEL
  467. ;      ui pop 1
  468. ;      goto end
  469. ;   else
  470. ;      ui pop 1
  471. ;      goto end
  472. ;   endif
  473.  
  474.    ifstr(i) $(DLGEVENT) == "CONTINUE"
  475.       set DuplexModeIndex = $(Combo1Out)
  476.       set ApmPmeIndex = $(Combo2Out)
  477.       set LinkUpIndex = $(Combo3Out)
  478.       ui pop 1
  479.    else-ifstr(i) $(DLGEVENT) == "BACK"
  480.       set CommonStatus = STATUS_USERCANCEL
  481.       ui pop 1
  482.       goto end
  483.    else
  484.       ui pop 1
  485.       goto end
  486.    endif
  487.  
  488.    set DuplexModeValue = *($(DuplexModeValues), ~($(DuplexModeList),$(DuplexModeIndex)))
  489.    set ApmPmeValue = *($(ApmPmeValues), ~($(ApmPmeList),$(ApmPmeIndex)))
  490.    set LinkUpValue = *($(LinkUpValues), ~($(LinkUpList),$(LinkUpIndex)))
  491.     ifstr(i) $(!NTN_InstallMode) == configure
  492.        goto updateparameters
  493.     endif
  494.     ;; ifstr(i) $(!NTN_InstallMode) == configure
  495.     ;;    goto updateparameters
  496.     ;; endif
  497.  
  498. installproduct =+
  499.     Debug-Output "$(InfFile) $(Option): installproduct"
  500.     StartWait
  501.     set AdapterList = $($R1)
  502.     ifint $(OldVersionExisted) == $(FALSE)
  503.         Ifstr(i) $(DoCopy) == "YES"
  504.             Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
  505.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  506.                 Goto ShellCodeError
  507.             Else-Ifstr(i) $($R0) == STATUS_FAILED
  508.                 Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  509.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  510.                     goto ShellCodeError
  511.                 endif
  512.                 set Error = $($R0)
  513.                 Goto fatal
  514.             Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  515.                 Goto successful
  516.             Endif
  517.             Set SrcDir = $($R1)
  518.         Endif
  519.  
  520.         install "Install-Option"
  521.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  522.             Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  523.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  524.                 goto ShellCodeError
  525.             endif
  526.             set Error = $($R0)
  527.             goto fatal
  528.         endif
  529.     endif
  530.  
  531.     ;
  532.     ; Check to see if the Product Software key exists already in the system service keys
  533.     ; before we try to add the software component.
  534.     ;
  535.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName) $(!REG_KEY_READ) KeyNt
  536.     CloseRegKey $(KeyNt)
  537.  
  538.     Ifstr(i) $(KeyNt) == ""
  539.         Debug-Output "$(InfFile) $(Option): AddSoftwareComponent"
  540.         Debug-Output "$(InfFile) $(Option): --> $(Manufacturer)"
  541.         Debug-Output "$(InfFile) $(Option): --> $(ProductSoftwareName)"
  542.         Debug-Output "$(InfFile) $(Option): --> $(ProductSoftwareTitle)"
  543.         Debug-Output "$(InfFile) $(Option): --> $(STF_CONTEXTINFNAME)"
  544.         Debug-Output "$(InfFile) $(Option): --> $(ProductSoftwareImagePath)"
  545.         Debug-Output "$(InfFile) $(Option): --> $(NetEventDLL)"
  546.  
  547.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  548.         $(ProductSoftwareName), +
  549.         $(ProductSoftwareName), +
  550.         $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  551.         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  552.         $(NetEventDLL)
  553.  
  554.         Set OEM_ABANDON_SOFTWARE = TRUE
  555.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  556.             goto ShellCodeError
  557.         endif
  558.         set RegistryErrorIndex = $($R0)
  559.         Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  560.             EndWait
  561.             CloseRegKey $($R1)
  562.             CloseRegKey $($R2)
  563.             CloseRegKey $($R3)
  564.             CloseRegKey $($R4)
  565.             CloseRegKey $($R5)
  566.             goto fatalregistry
  567.         endif
  568.         Set SoftProductKey      = $($R1)
  569.         Set SoftNetRuleKey      = $($R2)
  570.         Set SoftServiceKey      = $($R3)
  571.         Set SoftParameterKey    = $($R4)
  572.         Set SoftLinkageKey      = $($R5)
  573.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  574.                {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  575.                {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  576.                {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  577.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  578.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  579.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  580.         Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  581.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  582.             goto ShellCodeError
  583.         endif
  584.         set RegistryErrorIndex = $($R0)
  585.         Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  586.             EndWait
  587.             CloseRegKey $(SoftProductKey)
  588.             CloseRegKey $(SoftNetRuleKey)
  589.             CloseRegKey $(SoftServiceKey)
  590.             CloseRegKey $(SoftParameterKey)
  591.             CloseRegKey $(SoftLinkageKey)
  592.             goto fatalregistry
  593.         endif
  594.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  595.                 {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  596.                 {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  597.                 {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  598.                 {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  599.                 {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  600.         Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  601.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  602.             goto ShellCodeError
  603.         endif
  604.         set RegistryErrorIndex = $($R0)
  605.         CloseRegKey $(SoftProductKey)
  606.         CloseRegKey $(SoftNetRuleKey)
  607.         CloseRegKey $(SoftServiceKey)
  608.         CloseRegKey $(SoftParameterKey)
  609.         CloseRegKey $(SoftLinkageKey)
  610.         Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  611.             EndWait
  612.             goto fatalregistry
  613.         endif
  614.     endif ;; Does Services SMC1211
  615.  
  616.     set NTDetected = $(FALSE)
  617.  
  618.         Debug-Output "$(InfFile) $(Option): About to look for SMC1211 Cards"
  619.         ;;
  620.         ;; we must be installing a PCI card.
  621.         ;;
  622.         ;; Note: If we are are on WinNT v3.51 and above, we have PCI detection support
  623.         ;; and are able to setup the adapter without user intervention. Otherwise, we can
  624.         ;; only do one card at a time.
  625.         ;;
  626.         set TargetVersion = *($(CurrentVersionValue),4)
  627.         Debug-Output "$(InfFile) $(Option): Current Version:"$(TargetVersion)
  628.  
  629.         ifstr $(TargetVersion) == $(NT350VersionConstant)   ;; We need to ask on v3.50
  630.             Debug-Output "Running on WindowsNT 3.50"
  631.             set Version350 = $(TRUE)
  632.         else
  633.             Debug-Output "Running on WindowsNT 3.51"
  634.             set Version350 = $(FALSE)
  635.         endif
  636.  
  637.         ifint $(Version350) == $(TRUE)
  638.             Debug-Output "Running on WindowsNT v3.50, Not using PCI Detection!!!"
  639.             ifstr $(!STF_GUI_UNATTENDED) == "YES"
  640.                 Debug-Output "$(InfFile) $(Option): Running in GUI unattended mode"
  641.                 ifstr(i) $(!AutoNetInterfaceType) != ""
  642.                     set BusInterfaceType = $(!AutoNetInterfaceType)
  643.                 else
  644.                     set BusInterfaceType = 5
  645.                 endif
  646.                 ifstr(i) $(!AutoNetBusNumber) != ""
  647.                     set BusNumber = $(!AutoNetBusNumber)
  648.                 else
  649.                     set BusNumber = 0
  650.                 endif
  651.                 set NTDetected = $(FALSE)
  652.                 set AdapterList = $(Option)   ;; 1 Item to install
  653.                 Debug-Output "$(InfFile) $(Option): BusInterfaceType = $(BusInterfaceType)"
  654.                 Debug-Output "$(InfFile) $(Option): BusNumber = $(BusNumber)"
  655.             else
  656.                 Debug-Output "$(InfFile) $(Option): Running 3.50 Bus Dialog"
  657.                 set BusInterfaceType = 5
  658.                 set BusNumber = 0
  659.                 set NTDetected = $(FALSE)
  660.                 Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
  661.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  662.                     Debug-Output "ShellCode error."
  663.                     goto ShellCodeError
  664.                 endif
  665.                 set BusInterfaceType = $($R1)
  666.                 set BusNumber = $($R2)
  667.                 set AdapterList = $(Option)   ;; 1 Item to install
  668.                 Debug-Output "$(InfFile) $(Option): BusInterfaceType = $(BusInterfaceType)"
  669.                 Debug-Output "$(InfFile) $(Option): BusNumber = $(BusNumber)"
  670.             endif
  671.         else
  672.             Debug-Output "$(InfFile) $(Option): Running 3.51 using PCI Dectection"
  673.             ;;
  674.             ;; v3.51 has PCI detection code built in.
  675.             ;;
  676.             ;;set BusInterfaceType = 5
  677.             ;;set BusNumber = 0
  678.             ;; Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
  679.  
  680.             set NTDetected = $(TRUE)
  681.             set VendorID = 4371       ;; 0x1113 is SMC's Vendor ID
  682.             set DeviceID = 4625       ;; 0x1211 is SMC's Device ID
  683.             ;;set-div CFID = $($(Option)CFID) 1
  684.             Debug-Output "$(InfFile) $(Option): VendorID = $(VendorID)"
  685.             Debug-Output "$(InfFile) $(Option): DeviceID = $(DeviceID)"
  686.             ;;Shell $(UtilityInf), GetPCIInformation, $(VendorID) $(CFID)
  687.             Shell $(UtilityInf), GetPCIInformation, $(VendorID) $(DeviceID)
  688.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  689.                 goto ShellCodeError
  690.             endif
  691.             ifstr(i) $($R0) == {}
  692.                 set Error = $(CANNOT_FIND_ANY_CARD)
  693.                 set CommonStatus = USER_CANCEL
  694.                 set from = end
  695.                 goto nonfatal
  696.             endif
  697.             set AdapterList = $($R0)
  698.         endif   ;;; NT v3.50
  699.     endif  ;;; Looking for PCI cards in Option.
  700.  
  701.     ; "AdapterList" has the list of currently installed adatpers in the system!
  702.     ;
  703.     Debug-Output "$(InfFile) $(Option): Adapterlist = $(AdatperList)"
  704.     ForListDo $(AdapterList)
  705.         Set InstallCard = "YES"
  706.         ifint $(NTDetected) == $(TRUE)
  707.             set DetectedBusNum = *($($),1)
  708.             set DetectedSlotNum = *($($),2)
  709.             Debug-Output "$(InfFile) $(Option): DetectedBusNumber = $(DetectedBusNum)"
  710.             Debug-Output "$(InfFile) $(Option): DetectedSlotNum = $(DetectedSlotNum)"
  711.  
  712.             Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(DetectedBusNum), +
  713.             $(DetectedSlotNum), $(ProductHardware$(Option)Description), $(ProductHardwareName)
  714.  
  715.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  716.                 goto ShellCodeError
  717.             endif
  718.             ifstr $($R0) != "NO_ERROR"
  719.                 set Error = $($R0)
  720.                 goto fatal
  721.             endif
  722.             ifstr(i) $($R1) == "YES"
  723.                 set InstallCard = "NO"  ;; Don't want to re-install, it's there already
  724.             endif
  725.         endif
  726.         ;;
  727.         ;; Are we installing the card?
  728.         ;;
  729.         ifstr(i) $(InstallCard) == "NO"
  730.             Debug-Output "$(InfFile) $(Option): Card Already at $(DetectedBusNum):$(DetectedSlotNum) already installed!"
  731.             set Error = "An adapter at $(DetectedBusNum):$(DetectedSlotNum) is already installed!"
  732.             Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  733.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  734.                 goto ShellCodeError
  735.             endif
  736.         else
  737.             Debug-Output "$(InfFile) $(Option): Installing Card at $(DetectedBusNum):$(DetectedSlotNum)!"
  738.             Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  739.             ifint $($R4) != -1
  740.                 Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  741.             endif
  742.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  743.                 goto ShellCodeError
  744.             endif
  745.             set RegistryErrorIndex = $($R0)
  746.             Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  747.                 EndWait
  748.                 CloseRegKey $($R1)
  749.                 CloseRegKey $($R2)
  750.                 CloseRegKey $($R3)
  751.                 goto fatalregistry
  752.             endif
  753.  
  754. ;            read-syms FileDependentDlg$(!STF_LANGUAGE)
  755. ;            ;SetHelpFile $(!STF_WINDOWSSYSPATH)"\"$(OptionHelpFile) $(MinHelpId) $(MaxHelpId) $(Help$(Option)Id)
  756. ;            SetHelpFile $(!STF_WINDOWSSYSPATH)"\"smc1211.hlp 10 20 10
  757. ;            ui start "InputDlg"
  758. ;
  759. ;;            ifstr(i) $(DLGEVENT) == "CONTINUE"
  760. ;               set DuplexModeIndex = $(Combo1Out)
  761. ;               ui pop 1
  762. ;;            else-ifstr(i) $(DLGEVENT) == "BACK"
  763. ;;               set CommonStatus = STATUS_USERCANCEL
  764. ;;               ui pop 1
  765. ;;               goto end
  766. ;;            else
  767. ;;               ui pop 1
  768. ;;               goto end
  769. ;;            endif
  770. ;
  771. ;            set DuplexModeValue = *($(DuplexModeValues), ~($(DuplexModeList),$(DuplexModeIndex)))
  772.  
  773.             Set HardNetCardKey      = $($R1)
  774.             Set HardNetRuleKey      = $($R2)
  775.             Set HardParameterKey    = $($R3)
  776.             set AdapterNumber = $($R4)
  777.             set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  778.                     {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  779.                     {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  780.                     {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  781.                     {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  782.                     {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  783.             Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  784.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  785.                 goto ShellCodeError
  786.             endif
  787.  
  788.                 ;
  789.                 ; PCI
  790.                 ;
  791.                 set BusTypeNum = 5
  792.                 set BusMaster = "YES"
  793.                 set Bus = "PCI"
  794.                 ifstr(i) $(Option) == "SMC1211"
  795.                     set CardType = 2
  796.                 else
  797.                     set CardType = 0
  798.                 endif
  799.  
  800.             ;;
  801.             ;; If we used the OS to dected the card, then we already know bus and slot information.
  802.             ;;
  803.             ifint $(NTDetected) == $(TRUE)
  804.                 set BusNumber = $(DetectedBusNum)
  805.                 set SlotNum = $(DetectedSlotNum)
  806.                 set BusInterfaceType = $(BusTypeNum)
  807.                 ;
  808.                 ; Note: we need to record SlotNumber too so that we can use the
  809.                 ; "IsNetCardAlreadyInstalled" routine
  810.                 ;
  811.                 Set NewValueList =  {+
  812.                     {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
  813.                     {Slot,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)}+
  814.                     }
  815.                 Debug-Output "$(InfFile) $(Option): Set HardwareParameterKey = $(NewValueList)"
  816.                 Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  817.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  818.                     goto ShellCodeError
  819.                 endif
  820.  
  821.                 Set NewValueList = { {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)} }
  822.                 Debug-Output "$(InfFile) $(Option): Set HardwareParameterKey = $(NewValueList)"
  823.                 Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  824.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  825.                     goto ShellCodeError
  826.                 endif
  827.             else
  828.                 Set NewValueList =  {+
  829.                     {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
  830.                     }
  831.                 Debug-Output "$(InfFile) $(Option): Set HardwareParameterKey = $(NewValueList)"
  832.                 Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  833.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  834.                     goto ShellCodeError
  835.                 endif
  836.             endif
  837.  
  838.             Set NewValueList =  {+
  839.                 {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
  840.                 {CardType,$(NoTitle),$(!REG_VT_DWORD),$(CardType)},+
  841.                 {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  842.                 {AdapterCFID,$(NoTitle),$(!REG_VT_DWORD),$($(Option)CFID)},+
  843.                 }
  844.  
  845.             Debug-Output "$(InfFile) $(Option): Set HardwareParameterKey = $(NewValueList)"
  846.             Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  847.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  848.                 goto ShellCodeError
  849.             endif
  850.  
  851. ;Baushg, fix the original problem
  852.              set DuplexModeValue = *($(DuplexModeValues), 1)
  853.              set ApmPmeValue = *($(ApmPmeValues), 2)
  854.              set LinkUpValue = *($(LinkUpValues), 1)
  855. ;-----------------------------------------------------------
  856.             set NewValueList = {{DuplexMode,$(NoTitle),$(!REG_VT_DWORD),$(DuplexModeValue)},+
  857.                                 {ApmPme,$(NoTitle),$(!REG_VT_DWORD),$(ApmPmeValue)},+
  858.                                 {LinkUp,$(NoTitle),$(!REG_VT_DWORD),$(LinkUpValue)}}
  859.             Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  860.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  861.                goto ShellCodeError
  862.             endif
  863.             set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  864.             set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  865.             set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardware$(Option)Type)},+
  866.                     {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  867.                     {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardware$(Option)Class)}, +
  868.                     {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  869.  
  870.             Debug-Output "$(InfFile) $(Option): HardwareRuleKey = $(NewValueList)"
  871.             Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  872.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  873.                 goto ShellCodeError
  874.             endif
  875.             CloseRegKey $(HardNetCardKey)
  876.             CloseRegKey $(HardNetRuleKey)
  877.             CloseRegKey $(HardParameterKey)
  878.         endif
  879.     EndForListDo
  880.     EndWait
  881.     goto successful
  882.  
  883. updateparameters =+
  884.     Debug-Output "$(InfFile) $(Option): Updateparameters"
  885.     set HardParameterKey    = $($R3)
  886.  
  887.     set NewValueList = {{DuplexMode,$(NoTitle),$(!REG_VT_DWORD),$(DuplexModeValue)},+
  888.                         {ApmPme,$(NoTitle),$(!REG_VT_DWORD),$(ApmPmeValue)},+
  889.                         {LinkUp,$(NoTitle),$(!REG_VT_DWORD),$(LinkUpValue)}}
  890.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  891.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  892.     goto ShellCodeError
  893.     endif
  894.     CloseRegKey $(KeyParameters)
  895.     goto successful
  896.  
  897. bindingadapter =+
  898.     Debug-Output "$(InfFile) $(Option): bindingadapter"
  899.     set Error = "Binding: Sorry, not yet implemented."
  900.     goto fatal
  901.  
  902. removeadapter = +
  903.     Debug-Output "$(InfFile) $(Option): removeadapter"
  904.     Debug-Output "$(InfFile) $(Option): ----> $(ProductKeyName), $(!NTN_RegBase)"
  905.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  906.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  907.         $(ProductSoftwareName)
  908.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  909.         goto ShellCodeError
  910.         endif
  911.         set RegistryErrorIndex = $($R0)
  912.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  913.         goto fatalregistry
  914.     endif
  915.     else
  916.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  917.         $(ProductSoftwareName), $(!NTN_RegBase)
  918.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  919.         goto ShellCodeError
  920.     endif
  921.     set RegistryErrorIndex = $($R0)
  922.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  923.         goto fatalregistry
  924.     endif
  925.     endif
  926.     goto end
  927.  
  928. UpgradeSoftware = +
  929.     Debug-Output "$(InfFile) $(Option): UpdateSoftware"
  930.      OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  931.      Ifstr $(KeyProduct) != $(KeyNull)
  932.        Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  933.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  934.            Debug-Output "ShellCode error"
  935.            goto ShellCodeError
  936.        endif
  937.        set !UG_Filename = $($R0)
  938.        install "Install-Update"
  939.        ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  940.            goto fatal
  941.        endif
  942.        SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  943.        SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  944.        CloseRegKey $(KeyProduct)
  945.      else
  946.        goto fatalregistry
  947.      endif
  948.      goto end
  949.  
  950. successful = +
  951.     Debug-Output "$(InfFile) $(Option): Successful"
  952.     goto end
  953.  
  954. abandon = +
  955.     Debug-Output "$(InfFile) $(Option): Abandon"
  956.     ForListDo $(OEM_ABANDON_OPTIONS)
  957.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  958.         $(ProductSoftwareName), $($)
  959.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  960.         goto ShellCodeError
  961.     endif
  962.     set RegistryErrorIndex = $($R0)
  963.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  964.         goto fatalregistry
  965.     endif
  966.     EndForListDo
  967.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  968.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  969.         $(ProductSoftwareName), FALSE
  970.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  971.         goto ShellCodeError
  972.     endif
  973.     set RegistryErrorIndex = $($R0)
  974.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  975.         goto fatalregistry
  976.     endif
  977.     endif
  978.     goto end
  979.  
  980. warning = +
  981.     Debug-Output "$(InfFile) $(Option): warning"
  982.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  983.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  984.     goto ShellCodeError
  985.     endif
  986.     ifstr(i) $($R1) == "OK"
  987.     goto $(to)
  988.     else-ifstr(i) $($R1) == "CANCEL"
  989.     goto $(from)
  990.     else
  991.     goto "end"
  992.     endif
  993.  
  994. nonfatalinfo = +
  995.     Debug-Output "$(InfFile) $(Option): nonfatalinfo"
  996.     Set CommonStatus = STATUS_USERCANCEL
  997.     Set Severity = STATUS
  998.     goto nonfatalmsg
  999.  
  1000. nonfatal = +
  1001.     Debug-Output "$(InfFile) $(Option): nonfatal"
  1002.     Set Severity = NONFATAL
  1003.     goto nonfatalmsg
  1004.  
  1005. nonfatalmsg = +
  1006.     Debug-Output "$(InfFile) $(Option): nonfatalmsg"
  1007.     ifstr(i) $(Error) == ""
  1008.     Set Severity = NONFATAL
  1009.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1010.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1011.         goto ShellCodeError
  1012.     endif
  1013.     set Error = $($R0)
  1014.     endif
  1015.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1016.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1017.     goto ShellCodeError
  1018.     endif
  1019.     ifstr(i) $($R1) == "OK"
  1020.     goto $(from)
  1021.     else
  1022.     ;   goto "end"
  1023.     goto "RemoveAdapter"
  1024.     endif
  1025.  
  1026. fatalregistry = +
  1027.     Debug-Output "$(InfFile) $(Option): fatalregistry"
  1028.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1029.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1030.     goto ShellCodeError
  1031.     endif
  1032.     set Error = $($R0)
  1033.     goto fatal
  1034.  
  1035. fatal = +
  1036.     Debug-Output "$(InfFile) $(Option): fatal"
  1037.     ifstr(i) $(Error) == ""
  1038.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1039.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1040.         goto ShellCodeError
  1041.     endif
  1042.     set Error = $($R0)
  1043.     endif
  1044.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1045.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1046.     goto ShellCodeError
  1047.     endif
  1048.     goto setfailed
  1049.  
  1050. ShellCodeError = +
  1051.     Debug-Output "$(InfFile) $(Option): ShellCodeError"
  1052.     set DlgType      = "MessageBox"
  1053.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1054.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  1055.     set STF_MB_TYPE  = 1
  1056.     set STF_MB_ICON  = 3
  1057.     set STF_MB_DEF   = 1
  1058.     ui start "Error Message"
  1059.     goto setfailed
  1060.  
  1061. setfailed = +
  1062.     Debug-Output "$(InfFile) $(Option): Setfailed"
  1063.     set CommonStatus = STATUS_FAILED
  1064.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1065.     set OEM_ABANDON_ON = FALSE
  1066.     goto abandon
  1067.     endif
  1068.     goto end
  1069.  
  1070. end = +
  1071.     goto term
  1072.  
  1073. term = +
  1074.     Return $(CommonStatus)
  1075.  
  1076. [Install-Option]
  1077.     set STF_VITAL = ""
  1078.     ifstr(i) $(AddCopy) == "YES"
  1079.      AddSectionFilesToCopyList Files-$(Option) $(SrcDir)$(Source_Directory) $(!STF_WINDOWSSYSPATH)\drivers
  1080.  
  1081.     ifstr(i) $(DoCopy) == "YES"
  1082.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1083.        CopyFilesInCopyList
  1084.     endif
  1085.     Exit
  1086.  
  1087. [Install-Hlp]
  1088.    set STF_VITAL = ""
  1089.    AddSectionFilesToCopyList Files-Hlp $(SrcDir)  $(!STF_WINDOWSSYSPATH)
  1090. ;  AddSectionFilesToCopyList Files-Hlp $(SrcDir)WINNT $(!STF_WINDOWSSYSPATH)
  1091.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1092.    CopyFilesInCopyList
  1093.    Exit
  1094.  
  1095. [Install-Update]
  1096.    set STF_VITAL        = ""
  1097.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1098.  
  1099.    Ifstr(i) $(NTVersion) == "3.51"
  1100.        set Source_Directory = "NDIS3"
  1101.    else
  1102.        set Source_Directory = ""
  1103.    endif
  1104.  
  1105.    AddSectionFilesToCopyList Files-Hlp $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1106.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1107.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir)$(Source_Directory) $(!STF_WINDOWSSYSPATH)\drivers
  1108.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1109.    CopyFilesInCopyList
  1110.    exit
  1111.  
  1112. [Source Media Descriptions]
  1113.      1 = " SMC EZ Card 10/100 PCI (SMC1211 Series) Driver Disk"
  1114.      ; from disk a:\ or b:\
  1115.  
  1116. [ProductType]
  1117. STF_PRODUCT  = Winnt
  1118. STF_PLATFORM = I386
  1119.  
  1120. [Files-Inf]
  1121. 1,      oemsetup.inf,    SIZE=1000,     RENAME=$(!UG_Filename)
  1122.  
  1123. [Files-Hlp]
  1124. 1, SMC1211.HLP , SIZE=10000
  1125.  
  1126. ;
  1127. ; Driver files
  1128. ;
  1129. [Files-SMC1211]
  1130. 1,SMC1211.SYS , SIZE=50000
  1131.  
  1132. [LanguagesSupported]
  1133.     ENG
  1134.  
  1135. [OptionsTextENG]
  1136.     SMC1211     = "SMC EZ Card 10/100 PCI (SMC1211 Series)"
  1137.  
  1138. [FileConstantsENG]
  1139.     ProCaption   = "Windows NT Setup"
  1140.     ProCancel    = "Cancel"
  1141.     ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  1142.                    "Are you sure you want to cancel copying files?"
  1143.     ProCancelCap = "Network Setup Message"
  1144.     ProText1     = "Copying:"
  1145.     ProText2     = "To:"
  1146.  
  1147. DuplexModeList  = ^(DuplexModeDlg, 1)
  1148. DuplexModeValues = ^(DuplexModeDlg, 2)
  1149. ApmPmeList  = ^(ApmPmeDlg, 1)
  1150. ApmPmeValues = ^(ApmPmeDlg, 2)
  1151. LinkUpList  = ^(LinkUpDlg, 1)
  1152. LinkUpValues = ^(LinkUpDlg, 2)
  1153. NoList  = ^(NoChoices, 1)
  1154. NoValues = ^(NoChoices, 2)
  1155. ShellCodeErrorTitle = "Error: "$(Function$(Option)Title)
  1156. ShellCodeErrorText      = "Shell Code Error."
  1157. CANNOT_FIND_ANY_CARD    = "Network card is not present in the system"
  1158.  
  1159. [DialogConstantsENG]
  1160. Help        = "&Help"
  1161. Exit        = "Cancel"
  1162. OK          = "OK"
  1163. HelpContext = ""
  1164. Continue    = "Continue"
  1165. Cancel      = "Cancel"
  1166.  
  1167. [FileDependentDlgENG]
  1168. ;DlgText = "Choose the proper Duplex Mode from the list."$(!LF)+
  1169. ;          "  "
  1170.  
  1171. Combo1Label = " Duplex Mode "
  1172. Combo2Label = " PME Enable "
  1173. Combo3Label = " Link-up Wakeup "
  1174.  
  1175.  
  1176. DlgTemplate = "WD"
  1177. DlgType = "MultiCombo"
  1178. ;Caption = $(Function$(Option)Title)
  1179. Caption = "SMC1211 Setting "
  1180. Combo1List = $(DuplexModeList)
  1181. Combo1Out  = $(DuplexModeValue)
  1182. Combo2List = $(ApmPmeList)
  1183. Combo2Out  = $(ApmPmeValue)
  1184. Combo3List = $(LinkUpList)
  1185. Combo3Out  = $(LinkUpValue)
  1186. ComboListItemsIn  = {Combo1List,Combo2List,Combo3List}
  1187. ComboListItemsOut = {Combo1Out,Combo2Out,Combo3Out}
  1188. EditTextLim = ""
  1189. CBOptionsGreyed = {}
  1190. HelpContext = 10
  1191.  
  1192. [DuplexModeDlg]
  1193. ;;    DuplexMode_0 = "(0)  DEFAULT ", 0
  1194.     DuplexMode_1 = "(1)  AUTO    ", 1
  1195.     DuplexMode_2 = "(2)  10 Half Duplex", 2
  1196.     DuplexMode_3 = "(3)  10 Full Duplex", 3
  1197.     DuplexMode_4 = "(4)  100 Half Duplex", 4
  1198.     DuplexMode_5 = "(5)  100 Full Duplex", 5
  1199.  
  1200. [ApmPmeDlg]
  1201.     ApmPme_1 = "Disable", 1
  1202.     ApmPme_2 = "Enable", 2
  1203.  
  1204. [LinkUpDlg]
  1205.     LinkUp_1 = "Disable", 1
  1206.     LinkUp_2 = "Enable", 2
  1207.  
  1208.