home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 December / MICD_2000_12_NR1.iso / Dreamnet / drivery / Winbond / drv94015.exe / NDIS3 / NT40 / INSTALL / OEMSETUP.INF next >
INI File  |  1997-02-21  |  32KB  |  824 lines

  1. ;
  2. ; Winbond W89C940 MiniPort driver for Windows NT3.5, NT3.51 and NT4.0.
  3. ;
  4. [Identification]
  5.     OptionType = NetAdapter
  6. [PlatformsSupported]
  7.     PCI
  8. [Options]
  9.     W940ND
  10. [FileConstants]
  11. UtilityInf      = "UTILITY.INF"
  12. ParamInf        = "NCPARAM.INF"
  13. subroutineinf   = "SUBROUTN.INF"
  14. SoftwareType    = "driver"
  15. Exit_Code       = 0
  16. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  17. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  18. Manufacturer    = "Microsoft"
  19. ProductMajorVersion     = "3"
  20. ProductMinorVersion     = "51"
  21. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  22. ProductSoftwareName     = "W940ND"
  23. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\w940nd.sys"
  24. NetRuleSoftwareType     = "ne2000Sys ndisDriver w940ndDriver"
  25. NetRuleSoftwareUse      = $(SoftwareType)
  26. NetRuleSoftwareBindForm = """W940ndSys"" yes no container"
  27. NetRuleSoftwareClass    = {"w940ndDriver basic"}
  28. NetRuleSoftwareBindable = {"w940ndDriver w940ndAdapter non exclusive 100"}
  29. ProductHardwareName     = "W940ND"
  30. NetRuleHardwareType     = "w940nd w940ndAdapter"
  31. NetRuleHardwareBindForm = " yes yes container"
  32. NetRuleHardwareClass    = {"w940ndAdapter basic"}
  33. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  34. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  35. [GeneralConstants]
  36. from      = ""
  37. to        = ""
  38. ExitCodeOk     = 0
  39. ExitCodeCancel = 1
  40. ExitCodeFatal  = 2
  41. KeyNull         = ""
  42. MAXIMUM_ALLOWED   = 33554432
  43. RegistryErrorIndex = NO_ERROR
  44. KeyProduct      = ""
  45. KeyParameters   = ""
  46. TRUE            = 1
  47. FALSE           = 0
  48. NoTitle            = 0
  49. ExitState   = "Active"
  50. OldVersionExisted = $(FALSE)
  51. DriverPath      = $(!STF_NTPATH)\drivers
  52. [date]
  53.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  54. [Identify]
  55.     read-syms Identification
  56.     set Status     = STATUS_SUCCESSFUL
  57.     set Identifier = $(OptionType)
  58.     set Media      = #("Source Media Descriptions", 1, 1)
  59.     Return $(Status) $(Identifier) $(Media)
  60. [ReturnOptions]
  61.     set Status        = STATUS_FAILED
  62.     set OptionList     = {}
  63.     set OptionTextList = {}
  64.     set LanguageList = ^(LanguagesSupported, 1)
  65.     Ifcontains(i) $($0) in $(LanguageList)
  66.         ifstr(i) $($1) == ""
  67.            goto returnoptions
  68.         endif
  69.         set PlatformList = ^(PlatformsSupported, 1)
  70.         Ifcontains(i) $($1) in $(PlatformList)
  71.            goto returnoptions
  72.         else
  73.            set Status = STATUS_NOTSUPPORTED
  74.            goto finish_ReturnOptions
  75.         endif
  76.     else
  77.         set Status = STATUS_NOLANGUAGE
  78.         goto finish_ReturnOptions
  79.     endif
  80. returnoptions = +
  81.     set OptionList     = ^(Options, 1)
  82.     set OptionTextList = ^(OptionsText$($0), 1)
  83.     set Status         = STATUS_SUCCESSFUL
  84. finish_ReturnOptions = +
  85.     Return $(Status) $(OptionList) $(OptionTextList)
  86. [InstallOption]
  87.     set Option   = $($1)
  88.     set SrcDir   = $($2)
  89.     set AddCopy  = $($3)
  90.     set DoCopy   = $($4)
  91.     set DoConfig = $($5)
  92.     set LanguageList = ^(LanguagesSupported, 1)
  93.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  94.         Return STATUS_NOLANGUAGE
  95.     endif
  96.     set-subst LF = "\n"
  97.     read-syms GeneralConstants
  98.     read-syms FileConstants
  99.     read-syms DialogConstants$(!STF_LANGUAGE)
  100.     ifstr(i) $(!NTN_Origination) == "NCPA"
  101.         set Continue = $(OK)
  102.     endif
  103.     read-syms FileConstants$(!STF_LANGUAGE)
  104.     detect date
  105.     set-title  $(FunctionTitle)
  106.     set to   = Begin
  107.     set from = Begin
  108.     set CommonStatus = STATUS_SUCCESSFUL
  109.     EndWait
  110. Begin = +
  111.     set ActivateDetection = FALSE
  112.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  113.                 set StartLabel = removeadapter
  114.         else-Ifstr(i) $(!NTN_InstallMode) == Update
  115.                         set StartLabel = UpgradeSoftware
  116.         else-Ifstr(i) $(!NTN_InstallMode) == bind
  117.                 set StartLabel = bindingadapter
  118.         else-Ifstr(i) $(!NTN_InstallMode) == configure
  119.                 set CommonStatus = STATUS_REBOOT
  120.                 set ActivateDetection = TRUE
  121.                 set StartLabel = configureadapter
  122.                 Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  123.                         Debug-Output "Cannot configure the Winbond 940 PCI driver software."
  124.                         Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  125.                         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  126.                                 Debug-Output "ShellCode error: cannot get an error string."
  127.                                 goto ShellCodeError
  128.                         endif
  129.                         set Error = $($R0)
  130.                         set from = end
  131.                         set to = end
  132.                         goto nonfatalinfo
  133.                 endif
  134.     else
  135.                 set StartLabel = installadapter
  136.                 set OEM_ABANDON_OPTIONS = {}
  137.                 set OEM_ABANDON_SOFTWARE = FALSE
  138.                 set OEM_ABANDON_ON = TRUE
  139.                 set ActivateDetection = TRUE
  140.     endif
  141.     Debug-Output "OEMNADN2.INF: =================================================="
  142.     Debug-Output "OEMNADN2.INF: STF_CWDIR is: "$(!STF_CWDIR)
  143.     Debug-Output "OEMNADN2.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  144.     Debug-Output "OEMNADN2.INF: Option is: "$(Option)
  145.     Debug-Output "OEMNADN2.INF: !STF_NCDETECT  is: "$(!STF_NCDETECT)
  146.     Debug-Output "OEMNADN2.INF: !STF_NCOPTION  is: "$(!STF_NCOPTION)
  147.     Debug-Output "OEMNADN2.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  148.     Debug-Output "OEMNADN2.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  149.     Debug-Output "OEMNADN2.INF: =================================================="
  150.     Set DetectedCard = FALSE
  151. ;   set PCMCIA = 0
  152.     set CardType = 0
  153.     Ifstr(i) $(ActivateDetection) != TRUE
  154.         Goto skipdetection
  155.     Endif
  156. ;85-11-7, add one variable for inputing Ethernet IDs.
  157.     set SelectedID = ""
  158. ;85-11-6, delete these statements, need not input IRQ and IOBASE
  159. ;   Set TypeList = {{IRQ,IRQList,IRQValue},+
  160. ;                   {PCMCIA, PCMCIAList, PCMCIA},+
  161. ;                   {IOADDR, IOBaseAddrDecList, IOBaseAddrValue}}
  162. ;   Debug-Output "OEMNADN2.INF: Calling Param_BuildTypeLists"
  163. ;   Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  164. ;   Set Status = $($R0)
  165. ;   ifstr(i) $(Status) != STATUS_SUCCESSFUL
  166. ;       Goto fataldetect
  167. ;   Endif
  168. ;   Debug-Output "OEMNADN2.INF: Calling Param_SetDefaults"
  169. ;   Shell $(ParamInf) Param_SetDefaults {}
  170. ;   Shell $(ParamInf) HexListFromDecList $(IOBaseAddrDecList)
  171. ;   Set IOBaseAddrHexList = $($R0)
  172. ;   Shell $(UtilityInf) SortList $(IRQList) TRUE FALSE
  173. ;   Set IRQList = $($R0)
  174. ;   Ifstr(i) $(!STF_NCDETECT) == YES
  175. ;       Ifstr(i) $(!STF_NCOPTION) == $(Option)
  176. ;          Set DetectedCard = TRUE
  177. ;          Debug-Output "OEMNADN2.INF: Setting DetectedCard to TRUE"
  178. ;       Endif
  179. ;   Endif
  180. skipdetection =+
  181.     set from = $(fatal)
  182.     set to = $(fatal)
  183.     goto $(StartLabel)
  184. installadapter = +
  185.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  186.     Ifstr $(KeyProduct) != $(KeyNull)
  187.         CloseRegKey $(KeyProduct)
  188.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  189.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftware$(Option)Title),+
  190.                $(ProductVersion)
  191.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  192.                Debug-Output "ShellCode error: cannot get an error string."
  193.                goto ShellCodeError
  194.            endif
  195.            goto end
  196.         else
  197.            Shell $(UtilityInf), CardExistedDlg
  198.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  199.                Debug-Output "ShellCode error: cannot get an error string."
  200.                goto ShellCodeError
  201.            endif
  202.            ifstr(i) $($R1) != "OK"
  203.                set CommonStatus = STATUS_USERCANCEL
  204.                goto end
  205.            endif
  206.            set OldVersionExisted = $(TRUE)
  207.         endif
  208.     endif
  209.     Ifstr(i) $(DetectedCard) != TRUE
  210.         Goto adaptersetup
  211.     Endif
  212.     StartWait
  213.     Shell $(ParamInf) Param_QueryCard $(!STF_NCDETCARD)
  214.     EndWait
  215.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  216.         Goto adaptersetup
  217.     Endif
  218.     Set DetectedParams = $($R1)
  219.     Debug-Output "OEMNADN2.INF: Calling Param_SetDefaults to merge detected params"
  220.     Shell $(ParamInf) Param_SetDefaults $(DetectedParams)
  221.     goto adapteroptions
  222. configureadapter = +
  223.     Ifstr $(KeyProduct) == $(KeyNull)
  224.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  225.         Ifstr $(KeyProduct) == $(KeyNull)
  226.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  227.             Debug-Output "Cannot find component product key"
  228.             goto fatalregistry
  229.         Endif
  230.     Endif
  231.     Debug-Output "INF: Shelling to FindService"
  232.     Shell $(UtilityInf) FindService, $(KeyProduct)
  233.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  234.         Debug-Output "INF: FindService shell failure"
  235.         Goto ShellCodeError
  236.     Endif
  237.     Ifstr(i) $($R0) != NO_ERROR
  238.         Debug-Output "INF: FindService Shell error: "$($R0)
  239.         Goto fatalregistry
  240.     endif
  241.     set KeyParameters = $($R2)
  242.     CloseRegKey $($R1)
  243.     Ifstr $(KeyParameters) == $(KeyNull)
  244.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  245.         Debug-Output "Cannot find component service"
  246.         goto fatalregistry
  247.     endif
  248.     set OldVersionExisted = $(TRUE)
  249.     set ValueName = ""
  250.     set ValueData = ""
  251.     set ValueStr  = ""
  252.     set ValueList = {}
  253.     EnumRegValue $(KeyParameters) ValueList
  254. ;85-11-6
  255.     ForListDo $(ValueList)
  256.         set ValueItem = $($)
  257.         set ValueName = *($(ValueItem),1)
  258.         set ValueData = *($(ValueItem),4)
  259. ;       Ifstr(i) $(ValueName) == "InterruptNumber"
  260. ;           set IRQValue = $(ValueData)
  261. ;       else-ifstr(i) $(ValueName) == "IoBaseAddress"
  262. ;           set IOBaseAddrValue = $(ValueData)
  263. ;       else-ifstr(i) $(ValueName) == "BusType"
  264.         ifstr(i) $(ValueName) == "BusType"      ;keep for 2CPUs
  265.             set BusInterfaceType = $(ValueData)
  266. ;       else-ifstr(i) $(ValueName) == "PCMCIA"
  267. ;           set PCMCIA = $(ValueData)
  268. ;       else-ifstr(i) $(ValueName) == "BusNumber"
  269. ;           set BusNumber = $(ValueData)
  270.         else-ifstr(i) $(ValueName) == "SelectedID" ;add for "SelectedID"
  271.             set SelectedID =  $(ValueData)
  272.         endif
  273.     EndForListDo
  274. ;   ifstr(i) $(IRQValue) == ""
  275. ;       set IRQValue = *($(IRQList), 2)
  276. ;   endif
  277. ;   ifstr(i) $(IOBaseAddrValue) == ""
  278. ;       set IOBaseAddrValue = *($(IOBaseAddrDecList), 1)
  279. ;   endif
  280. adaptersetup =+
  281.     Shell $(ParamInf) Param_ParameterConfidence
  282.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  283.         Debug-Output "OEMNADE2.INF: parameter confidence too low to bypass configuration"
  284.         Goto adapteroptions
  285.     Endif
  286.     Ifstr(i) $(DetectedCard) == TRUE
  287.         Ifstr(i) $(!STF_INSTALL_MODE) != CUSTOM
  288.             Goto adapterverify
  289.         Endif
  290.     Endif
  291.     goto adapteroptions
  292. adapteroptions = +
  293.     set from = adapteroptions
  294. ;85-11-6, this section is used to set BusInterfaceType, delete.
  295. ;   ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  296. ;       ifstr(i) $(!AutoNetInterfaceType) != ""
  297. ;           set BusInterfaceType = $(!AutoNetInterfaceType)
  298. ;       else
  299. ;           set BusInterfaceType = 1
  300. ;       endif
  301. ;       ifstr(i) $(!AutoNetBusNumber) != ""
  302. ;           set BusNumber = $(!AutoNetBusNumber)
  303. ;       else
  304. ;           set BusNumber = 0
  305. ;       endif
  306. ;       goto adapterverify
  307. ;   endif
  308. ;85-11-6, this section will open a window to let user to input IRQ and IOBASE,
  309. ;          delete.
  310. ;   set IOBaseAddress = *($(IOBaseAddrHexList), ~($(IOBaseAddrDecList),+
  311. ;       $(IOBaseAddrValue)))
  312. ;   read-syms FileDependentDlg$(!STF_LANGUAGE)
  313. ;   ui start "InputDlg"
  314. ;   ifstr(i) $(DLGEVENT) == "CONTINUE"
  315. ;               set IRQValue = $(Combo1Out)
  316. ;               set IOBaseAddress = $(Combo2Out)
  317. ;               ui pop 1
  318. ;   else-ifstr(i) $(DLGEVENT) == "BACK"
  319. ;               set CommonStatus = STATUS_USERCANCEL
  320. ;               Debug-Output "Action: exit. Bye."
  321. ;               ui pop 1
  322. ;               goto end
  323. ;   else
  324. ;               ui pop 1
  325. ;               Debug-Output "Action: unknown. Bye."
  326. ;               goto end
  327. ;   endif
  328. ;   set IOBaseAddrValue = *($(IOBaseAddrDecList), ~($(IOBaseAddrHexList),+
  329. ;       $(IOBaseAddress)))
  330. ;85-11-6, this section will open a window to let user input BysType, delete.
  331. ;   ifstr(i) $(!STF_NCDETINFO) == {}
  332. ;       ifint $(PCMCIA) != 1
  333. ;           Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
  334. ;           ifint $($ShellCode) != $(!SHELL_CODE_OK)
  335. ;               Debug-Output "ShellCode error."
  336. ;               goto ShellCodeError
  337. ;           endif
  338. ;           set BusInterfaceType = $($R1)
  339. ;           set BusNumber = $($R2)
  340. ;       else
  341. ;           set BusInterfaceType = 1    ;1->ISA
  342. ;           set BusNumber = 0
  343. ;       endif
  344. ;   else
  345. ;       set BusInterfaceType = *($(!STF_NCDETINFO),5)
  346. ;       set BusNumber = *($(!STF_NCDETINFO),6)
  347. ;   endif
  348. ;85-11-7, ;keep for 2CPU, 5->PCI
  349.     set BusInterfaceType = 5
  350. ;85-11-7, this section will open a window to let user input Ethernet ID.
  351.     read-syms CustomMessageDlg$(!STF_LANGUAGE)
  352.     ui start "InputDlg"
  353.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  354.                 set SelectedID = $(EditTextOut)
  355.                 ui pop 1
  356.     else-ifstr(i) $(DLGEVENT) == "EXIT"
  357.                 ui pop 1
  358.     else
  359.                 ui pop 1
  360.                 Debug-Output "Action: unknown. Bye."
  361.                 goto end
  362.     endif
  363. adapterverify =+
  364.     Ifstr(i) $(DetectedCard) != TRUE
  365.         Goto skipoptions
  366.     Endif
  367.     Debug-Output "OEMNADN2.INF: Calling Param_VerifyCard"
  368.     Shell $(ParamInf) Param_VerifyCard $(!STF_NCDETCARD)
  369.     Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  370.         Debug-Output "OEMNADN2.INF: Param_VerifyCard succeeded"
  371.         Goto skipoptions
  372.     Endif
  373.     Set from = adapteroptions
  374.     Set to = skipoptions
  375.     Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
  376.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  377.         Debug-Output "ShellCode error: cannot get an error string."
  378.         goto ShellCodeError
  379.     endif
  380.     set Error = $($R0)
  381.     Goto Warning
  382. skipoptions =+
  383.     ifint $(OldVersionExisted) == $(TRUE)
  384.         ifstr(i) $(!NTN_InstallMode) == configure
  385.                 goto writeparameters
  386.         endif
  387.     endif
  388.     StartWait
  389.     ifint $(OldVersionExisted) == $(FALSE)
  390.         ifstr(i) $(!NTN_InstallMode) == "install"
  391.                 Ifstr(i) $(DoCopy) == "YES"
  392.                     Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  393.                     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  394.                         Goto ShellCodeError
  395.                     Else-Ifstr(i) $($R0) == STATUS_FAILED
  396.                         Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  397.                         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  398.                            goto ShellCodeError
  399.                         endif
  400.                         set Error = $($R0)
  401.                         Goto fatal
  402.                     Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  403.                         Goto successful
  404.                     Endif
  405.                     Set SrcDir = $($R1)
  406.                 Endif
  407.                 install "Install-Option"
  408.                 ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  409.                     Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  410.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  411.                         goto ShellCodeError
  412.                     endif
  413.                     set Error = $($R0)
  414.                     goto fatal
  415.                 endif
  416.         endif
  417.        Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  418.                         $(ProductSoftwareName), +
  419.                         $(ProductSoftwareName), +
  420.                         $(ProductSoftware$(Option)Title), $(STF_CONTEXTINFNAME), +
  421.                         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  422.                         $(NetEventDLL)
  423.        Set OEM_ABANDON_SOFTWARE = TRUE
  424.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  425.         Debug-Output "ShellCode error"
  426.         goto ShellCodeError
  427.        endif
  428.        set RegistryErrorIndex = $($R0)
  429.        set KeyProduct      = $($R1)
  430.        Set SoftNetRulesKey = $($R2)
  431.        CloseRegKey $($R3)
  432.        CloseRegKey $($R4)
  433.        CloseRegKey $($R5)
  434.        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  435.         EndWait
  436.         Debug-Output "Registry error: add software components"
  437.         CloseRegKey $(KeyProduct)
  438.         CloseRegKey $(SoftNetRulesKey)
  439.         goto fatalregistry
  440.        endif
  441.        set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  442.                    {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  443.                    {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  444.                    {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftware$(Option)Title)},+
  445.                    {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftware$(Option)Description)},+
  446.                    {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  447.                    {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  448.        Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  449.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  450.         Debug-Output "ShellCode error."
  451.         goto ShellCodeError
  452.        endif
  453.        set RegistryErrorIndex = $($R0)
  454.        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  455.         EndWait
  456.         Debug-Output "Registry error: add value list."
  457.         CloseRegKey $(KeyProduct)
  458.         CloseRegKey $(SoftNetRulesKey)
  459.         goto fatalregistry
  460.        endif
  461.        set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  462.                         {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  463.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  464.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  465.                         {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  466.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  467.        Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  468.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  469.         Debug-Output "ShellCode error."
  470.         goto ShellCodeError
  471.        endif
  472.        set RegistryErrorIndex = $($R0)
  473.        CloseRegKey $(KeyProduct)
  474.        CloseRegKey $(SoftNetRulesKey)
  475.        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  476.         EndWait
  477.         Debug-Output "Resgitry error: add value list."
  478.         goto fatalregistry
  479.        endif
  480.     endif
  481.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  482.     ifint $($R4) != -1
  483.                 Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  484.     endif
  485.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  486.                 Debug-Output "Cannot add hardware component"
  487.                 goto ShellCodeError
  488.     endif
  489.     set RegistryErrorIndex = $($R0)
  490.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  491.                 EndWait
  492.                 Debug-Output "Registry error: add hardware component"
  493.                 CloseRegKey $($R1)
  494.                 CloseRegKey $($R2)
  495.                 CloseRegKey $($R3)
  496.                 goto fatalregistry
  497.     endif
  498.     set KeyParameters = $($R3)
  499.     set KeyAdapterRules = $($R2)
  500.     set AdapterNumber = $($R4)
  501.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  502.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  503.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  504.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  505.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  506.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  507.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  508.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  509.                 Debug-Output "ShellCode error"
  510.                 goto ShellCodeError
  511.     endif
  512.     CloseRegKey $($R1)
  513.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  514.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  515.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  516.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  517.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  518.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  519.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  520.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  521.                 Debug-Output "ShellCode error."
  522.                 goto ShellCodeError
  523.     endif
  524.     set RegistryErrorIndex = $($R0)
  525.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  526.                 EndWait
  527.                 Debug-Output "Resgitry error: add value list."
  528.                 CloseRegKey $(KeyParameters)
  529.                 CloseRegKey $(KeyAdapterRules)
  530.                 goto fatalregistry
  531.     endif
  532.     CloseRegKey $(KeyAdapterRules)
  533.     goto writeparameters
  534. writeparameters = +
  535. ;85-11-7, only for PCMCIA case
  536. ;   ifint $(BusInterfaceType) == 8
  537. ;       set PCMCIA = 1
  538. ;       set BusInterfaceType = 1
  539. ;   endif
  540. ;85-11-7, this section will increase some keywords into the Configuration
  541. ;         Registry Database, delete.
  542. ;   set NewValueList = {{InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IRQValue)},+
  543. ;                      {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
  544. ;                      {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
  545. ;                      {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  546. ;                      {CardType,$(NoTitle),$(!REG_VT_DWORD),0},+
  547. ;                      {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)}}
  548. ;85-11-7, add for 2CPU, keep "BustType" and "BusNumber".
  549. ;85-11-7, this section is increased for adding 'SelectedID' keyword to
  550.     set NewValueList = {{SelectedID,$(NoTitle),$(!REG_VT_SZ),$(SelectedID)},+
  551.                        {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
  552.                        {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)}}
  553.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  554. ;85-11-7, delete PCMCIA case
  555. ;   ifint $(PCMCIA) == 1
  556. ;       set NewValueList = {{Pcmcia,$(NoTitle),$(!REG_VT_DWORD),1}}
  557. ;       Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  558. ;   else
  559. ;       DeleteRegValue $(KeyParameters) "Pcmcia"
  560. ;   endif
  561.     ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  562.         Shell $(UtilityInf),AddDefaultNetCardParameters,$(KeyParameters)
  563.     endif
  564.     CloseRegKey $(KeyParameters)
  565.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  566.                 Debug-Output "ShellCode error."
  567.                 goto ShellCodeError
  568.     endif
  569.     set RegistryErrorIndex = $($R0)
  570.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  571.                 Debug-Output "Registry error: Add value list"
  572.                 goto fatalregistry
  573.     endif
  574.     EndWait
  575.     goto successful
  576. bindingadapter =+
  577.     set Error = "Binding: Sorry, not yet implemented."
  578.     goto fatal
  579. removeadapter = +
  580.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  581.                 Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  582.                                 $(ProductSoftwareName)
  583.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  584.                                 Debug-Output "ShellCode error"
  585.                                 goto ShellCodeError
  586.                 endif
  587.                 set RegistryErrorIndex = $($R0)
  588.                 Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  589.                                 goto fatalregistry
  590.                 endif
  591.     else
  592.                 Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  593.                         $(ProductSoftwareName), $(!NTN_RegBase)
  594.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  595.                                 Debug-Output "ShellCode error"
  596.                                 goto ShellCodeError
  597.                 endif
  598.                 set RegistryErrorIndex = $($R0)
  599.                 Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  600.                                 goto fatalregistry
  601.                 endif
  602.     endif
  603.     goto end
  604. UpgradeSoftware = +
  605.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  606.     Ifstr $(KeyProduct) != $(KeyNull)
  607.         install "Install-Update"
  608.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  609.             goto fatal
  610.         endif
  611.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  612.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  613.         CloseRegKey $(KeyProduct)
  614.     else
  615.         goto fatalregistry
  616.     endif
  617.     goto end
  618. successful = +
  619.     goto end
  620. abandon = +
  621.     ForListDo $(OEM_ABANDON_OPTIONS)
  622.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  623.             $(ProductSoftwareName), $($)
  624.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  625.             Debug-Output "ShellCode error"
  626.             goto ShellCodeError
  627.         endif
  628.         set RegistryErrorIndex = $($R0)
  629.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  630.             goto fatalregistry
  631.         endif
  632.     EndForListDo
  633.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  634.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  635.             $(ProductSoftwareName), FALSE
  636.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  637.             Debug-Output "ShellCode error"
  638.             goto ShellCodeError
  639.         endif
  640.         set RegistryErrorIndex = $($R0)
  641.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  642.             goto fatalregistry
  643.         endif
  644.     endif
  645.     goto end
  646. warning = +
  647.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  648.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  649.         goto ShellCodeError
  650.     endif
  651.     ifstr(i) $($R1) == "OK"
  652.         goto $(to)
  653.     else-ifstr(i) $($R1) == "CANCEL"
  654.         goto $(from)
  655.     else
  656.         goto "end"
  657.     endif
  658. nonfatalinfo = +
  659.     Set CommonStatus = STATUS_USERCANCEL
  660.     Set Severity = STATUS
  661.     goto nonfatalmsg
  662. nonfatal = +
  663.     Set Severity = NONFATAL
  664.     goto nonfatalmsg
  665. nonfatalmsg = +
  666.     ifstr(i) $(Error) == ""
  667.         Set Severity = NONFATAL
  668.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  669.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  670.             goto ShellCodeError
  671.         endif
  672.         set Error = $($R0)
  673.     endif
  674.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  675.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  676.         goto ShellCodeError
  677.     endif
  678.     ifstr(i) $($R1) == "OK"
  679.         goto $(from)
  680.     else
  681.         goto "end"
  682.     endif
  683. fatalregistry = +
  684.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  685.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  686.         goto ShellCodeError
  687.     endif
  688.     set Error = $($R0)
  689.     goto fatal
  690. fataldetect = +
  691.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  692.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  693.         Debug-Output "ShellCode error: cannot get an error string."
  694.         goto ShellCodeError
  695.     endif
  696.     set Error = $($R0)
  697.     Goto fatal
  698. fatal = +
  699.     ifstr(i) $(Error) == ""
  700.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  701.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  702.             goto ShellCodeError
  703.         endif
  704.         set Error = $($R0)
  705.     endif
  706.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  707.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  708.         goto ShellCodeError
  709.     endif
  710.     goto setfailed
  711. ShellCodeError = +
  712.     set DlgType      = "MessageBox"
  713.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  714.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  715.     set STF_MB_TYPE  = 1
  716.     set STF_MB_ICON  = 3
  717.     set STF_MB_DEF   = 1
  718.     ui start "Error Message"
  719.     goto setfailed
  720. setfailed = +
  721.     set CommonStatus = STATUS_FAILED
  722.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  723.         set OEM_ABANDON_ON = FALSE
  724.         goto abandon
  725.     endif
  726.     goto end
  727. end = +
  728.     goto term
  729. term = +
  730.     Return $(CommonStatus)
  731. [Install-Option]
  732.     set STF_VITAL = ""
  733.     ifstr(i) $(AddCopy) == "YES"
  734.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  735.     endif
  736.     ifstr(i) $(DoCopy) == "YES"
  737.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  738.        CopyFilesInCopyList
  739.     endif
  740.     ifstr(i) $(DoConfig) == "YES"
  741.     endif
  742.     Exit
  743. [Install-Update]
  744.    set STF_VITAL        = ""
  745.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  746.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  747.    exit
  748. [Source Media Descriptions]
  749.     1 = "Winbond W89C940 OEM Drivers Disk"
  750. [Signature]
  751.     FileType = MICROSOFT_FILE
  752. [GetSignature]
  753.     read-syms Signature
  754.     return $(FileType)
  755. [ProductType]
  756. STF_PRODUCT  = Winnt
  757. STF_PLATFORM = I386
  758. [Files-Inf]
  759. 1,      oemsetup.inf,    SIZE=30000,     RENAME=$(!UG_Filename)
  760. [Files-W940ND]
  761. 1,W940ND.SYS , SIZE=24576
  762. [LanguagesSupported]
  763.     ENG
  764. [OptionsTextENG]
  765.     W940ND              = "Winbond 940 PCI Adapter"
  766. [FileConstantsENG]
  767. ProCaption   = "Windows NT Setup"
  768. ProCancel    = "Cancel"
  769. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  770.                "Are you sure you want to cancel copying files?"
  771. ProCancelCap = "Network Setup Message"
  772. ProText1     = "Copying:"
  773. ProText2     = "To:"
  774. FunctionTitle   = "Winbond 940 PCI Network Card Setup"
  775. ProductSoftwareW940NDDescription      = "Winbond 940 PCI Adapter Driver"
  776. ProductHardwareW940NDDescription        = "Winbond 940 PCI Adapter"
  777. ProductSoftwareW940NDTitle    = "Winbond 940 PCI Adapter Driver"
  778. ProductHardwareW940NDTitle      = "Winbond 940 PCI Adapter"
  779. ShellCodeErrorTitle     = "Error: "$(FunctionTitle)
  780. ShellCodeErrorText      = "Shell Code Error."
  781. [DialogConstantsENG]
  782. Help        = "&Help"
  783. Exit        = "Cancel"
  784. OK          = "OK"
  785. HelpContext = ""
  786. Continue    = "Continue"
  787. Cancel      = "Cancel"
  788. ;85-11-7, this section is ised to define the input dialog for inputing IRQ and
  789. ;         IOBASE, delete.
  790. ;[FileDependentDlgENG]
  791. ;Label1 = "&IRQ Level:"
  792. ;Label2 = "I/O &Port Address:"
  793. ;DlgType = "RadioCombination"
  794. ;DlgTemplate = "NE2000"
  795. ;Caption = $(FunctionTitle)
  796. ;Combo1List = $(IRQList)
  797. ;Combo1Out  = $(IRQValue)
  798. ;Combo2List = $(IOBaseAddrHexList)
  799. ;Combo2Out  = $(IOBaseAddress)
  800. ;ComboListItemsIn  = {Combo1List, Combo2List}
  801. ;ComboListItemsOut = {Combo1Out, Combo2Out}
  802. ;EditTextIn = ""
  803. ;EditTextLim = ""
  804. ;CBOptionsGreyed = {}
  805. ;NotifyFields = {NO, NO}
  806. ;HelpContext = $(!IDH_DB_OEMNADN2_INS)
  807. ;85-11-7, add for "SelectedID"
  808. [CustomMessageDlgENG]
  809. Caption        = "Input Ethernet ID"
  810. DlgText        = "Please input the Ethernet ID to select a special 940 adapter."$(!LF)+
  811.                  "For example:"$(!LF)+
  812.                  "        Ethernet ID: 00E802030405"$(!LF)$(!LF)+
  813.                  "(Select Ignore if you want the driver to work on any free "+
  814.                  "940 adapter.)"
  815. Edit1Label  = "&Ethernet ID:"
  816. Continue       = "&OK"
  817. Exit           = "&Ignore"
  818. Help           = "&Help"
  819. DlgType        = "Edit"
  820. DlgTemplate    = "QUERY_COMPUTER_NAME"
  821. EditTextLim    = 12
  822. EditTextIn     = $(SelectedID)
  823. EditFocus      = "ALL"
  824.