home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 January / VPR0001A.ISO / DRIVER / MELCO / LPC3TX / LPC3TX.EXE / OEMSETUP.INF < prev    next >
INI File  |  1999-07-02  |  31KB  |  792 lines

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