home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / d / d423_zhw / 8.ddi / OEMNADE2.IN_ / OEMNADE2.IN
Encoding:
INI File  |  1993-07-24  |  32.8 KB  |  856 lines

  1. [Identification]
  2.     OptionType = NetAdapter
  3. [PlatformsSupported]
  4.     ISA
  5.     EISA
  6.     "Jazz-Internal Bus"
  7. [Options]
  8.     ELNKII
  9. [FileConstants]
  10. UtilityInf      = "UTILITY.INF"
  11. ParamInf        = "NCPARAM.INF"
  12. subroutineinf   = "SUBROUTN.INF"
  13. SoftwareType    = "driver"
  14. Exit_Code       = 0
  15. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  16. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  17. Manufacturer    = "Microsoft"
  18. ProductMajorVersion     = "3"
  19. ProductMinorVersion     = "1"
  20. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  21. ProductSoftwareName     = "Elnkii"
  22. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\elnkii.sys"
  23. NetRuleSoftwareType     = "elnkiiSys ndisDriver elnkiiDriver"
  24. NetRuleSoftwareUse      = $(SoftwareType)
  25. NetRuleSoftwareBindForm = """ElnkIISys"" yes no container"
  26. NetRuleSoftwareClass    = {"elnkiiDriver basic"}
  27. NetRuleSoftwareBindable = {"elnkiiDriver elnkiiAdapter non exclusive 100"}
  28. ProductHardwareName     = "Elnkii"
  29. NetRuleHardwareType     = "elnkii elnkiiAdapter"
  30. NetRuleHardwareBindForm = " yes yes container"
  31. NetRuleHardwareClass    = {"elnkiiAdapter basic"}
  32. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  33. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  34. [GeneralConstants]
  35. from      = ""
  36. to        = ""
  37. ExitCodeOk     = 0
  38. ExitCodeCancel = 1
  39. ExitCodeFatal  = 2
  40. KeyNull         = ""
  41. MAXIMUM_ALLOWED   = 33554432
  42. RegistryErrorIndex = NO_ERROR
  43. KeyProduct      = ""
  44. KeyParameters   = ""
  45. TRUE            = 1
  46. FALSE           = 0
  47. NoTitle            = 0
  48. ExitState   = "Active"
  49. OldVersionExisted = $(FALSE)
  50. DriverPath      = $(!STF_NTPATH)\drivers
  51. [date]
  52.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  53. [Identify]
  54.     read-syms Identification
  55.     set Status     = STATUS_SUCCESSFUL
  56.     set Identifier = $(OptionType)
  57.     set Media      = #("Source Media Descriptions", 1, 1)
  58.     Return $(Status) $(Identifier) $(Media)
  59. [ReturnOptions]
  60.     set Status        = STATUS_FAILED
  61.     set OptionList     = {}
  62.     set OptionTextList = {}
  63.     set LanguageList = ^(LanguagesSupported, 1)
  64.     Ifcontains(i) $($0) in $(LanguageList)
  65.         ifstr(i) $($1) == ""
  66.                         goto returnoptions
  67.         endif
  68.         set PlatformList = ^(PlatformsSupported, 1)
  69.         Ifcontains(i) $($1) in $(PlatformList)
  70.                         goto returnoptions
  71.         else
  72.                         set Status = STATUS_NOTSUPPORTED
  73.                         goto finish_ReturnOptions
  74.         endif
  75.     else
  76.                 set Status = STATUS_NOLANGUAGE
  77.                 goto finish_ReturnOptions
  78.     endif
  79. returnoptions = +
  80.     set OptionList     = ^(Options, 1)
  81.     set OptionTextList = ^(OptionsText$($0), 1)
  82.     set Status         = STATUS_SUCCESSFUL
  83. finish_ReturnOptions = +
  84.     Return $(Status) $(OptionList) $(OptionTextList)
  85. [InstallOption]
  86.     set Status   = STATUS_FAILED
  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 Elink II 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 ActivateDetection = TRUE
  136.         set StartLabel = installadapter
  137.         set OEM_ABANDON_OPTIONS = {}
  138.         set OEM_ABANDON_SOFTWARE = FALSE
  139.         set OEM_ABANDON_ON = TRUE
  140.     endif
  141.     Debug-Output "OEMNADE2.INF: =================================================="
  142.     Debug-Output "OEMNADE2.INF: STF_CWDIR is: "$(!STF_CWDIR)
  143.     Debug-Output "OEMNADE2.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  144.     Debug-Output "OEMNADE2.INF: Option is: "$(Option)
  145.     Debug-Output "OEMNADE2.INF: !STF_NCDETECT  is: "$(!STF_NCDETECT)
  146.     Debug-Output "OEMNADE2.INF: !STF_NCOPTION  is: "$(!STF_NCOPTION)
  147.     Debug-Output "OEMNADE2.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  148.     Debug-Output "OEMNADE2.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  149.     Debug-Output "OEMNADE2.INF: =================================================="
  150.     Set DetectedCard = FALSE
  151.     Ifstr(i) $(ActivateDetection) != TRUE
  152.         Goto $(StartLabel)
  153.     Endif
  154.     Set TypeList = {{IRQ, IRQ_List, IRQ_Level},+
  155.                     {IOADDR, IOADDR_Addr_List, IOBaseAddrValue},+
  156.                     {MEMADDR, MemBaseAddrDecList, MemBaseAddrDec},+
  157.                     {TRANSCEIVER, TranceiverValueList, TransceiverValue}+
  158.                     {MEMLENGTH, MemLengthList, NONE}}
  159.     Debug-Output "OEMNADE2.INF: Calling Param_BuildTypeLists"
  160.     Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  161.     Set Status = $($R0)
  162.     ifstr(i) $(Status) != STATUS_SUCCESSFUL
  163.         Goto fataldetect
  164.     Endif
  165.     Debug-Output "OEMNADE2.INF: Calling Param_SetDefaults"
  166.     Shell $(ParamInf) Param_SetDefaults {}
  167.     Shell $(ParamInf) HexListFromDecList $(IOADDR_Addr_List)
  168.     Set IOADDR_Hex_List = $($R0)
  169.     Shell $(UtilityInf) SortList $(IRQ_List) TRUE FALSE
  170.     Set IRQ_List = $($R0)
  171.     Ifstr(i) $(!STF_NCDETECT) == YES
  172.         Ifstr(i) $(!STF_NCOPTION) == $(Option)
  173.            Set DetectedCard = TRUE
  174.            Debug-Output "OEMNADE2.INF: Setting DetectedCard to TRUE"
  175.         Endif
  176.     Endif
  177.     Set MappedValue = 1
  178.     Ifint $(MemBaseAddrDec) == 0
  179.        Set MappedValue = 0
  180.     Endif
  181.     Shell "" DebugConfiguration "After parameter querying"
  182.     Set from = $(fatal)
  183.     Set to = $(fatal)
  184.     Goto $(StartLabel)
  185. installadapter = +
  186.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  187.     Ifstr $(KeyProduct) != $(KeyNull)
  188.         CloseRegKey $(KeyProduct)
  189.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  190.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  191.                $(ProductVersion)
  192.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  193.                Debug-Output "ShellCode error: cannot get an error string."
  194.                goto ShellCodeError
  195.            endif
  196.            goto end
  197.         else
  198.            Shell $(UtilityInf), CardExistedDlg
  199.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  200.                Debug-Output "ShellCode error: cannot get an error string."
  201.                goto ShellCodeError
  202.            endif
  203.            ifstr(i) $($R1) != "OK"
  204.                set CommonStatus = STATUS_USERCANCEL
  205.                goto end
  206.            endif
  207.            set OldVersionExisted = $(TRUE)
  208.         endif
  209.     endif
  210.     Set CurrParamSettings = {}
  211.     Ifstr(i) $(DetectedCard) != TRUE
  212.         Goto adaptersetup
  213.     Endif
  214.     StartWait
  215.     Shell $(ParamInf) Param_QueryCard $(!STF_NCDETCARD)
  216.     EndWait
  217.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  218.         Goto adaptersetup
  219.     Endif
  220.     Set DetectedParams = $($R1)
  221.     Debug-Output "OEMNADE2.INF: Calling Param_SetDefaults to merge detected params"
  222.     Shell $(ParamInf) Param_SetDefaults $(DetectedParams)
  223.     goto adaptersetup
  224. configureadapter = +
  225.     Ifstr $(KeyProduct) == $(KeyNull)
  226.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  227.         Ifstr $(KeyProduct) == $(KeyNull)
  228.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  229.             Debug-Output "Cannot find component product key"
  230.             goto fatalregistry
  231.         Endif
  232.     Endif
  233.     Debug-Output "INF: Shelling to FindService"
  234.     Shell $(UtilityInf) FindService, $(KeyProduct)
  235.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  236.         Debug-Output "INF: FindService shell failure"
  237.         Goto ShellCodeError
  238.     Endif
  239.     Ifstr(i) $($R0) != NO_ERROR
  240.         Debug-Output "INF: FindService Shell error: "$($R0)
  241.         Goto fatalregistry
  242.     endif
  243.     Set KeyParameters = $($R2)
  244.     CloseRegKey $($R1)
  245.     Ifstr $(KeyParameters) == $(KeyNull)
  246.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  247.         Debug-Output "Cannot find component service"
  248.         goto fatalregistry
  249.     endif
  250.     set OldVersionExisted = $(TRUE)
  251.     set ValueName = ""
  252.     set ValueData = ""
  253.     set ValueStr  = ""
  254.     set ValueList = {}
  255.     EnumRegValue $(KeyParameters) ValueList
  256.     ForListDo $(ValueList)
  257.         set ValueItem = $($)
  258.         set ValueName = *($(ValueItem),1)
  259.         set ValueData = *($(ValueItem),4)
  260.         Ifstr(i) $(ValueName) == "Transceiver"
  261.             set TransceiverValue = $(ValueData)
  262.         else-ifstr(i) $(ValueName) == "MemoryMapped"
  263.             set MappedValue = $(ValueData)
  264.         else-ifstr(i) $(ValueName) == "InterruptNumber"
  265.             set IRQ_Level = $(ValueData)
  266.         else-ifstr(i) $(ValueName) == "IoBaseAddress"
  267.             set IOBaseAddrValue = $(ValueData)
  268.         endif
  269.     EndForListDo
  270.     Shell $(ParamInf) Param_SaveValues
  271.     Set CurrParamSettings = $($R0)
  272. adaptersetup = +
  273.     Shell "" DebugConfiguration "before displaying dialog"
  274.     Set from = adapteroptions
  275.     Set IOADDR_Hex_Value = *($(IOADDR_Hex_List), ~($(IOADDR_Addr_List),$(IOBaseAddrValue)))
  276.     Ifint $(MappedValue) == 0
  277.         Set CheckItemsIn = {"OFF"}
  278.     Else
  279.         Set CheckItemsIn = {"ON"}
  280.     Endif
  281.     Ifint $(TransceiverValue) == 1
  282.         Set RadioIn = {1}
  283.     Else
  284.         Set RadioIn = {2}
  285.     Endif
  286.     Shell $(ParamInf) Param_ParameterConfidence
  287.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  288.         Debug-Output "OEMNADE2.INF: parameter confidence too low to bypass configuration"
  289.         Goto adapteroptions
  290.     Endif
  291.     Ifstr(i) $(DetectedCard) == TRUE
  292.         Ifstr(i) $(!STF_INSTALL_MODE) != CUSTOM
  293.             Goto adapterverify
  294.         Endif
  295.     Endif
  296. adapteroptions = +
  297.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  298.     ui start "InputDlg"
  299.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  300.         set IRQ_Level = $(Combo1Out)
  301.         set IOADDR_Hex_Value = $(Combo2Out)
  302.         set TransceiverTypeIndex = *($(RadioOut),1)
  303.         Ifint $(TransceiverTypeIndex) == 1
  304.             Set TransceiverValue = 1
  305.         Else
  306.             Set TransceiverValue = 2
  307.         Endif
  308.         Set Chk = *($(CheckItemsOut), 1)
  309.         Ifstr(i) $(Chk) == "ON"
  310.             Set MappedValue = 1
  311.         Else
  312.             Set MappedValue = 0
  313.         Endif
  314.         Ifint $(MappedValue) == 0
  315.             Set MemBaseAddrDec = 0
  316.         Else
  317.             Set MemBaseAddrDec = *($(MemBaseAddrDecList),2)
  318.         Endif
  319.         Set IOBaseAddrValue = *($(IOADDR_Addr_List), ~($(IOADDR_Hex_List),$(IOADDR_Hex_Value)))
  320.         ui pop 1
  321.     else-ifstr(i) $(DLGEVENT) == "BACK"
  322.         set CommonStatus = STATUS_USERCANCEL
  323.         Debug-Output "Action: exit. Bye."
  324.         ui pop 1
  325.         goto end
  326.     else
  327.         Debug-Output "Action: unknown. Bye."
  328.         ui pop 1
  329.         goto end
  330.     endif
  331. adapterverify = +
  332.     Shell "" DebugConfiguration "after running dialog"
  333.     Ifstr(i) $(DetectedCard) != TRUE
  334.         Shell $(ParamInf) Param_SaveValues
  335.         Set NewParamSettings = $($R0)
  336.         Ifstr(i) $(CurrParamSettings) == {}
  337.             Set DiffParamSettings = $(NewParamSettings)
  338.         Else
  339.             Shell $(ParamInf) Param_DiffValues $(CurrParamSettings)
  340.             Set DiffParamSettings = $($R0)
  341.         Endif
  342.         Debug-Output "OEMNADE2.INF: Calling Param_VerifyResources"
  343.         Shell $(ParamInf) Param_VerifyResources $(DiffParamSettings)
  344.         Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  345.             Debug-Output "OEMNADE2.INF: Param_VerifyResources succeeded"
  346.             Goto skipoptions
  347.         Endif
  348.     Else
  349.         Set CardVerifyIndex = $(!STF_NCDETCARD)
  350.         Debug-Output "OEMNADE2.INF: Calling Param_VerifyCard"
  351.         Shell $(ParamInf) Param_VerifyCard $(!STF_NCDETCARD)
  352.         Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  353.             Debug-Output "OEMNADE2.INF: Param_VerifyCard succeeded"
  354.             Goto skipoptions
  355.         Endif
  356.     Endif
  357.     Set from = adapteroptions
  358.     Set to = skipoptions
  359.     Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
  360.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  361.         Debug-Output "ShellCode error: cannot get an error string."
  362.         goto ShellCodeError
  363.     endif
  364.     set Error = $($R0)
  365.     Goto Warning
  366. skipoptions =+
  367.     ifint $(OldVersionExisted) == $(TRUE)
  368.         ifstr(i) $(!NTN_InstallMode) == configure
  369.             goto writeparameters
  370.         endif
  371.     endif
  372.     StartWait
  373.     ifint $(OldVersionExisted) == $(FALSE)
  374.         ifstr(i) $(!NTN_InstallMode) == "install"
  375.            Ifstr(i) $(DoCopy) == "YES"
  376.               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  377.               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  378.                   Goto ShellCodeError
  379.               Else-Ifstr(i) $($R0) == STATUS_FAILED
  380.                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  381.                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  382.                       goto ShellCodeError
  383.                   endif
  384.                   set Error = $($R0)
  385.                   Goto fatal
  386.               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  387.                   Goto successful
  388.               Endif
  389.               Set SrcDir = $($R1)
  390.            Endif
  391.            install "Install-Option"
  392.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  393.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  394.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  395.                   goto ShellCodeError
  396.               endif
  397.               set Error = $($R0)
  398.               goto fatal
  399.            endif
  400.         endif
  401.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  402.             $(ProductSoftwareName), +
  403.             $(ProductSoftwareName), +
  404.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  405.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  406.             $(NetEventDLL)
  407.         Set OEM_ABANDON_SOFTWARE = TRUE
  408.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  409.             Debug-Output "ShellCode error"
  410.             goto ShellCodeError
  411.         endif
  412.         set RegistryErrorIndex = $($R0)
  413.         set KeyProduct      = $($R1)
  414.         Set SoftNetRulesKey = $($R2)
  415.         CloseRegKey $($R3)
  416.         CloseRegKey $($R4)
  417.         CloseRegKey $($R5)
  418.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  419.             EndWait
  420.             Debug-Output "Registry error: add software components"
  421.             CloseRegKey $(KeyProduct)
  422.             CloseRegKey $(SoftNetRulesKey)
  423.             goto fatalregistry
  424.         endif
  425.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  426.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  427.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  428.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  429.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  430.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  431.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  432.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  433.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  434.             Debug-Output "ShellCode error."
  435.             goto ShellCodeError
  436.         endif
  437.         set RegistryErrorIndex = $($R0)
  438.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  439.             EndWait
  440.             Debug-Output "Registry error: add value list."
  441.             CloseRegKey $(KeyProduct)
  442.             CloseRegKey $(SoftNetRulesKey)
  443.             goto fatalregistry
  444.         endif
  445.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  446.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  447.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  448.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  449.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  450.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  451.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  452.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  453.             Debug-Output "ShellCode error."
  454.             goto ShellCodeError
  455.         endif
  456.         set RegistryErrorIndex = $($R0)
  457.         CloseRegKey $(KeyProduct)
  458.         CloseRegKey $(SoftNetRulesKey)
  459.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  460.             EndWait
  461.             Debug-Output "Resgitry error: add value list."
  462.             goto fatalregistry
  463.         endif
  464.     endif
  465.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  466.     ifint $($R4) != -1
  467.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  468.     endif
  469.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  470.         Debug-Output "Cannot add hardware component"
  471.         goto ShellCodeError
  472.     endif
  473.     set RegistryErrorIndex = $($R0)
  474.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  475.         EndWait
  476.         Debug-Output "Registry error: add hardware component"
  477.         CloseRegKey $($R1)
  478.         CloseRegKey $($R2)
  479.         CloseRegKey $($R3)
  480.         goto fatalregistry
  481.     endif
  482.     set KeyParameters = $($R3)
  483.     set KeyAdapterRules = $($R2)
  484.     set AdapterNumber = $($R4)
  485.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  486.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  487.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  488.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  489.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  490.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  491.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  492.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  493.         Debug-Output "ShellCode error"
  494.         goto ShellCodeError
  495.     endif
  496.     CloseRegKey $($R1)
  497.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  498.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  499.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  500.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  501.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  502.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  503.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  504.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  505.         Debug-Output "ShellCode error."
  506.         goto ShellCodeError
  507.     endif
  508.     set RegistryErrorIndex = $($R0)
  509.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  510.         EndWait
  511.         Debug-Output "Resgitry error: add value list."
  512.         CloseRegKey $(KeyParameters)
  513.         CloseRegKey $(KeyAdapterRules)
  514.         goto fatalregistry
  515.     endif
  516.     CloseRegKey $(KeyAdapterRules)
  517.     goto writeparameters
  518. writeparameters = +
  519.     Shell $(UtilityInf), GetBusTypeNum
  520.     set BusTypeNum = $($R1)
  521.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  522.         Debug-Output "ShellCode error."
  523.         goto ShellCodeError
  524.     endif
  525.     Set NewValueList = {{Transceiver,$(NoTitle),$(!REG_VT_DWORD),$(TransceiverValue)},+
  526.                        {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  527.                        {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  528.                        {MemoryMapped,$(NoTitle),$(!REG_VT_DWORD),$(MappedValue)},+
  529.                        {InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IRQ_Level)},+
  530.                        {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)}}
  531.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  532.     CloseRegKey $(KeyParameters)
  533.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  534.         Debug-Output "ShellCode error."
  535.         goto ShellCodeError
  536.     endif
  537.     set RegistryErrorIndex = $($R0)
  538.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  539.         Debug-Output "Registry error: Add value list"
  540.         goto fatalregistry
  541.     endif
  542.     EndWait
  543.     goto successful
  544. bindingadapter =+
  545.     set Error = "Binding: Sorry, not yet implemented."
  546.     goto fatal
  547. removeadapter = +
  548.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  549.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  550.             $(ProductSoftwareName)
  551.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  552.             Debug-Output "ShellCode error"
  553.             goto ShellCodeError
  554.         endif
  555.         set RegistryErrorIndex = $($R0)
  556.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  557.             goto fatalregistry
  558.         endif
  559.     else
  560.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  561.             $(ProductSoftwareName), $(!NTN_RegBase)
  562.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  563.             Debug-Output "ShellCode error"
  564.             goto ShellCodeError
  565.         endif
  566.         set RegistryErrorIndex = $($R0)
  567.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  568.             goto fatalregistry
  569.         endif
  570.     endif
  571.     goto end
  572. UpgradeSoftware = +
  573.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  574.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  575.         Ifstr $(KeyProduct) != $(KeyNull)
  576.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  577.             set Version = *($(VersionInfo), 4)
  578.             Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  579.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  580.                 Debug-Output "ShellCode error"
  581.                 goto ShellCodeError
  582.             endif
  583.             set !UG_Filename = $($R0)
  584.             ifstr(i) $(!UG_Filename) != ""
  585.                 install "Install-Update"
  586.                 ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  587.                     goto fatal
  588.                 endif
  589.             endif
  590.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  591.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  592.             ifint $(Version) != $(ProductVersion)
  593.             endif
  594.             CloseRegKey $(KeyProduct)
  595.         else
  596.             goto fatalregistry
  597.         endif
  598.     else
  599.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  600.               $(MAXIMUM_ALLOWED) NetworkCardKey
  601.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  602.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  603.             set ServiceName = *($(ServiceNameInfo), 4)
  604.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  605.                 $(MAXIMUM_ALLOWED) NetRuleKey
  606.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  607.             else
  608.                 goto fatalregistry
  609.             endif
  610.             CloseRegKey $(NetRules)
  611.             CloseRegKey $(NetworkCardKey)
  612.         else
  613.             goto fatalregistry
  614.         endif
  615.         OpenRegKey $(!REG_H_LOCAL) "" +
  616.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  617.               $(MAXIMUM_ALLOWED) ServiceKey
  618.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  619.             CloseRegKey $(ServiceKey)
  620.         else
  621.             goto fatalregistry
  622.         endif
  623.     endif
  624.     goto end
  625. successful = +
  626.     goto end
  627. abandon = +
  628.     ForListDo $(OEM_ABANDON_OPTIONS)
  629.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  630.             $(ProductSoftwareName), $($)
  631.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  632.             Debug-Output "ShellCode error"
  633.             goto ShellCodeError
  634.         endif
  635.         set RegistryErrorIndex = $($R0)
  636.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  637.             goto fatalregistry
  638.         endif
  639.     EndForListDo
  640.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  641.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  642.             $(ProductSoftwareName), FALSE
  643.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  644.             Debug-Output "ShellCode error"
  645.             goto ShellCodeError
  646.         endif
  647.         set RegistryErrorIndex = $($R0)
  648.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  649.             goto fatalregistry
  650.         endif
  651.     endif
  652.     goto end
  653. warning = +
  654.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  655.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  656.         goto ShellCodeError
  657.     endif
  658.     ifstr(i) $($R1) == "OK"
  659.         goto $(to)
  660.     else-ifstr(i) $($R1) == "CANCEL"
  661.         goto $(from)
  662.     else
  663.         goto "end"
  664.     endif
  665. nonfatalinfo = +
  666.     Set Severity = STATUS
  667.     Set CommonStatus = STATUS_USERCANCEL
  668.     goto nonfatalmsg
  669. nonfatal = +
  670.     Set Severity = NONFATAL
  671.     goto nonfatalmsg
  672. nonfatalmsg = +
  673.     ifstr(i) $(Error) == ""
  674.         Set Severity = NONFATAL
  675.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  676.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  677.             goto ShellCodeError
  678.         endif
  679.         set Error = $($R0)
  680.     endif
  681.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  682.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  683.         goto ShellCodeError
  684.     endif
  685.     ifstr(i) $($R1) == "OK"
  686.         goto $(from)
  687.     else
  688.         goto "end"
  689.     endif
  690. fatalregistry = +
  691.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  692.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  693.         goto ShellCodeError
  694.     endif
  695.     set Error = $($R0)
  696.     goto fatal
  697. fataldetect = +
  698.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  699.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  700.         Debug-Output "ShellCode error: cannot get an error string."
  701.         goto ShellCodeError
  702.     endif
  703.     set Error = $($R0)
  704.     Goto fatal
  705. fatal = +
  706.     ifstr(i) $(Error) == ""
  707.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  708.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  709.             goto ShellCodeError
  710.         endif
  711.         set Error = $($R0)
  712.     endif
  713.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  714.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  715.         goto ShellCodeError
  716.     endif
  717.     goto setfailed
  718. ShellCodeError = +
  719.     set DlgType      = "MessageBox"
  720.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  721.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  722.     set STF_MB_TYPE  = 1
  723.     set STF_MB_ICON  = 3
  724.     set STF_MB_DEF   = 1
  725.     ui start "Error Message"
  726.     goto setfailed
  727. setfailed = +
  728.     set CommonStatus = STATUS_FAILED
  729.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  730.         set OEM_ABANDON_ON = FALSE
  731.         goto abandon
  732.     endif
  733.     goto end
  734. end = +
  735.     goto term
  736. term = +
  737.     Return $(CommonStatus)
  738. [DebugConfiguration]
  739.     Set InfName = "OEMNADE2.INF"
  740.     Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  741.     Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  742.     Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  743.     Debug-Output $(InfName)" TransceiverValue is "$(!p:TransceiverValue)
  744.     Debug-Output $(InfName)" MemBaseAddrDec is "$(!p:MemBaseAddrDec)
  745.     Debug-Output $(InfName)" MappedValue is "$(!p:MappedValue)
  746.     return
  747. [Install-Option]
  748.     set STF_VITAL = ""
  749.     ifstr(i) $(AddCopy) == "YES"
  750.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  751.     endif
  752.     ifstr(i) $(DoCopy) == "YES"
  753.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  754.        CopyFilesInCopyList
  755.     endif
  756.     Exit
  757. [Install-Update]
  758.    set STF_VITAL        = ""
  759.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  760.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  761.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  762.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  763.    CopyFilesInCopyList
  764.    exit
  765. [Source Media Descriptions]
  766.     1    = "Windows NT Advanced Server Setup Disk #1"   , TAGFILE = disk1
  767.     2    = "Windows NT Advanced Server Setup Disk #2"   , TAGFILE = disk2
  768.     3    = "Windows NT Advanced Server Setup Disk #3"   , TAGFILE = disk3
  769.     4    = "Windows NT Advanced Server Setup Disk #4"   , TAGFILE = disk4
  770.     5    = "Windows NT Advanced Server Setup Disk #5"   , TAGFILE = disk5
  771.     6    = "Windows NT Advanced Server Setup Disk #6"   , TAGFILE = disk6
  772.     7    = "Windows NT Advanced Server Setup Disk #7"   , TAGFILE = disk7
  773.     8    = "Windows NT Advanced Server Setup Disk #8"   , TAGFILE = disk8
  774.     9    = "Windows NT Advanced Server Setup Disk #9"   , TAGFILE = disk9
  775.     10    = "Windows NT Advanced Server Setup Disk #10"  , TAGFILE = disk10
  776.     11    = "Windows NT Advanced Server Setup Disk #11"  , TAGFILE = disk11
  777.     12    = "Windows NT Advanced Server Setup Disk #12"  , TAGFILE = disk12
  778.     13    = "Windows NT Advanced Server Setup Disk #13"  , TAGFILE = disk13
  779.     14    = "Windows NT Advanced Server Setup Disk #14"  , TAGFILE = disk14
  780.     15    = "Windows NT Advanced Server Setup Disk #15"  , TAGFILE = disk15
  781.     16    = "Windows NT Advanced Server Setup Disk #16"  , TAGFILE = disk16
  782.     17    = "Windows NT Advanced Server Setup Disk #17"  , TAGFILE = disk17
  783.     18    = "Windows NT Advanced Server Setup Disk #18"  , TAGFILE = disk18
  784.     19    = "Windows NT Advanced Server Setup Disk #19"  , TAGFILE = disk19
  785.     20    = "Windows NT Advanced Server Setup Disk #20"  , TAGFILE = disk20
  786.     21    = "Windows NT Advanced Server Setup Disk #21"  , TAGFILE = disk21
  787.     22    = "Windows NT Advanced Server Setup Disk #22"  , TAGFILE = disk22
  788.     23    = "Windows NT Advanced Server Setup Disk #23"  , TAGFILE = disk23
  789.     24    = "Windows NT Advanced Server Setup Disk #24"  , TAGFILE = disk24
  790.     25    = "Windows NT Advanced Server Setup Disk #25"  , TAGFILE = disk25
  791.     26    = "Windows NT Advanced Server Setup Disk #26"  , TAGFILE = disk26
  792.     27    = "Windows NT Advanced Server Setup Disk #27"  , TAGFILE = disk27
  793.     28    = "Windows NT Advanced Server Setup Disk #28"  , TAGFILE = disk28
  794.     29    = "Windows NT Advanced Server Setup Disk #29"  , TAGFILE = disk29
  795. [ProductType]
  796. STF_PRODUCT  = LanmanNT
  797. STF_PLATFORM = I386
  798. [Files-Inf]
  799. 2,    oemsetup.inf,     SIZE=1000,    RENAME=$(!UG_Filename)
  800. [Files-ElnkII]
  801. 22,ELNKII.SYS , SIZE=32768
  802. [LanguagesSupported]
  803.     ENG
  804. [OptionsTextENG]
  805.     ELNKII     = "3Com Etherlink II Adapter (also II/16 and II/16 TP)"
  806. [FileConstantsENG]
  807. ProCaption   = "Windows NT Setup"
  808. ProCancel    = "Cancel"
  809. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  810.                "Are you sure you want to cancel copying files?"
  811. ProCancelCap = "Network Setup Message"
  812. ProText1     = "Copying:"
  813. ProText2     = "To:"
  814. FunctionTitle   = "3Com Etherlink II Adapter Card Setup"
  815. ProductSoftwareDescription      = "3Com Etherlink II Adapter Driver"
  816. ProductHardwareELNKIIDescription        = "3Com Etherlink II Adapter"
  817. ProductSoftwareTitle    = "3Com Etherlink II Adapter Driver"
  818. ProductHardwareELNKIITitle = "3Com Etherlink II Adapter"
  819. ShellCodeErrorTitle     = "Error: "$(FunctionTitle)
  820. ShellCodeErrorText      = "Shell Code Error."
  821. [DialogConstantsENG]
  822. Help        = "&Help"
  823. Exit        = "Cancel"
  824. OK          = "OK"
  825. HelpContext = ""
  826. Continue    = "Continue"
  827. Cancel      = "Cancel"
  828. [MemoryMappedChoicesENG]
  829. Map_1 = 1, "ON"
  830. Map_2 = 0, "OFF"
  831. [FileDependentDlgENG]
  832. DlgText = "Please select values for the following fields:"
  833. Combo1Label = "&IRQ Level:"
  834. Combo2Label = "I/O &Port Address:"
  835. CheckBox1   = "&Memory Mapped"
  836. Label1 = "Transceiver Type"
  837. Radio1 = "&External"
  838. Radio2 = "O&n Board"
  839. DlgType = "RadioCombination"
  840. DlgTemplate = "ELNK_II"
  841. Caption = $(FunctionTitle)
  842. Combo1List = $(IRQ_List)
  843. Combo1Out  = $(IRQ_Level)
  844. Combo2List = $(IOADDR_Hex_List)
  845. Combo2Out  = $(IOADDR_Hex_Value)
  846. ComboListItemsIn  = {Combo1List, Combo2List}
  847. ComboListItemsOut = {Combo1Out, Combo2Out}
  848. EditTextIn = ""
  849. EditTextLim = ""
  850. CBOptionsGreyed = {}
  851. NotifyFields = {NO, NO}
  852. HelpContext = $(!IDH_DB_OEMNADE2_INS)
  853.  
  854.  
  855.  
  856.