home *** CD-ROM | disk | FTP | other *** search
/ ftp.tcs3.com / ftp.tcs3.com.tar / ftp.tcs3.com / DRIVERS / Network / 3COM / 3c90x / Ver4.01 / 3c90x2x.exe / DAINST.EXE / oemsetup.inf < prev    next >
INI File  |  1998-03-17  |  48KB  |  1,281 lines

  1. ; file version:  1.0.0.1
  2.  
  3. [Identification]
  4.     OptionType = NetTransport
  5.  
  6. [LanguagesSupported]
  7.     ENG
  8.  
  9. [Options]
  10.     DAPassThru
  11.  
  12. [OptionsTextENG]
  13.     PassThru     = "DynamicAccess Intermediate Driver"
  14.  
  15. [FileConstants]
  16. UtilityInf                  = "UTILITY.INF"
  17. subroutineinf               = "SUBROUTN.INF"
  18. TransportSoftwareType            = "transport"
  19. AdapterSoftwareType               = "driver"
  20. Exit_Code                   = 0
  21. NetEventDLL                 = "%SystemRoot%\System32\netevent.dll"
  22.  
  23. Manufacturer                = "3Com"
  24. ProductMajorVersion         = "1"
  25. ProductMinorVersion         = "5.0"
  26. ProductVersion              = $(ProductMajorVersion)"."$(ProductMinorVersion)
  27.  
  28. TransportProductSoftwareName    = "DAPassThruTransport"
  29. AdapterProductSoftwareName        = "DAPassThru"
  30. AdapterProductHardwareName        = "DAPassThru"
  31.  
  32. ProductSoftwareImagePath         = "\SystemRoot\System32\drivers\DAprot.sys"
  33. ProductMiniportSoftwareImagePath     = "\SystemRoot\System32\drivers\DAmini.sys"
  34.  
  35. TransportNetRuleSoftwareType        = "DAPassThruTransport DAPassThruTransport"
  36. TransportNetRuleSoftwareClass       = {"DAPassThruTransport basic"}
  37. TransportNetRuleSoftwareUse         = $(TransportSoftwareType)" none none"
  38. TransportNetRuleSoftwareBindForm    = """DAPassThruTransport"" yes yes container"
  39. TransportNetRuleSoftwareBindable     = {"DAPassThruTransport ndisDriver non non 100"}
  40.  
  41. AdapterNetRuleSoftwareType            = "DAPassThruSys ndisDriver DAPassThruDriver"
  42. AdapterNetRuleSoftwareUse             = $(AdapterSoftwareType)
  43. AdapterNetRuleSoftwareBindForm        = """DAPROT"" yes no container"
  44. AdapterNetRuleSoftwareClass           = {"DAPassThruDriver basic"}
  45. AdapterNetRuleSoftwareBindable         = {"DAPassThruDriver DAPassThruAdapter non exclusive 100"}
  46.  
  47. AdapterNetRuleHardwareType        = "DAPassThru DAPassThruAdapter"
  48. AdapterNetRuleHardwareBindForm         = " yes yes container"
  49. AdapterNetRuleHardwareClass            = {"DAPassThruAdapter basic"}
  50.  
  51. TransportProductKeyName    = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(TransportProductSoftwareName)"\CurrentVersion"
  52. TransportParamKeyName    = $(!NTN_ServiceBase)"\"$(TransportProductSoftwareName)"\Parameters"
  53. TransportServiceKeyName    = $(!NTN_ServiceBase)"\"$(TransportProductSoftwareName)
  54. TransportLinkageKeyName    = $(!NTN_ServiceBase)"\"$(TransportProductSoftwareName)"\Linkage"
  55. TransportLinkageDisabledKeyName    = $(!NTN_ServiceBase)"\"$(TransportProductSoftwareName)"\Linkage\Disabled"
  56.  
  57. AdapterProductKeyName    = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(AdapterProductSoftwareName)"\CurrentVersion"
  58. AdapterParamKeyName        = $(!NTN_ServiceBase)"\"$(AdapterProductSoftwareName)"\Parameters"
  59. AdapterServiceKeyName    = $(!NTN_ServiceBase)"\"$(AdapterProductSoftwareName)
  60. AdapterLinkageKeyName    = $(!NTN_ServiceBase)"\"$(AdapterProductSoftwareName)"\Linkage"
  61.  
  62. [FileConstantsENG]
  63. ProCaption                   = "Windows NT Setup"
  64. ProCancel                    = "Cancel"
  65. ProCancelMsg                 = "Windows NT Networking is not correctly installed.  "+
  66.                                  "Are you sure you want to cancel copying files?"
  67. ProCancelCap                 = "Network Setup Message"
  68. ProText1                     = "Copying:"
  69. ProText2                     = "To:"
  70. FunctionTitle               = "DAPassThru Driver"
  71. TransportProductSoftwareDescription    = "DAPassThru Driver Transport"
  72. TransportProductSoftwareDisplayName    = "DAPassThru Driver Transport"
  73. TransportProductSoftwareTitle        = "DAPassThru Driver Transport"
  74. AdapterProductSoftwareDescription    = "DAPassThru Driver Adapter"
  75. AdapterProductSoftwareDisplayName    = "DAPassThru Driver Adapter"
  76. AdapterProductSoftwareTitle            = "DAPassThru Driver Adapter"
  77. ProductHardwareDescription        = "DAPassThru Driver Virtual Adapter"
  78. ProductHardwareDisplayName        = "DAPassThru Driver Virtual Adapter"
  79. ProductHardwareTitle            = "DAPassThru Driver Virtual Adapter"
  80. ShellCodeErrorTitle             = "Error: "$(FunctionTitle)
  81. ShellCodeErrorText              = "Shell Code Error."
  82.  
  83. [GeneralConstants]
  84. from      = ""
  85. to        = ""
  86. ExitCodeOk     = 0
  87. ExitCodeCancel = 1
  88. ExitCodeFatal  = 2
  89. KeyNull         = ""
  90. MAXIMUM_ALLOWED   = 33554432
  91. RegistryErrorIndex = NO_ERROR
  92. KeyProduct      = ""
  93. KeyParameters   = ""
  94. TRUE            = 1
  95. FALSE           = 0
  96. NoTitle            = 0
  97. ExitState   = "Active"
  98. OldVersionExisted = $(FALSE)
  99. DriverPath      = $(!STF_NTPATH)\drivers
  100. DisableOtherReviewBindings = $(!STF_WINDOWSPATH)"\System32\DASetup.exe"
  101. DisableOtherReviewBindingsText = "DisableOtherReviews"
  102. StartDetachedText = "StartDetachedReview"
  103. DASetupNT = $(!STF_WINDOWSPATH)"\System32\DASetup.exe"
  104. SetupINFName = $(!STF_WINDOWSPATH)"\System32\oemsetup.INF"
  105. DASmartN = $(!STF_WINDOWSPATH)"\System32\DASmartN.exe"
  106. PostProcessInf = $(!STF_WINDOWSPATH)"\System32\PRUN.INF"
  107. DA15CFGEXE = $(!STF_WINDOWSPATH)"\System32\da15cfg.exe"
  108. ;DA15CFGINI = $(!STF_WINDOWSPATH)"\System32\da15cfg.ini"
  109. DACFGCPL   = $(!STF_WINDOWSPATH)"\System32\Pacecfg.cpl"
  110. DACFGCPLSAV= $(!STF_WINDOWSPATH)"\System32\Pacecfg.sav"
  111. DACFGHLP   = $(!STF_WINDOWSPATH)"\System32\dacfg.hlp"
  112. ;DACFGAPPLST= $(!STF_WINDOWSPATH)"\System32\dacfgapp.lst"
  113. ReviewProgramsTxt = "ReviewPrograms"
  114. ProductSoftwareImagePathTxt         = $(!STF_WINDOWSPATH)"\System32\drivers\DAprot.sys"
  115. ProductMiniportSoftwareImagePathTxt     = $(!STF_WINDOWSPATH)"\System32\drivers\DAmini.sys"
  116. InstallInProcess = "DAInstallInProcess"
  117.  
  118. [date]
  119.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  120.  
  121. [platform]
  122.     STF_PLATFORM = "" ? $(!LIBHANDLE) GetPlatform
  123.  
  124. [Identify]
  125.     read-syms Identification
  126.     set Status     = STATUS_SUCCESSFUL
  127.     set Identifier = $(OptionType)
  128.     set Media      = #("Source Media Descriptions", 1, 1)
  129.     Return $(Status) $(Identifier) $(Media)
  130.  
  131. [ReturnOptions]
  132.     set Status        = STATUS_FAILED
  133.     set OptionList     = {}
  134.     set OptionTextList = {}
  135.     set LanguageList = ^(LanguagesSupported, 1)
  136.     Ifcontains(i) $($0) in $(LanguageList)
  137.         goto returnoptions
  138.     else
  139.         set Status = STATUS_NOLANGUAGE
  140.         goto finish_ReturnOptions
  141.     endif
  142. returnoptions = +
  143.     set OptionList     = ^(Options, 1)
  144.     set OptionTextList = ^(OptionsText$($0), 1)
  145.     set Status         = STATUS_SUCCESSFUL
  146. finish_ReturnOptions = +
  147.     Return $(Status) $(OptionList) $(OptionTextList)
  148.  
  149. [InstallOption]
  150.  
  151.     set !DebugOutputControl = 1
  152.     
  153.     set Option   = $($1)
  154.     set SrcDir   = $($2)
  155.     set AddCopy  = $($3)
  156.     set DoCopy   = $($4)
  157.     set DoConfig = $($5)
  158.     set LanguageList = ^(LanguagesSupported, 1)
  159.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  160.         Return STATUS_NOLANGUAGE
  161.     endif
  162.     set-subst LF = "\n"
  163.     read-syms GeneralConstants
  164.     read-syms FileConstants
  165.     read-syms DialogConstants$(!STF_LANGUAGE)
  166.     ifstr(i) $(!NTN_Origination) == "NCPA"
  167.         set Continue = $(OK)
  168.     endif
  169.     read-syms FileConstants$(!STF_LANGUAGE)
  170.     detect date
  171.     detect platform
  172.     set-title  $(FunctionTitle)
  173.     set to   = Begin
  174.     set from = Begin
  175.     set CommonStatus = STATUS_SUCCESSFUL
  176.     EndWait
  177.     
  178. Begin = +
  179.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  180.         set StartLabel = deinstall
  181.     else-Ifstr(i) $(!NTN_InstallMode) == update
  182.         set StartLabel = update
  183.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  184.         set StartLabel = bind
  185.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  186.         set StartLabel = configure
  187.     else
  188.         set StartLabel = install
  189.     endif
  190.     set RadioDefault = 2
  191.     set RadioIn = {$(RadioDefault)}
  192.     set from = $(fatal)
  193.     set to = $(fatal)
  194.     goto $(StartLabel)
  195.  
  196. install =+
  197.  
  198. ;Debug:
  199. ;    Set DlgText = "oemsetup.INF:  install=+ Section"
  200. ;    Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(DlgText)
  201. ;    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  202. ;        set RegistryErrorIndex = ERROR
  203. ;    endif
  204.  
  205.     OpenRegKey $(!REG_H_LOCAL) "" $(TransportProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  206.     Ifstr $(KeyProduct) != $(KeyNull)
  207.         CloseRegKey $(KeyProduct)
  208.         Shell $(UtilityInf), VerExistedDlg, $(TransportProductSoftwareTitle),+
  209.             $(ProductVersion)
  210.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  211.             goto ShellCodeError
  212.         endif
  213.         goto end
  214.     endif
  215.     CloseRegKey $(KeyProduct)
  216.     goto installproduct
  217.  
  218. installproduct = +
  219.     StartWait
  220.     ifint $(OldVersionExisted) == $(FALSE)
  221.         Ifstr(i) $(DoCopy) == "YES"
  222.            Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  223.            Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  224.                Goto ShellCodeError
  225.            Else-Ifstr(i) $($R0) == STATUS_FAILED
  226.                Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  227.                ifint $($ShellCode) != $(!SHELL_CODE_OK)
  228.                    goto ShellCodeError
  229.                endif
  230.                Goto fatal
  231.            Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  232.                Goto successful
  233.            Endif
  234.            Set SrcDir = $($R1)
  235.  
  236.             Debug-Output "PassThru: oemsetup.inf: SrcDir "$(SrcDir)
  237.  
  238.         Endif
  239.         Shell "" StripTrailSlash $(SrcDir)
  240.         set PlatformDir  = $($R0)"\"$(STF_PLATFORM)
  241.         set InfDir  = $($R0)"\"
  242.  
  243.         install "Install-Option"
  244.  
  245.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  246.            Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  247.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  248.                goto ShellCodeError
  249.            endif
  250.            set Error = $($R0)
  251.            goto fatal
  252.         endif
  253.         set OEM_ABANDON_ON = TRUE
  254.  
  255.         Debug-Output "PassThru: Adding Transport Software Component to Registry"
  256.  
  257.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  258.             $(TransportProductSoftwareName), +
  259.             $(TransportProductSoftwareName), +
  260.             $(TransportProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
  261.             $(ProductSoftwareImagePath), "transport", "NDIS", {}, "",+
  262.             $(NetEventDLL)
  263.         set RegistryErrorIndex = $($R0)
  264.         Ifstr(i) $(RegistryErrorIndex) !=  NO_ERROR
  265.             EndWait
  266.             CloseRegKey $($R1)
  267.             CloseRegKey $($R2)
  268.             CloseRegKey $($R3)
  269.             CloseRegKey $($R4)
  270.             CloseRegKey $($R5)
  271.             goto fatalRegistry
  272.         endif
  273.         Set SoftProductKey      = $($R1)
  274.         Set SoftNetRuleKey      = $($R2)
  275.         Set SoftServiceKey      = $($R3)
  276.         Set SoftParameterKey    = $($R4)
  277.         Set SoftLinkageKey      = $($R5)
  278.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(TransportSoftwareType)},+
  279.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  280.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  281.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(TransportProductSoftwareTitle)},+
  282.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(TransportProductSoftwareDescription)},+
  283.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(TransportProductSoftwareName)},+
  284.                            {Review,$(NoTitle),$(!REG_VT_DWORD),1},+
  285.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  286.         Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  287.         set RegistryErrorIndex = $($R0)
  288.         Ifstr $(RegistryErrorIndex) != NO_ERROR
  289.             CloseRegKey $(SoftProductKey)
  290.             CloseRegKey $(SoftNetRuleKey)
  291.             CloseRegKey $(SoftServiceKey)
  292.             CloseRegKey $(SoftParameterKey)
  293.             CloseRegKey $(SoftLinkageKey)
  294.             goto fatalRegistry
  295.         endif
  296.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(TransportNetRuleSoftwareType)}, +
  297.                             {use,$(NoTitle),$(!REG_VT_SZ),$(TransportNetRuleSoftwareUse)}, +
  298.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(TransportNetRuleSoftwareClass)}, +
  299.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(TransportNetRuleSoftwareBindForm)}, +
  300.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(TransportNetRuleSoftwareBindable)}, +
  301.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  302.         Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  303.         set RegistryErrorIndex = $($R0)
  304.         Ifstr $(RegistryErrorIndex) != NO_ERROR
  305.             CloseRegKey $(SoftProductKey)
  306.             CloseRegKey $(SoftNetRuleKey)
  307.             CloseRegKey $(SoftServiceKey)
  308.             CloseRegKey $(SoftParameterKey)
  309.             CloseRegKey $(SoftLinkageKey)
  310.             goto fatalRegistry
  311.         endif
  312.  
  313.         CloseRegKey $(SoftProductKey)
  314.         CloseRegKey $(SoftNetRuleKey)
  315.         CloseRegKey $(SoftServiceKey)
  316.         CloseRegKey $(SoftParameterKey)
  317.         CloseRegKey $(SoftLinkageKey)
  318.  
  319.         Debug-Output "PassThru: Adding Adapter Software Component to Registry"
  320.  
  321.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  322.             $(AdapterProductSoftwareName), +
  323.             $(AdapterProductSoftwareName), +
  324.             $(AdapterProductSoftwareDisplayName), $(STF_CONTEXTINFNAME), +
  325.             $(ProductMiniportSoftwareImagePath), "kernel", "NDIS", {}, "",+
  326.             $(NetEventDLL)
  327.         set RegistryErrorIndex = $($R0)
  328.         Ifstr(i) $(RegistryErrorIndex) !=  NO_ERROR
  329.             EndWait
  330.             CloseRegKey $($R1)
  331.             CloseRegKey $($R2)
  332.             CloseRegKey $($R3)
  333.             CloseRegKey $($R4)
  334.             CloseRegKey $($R5)
  335.             goto fatalRegistry
  336.         endif
  337.         Set SoftProductKey      = $($R1)
  338.         Set SoftNetRuleKey      = $($R2)
  339.         Set SoftServiceKey      = $($R3)
  340.         Set SoftParameterKey    = $($R4)
  341.         Set SoftLinkageKey      = $($R5)
  342.  
  343.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(AdapterSoftwareType)},+
  344.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  345.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  346.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(AdapterProductSoftwareTitle)},+
  347.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(AdapterProductSoftwareDescription)},+
  348.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(AdapterProductSoftwareName)},+
  349.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  350.         Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  351.         set RegistryErrorIndex = $($R0)
  352.         Ifstr $(RegistryErrorIndex) != NO_ERROR
  353.             CloseRegKey $(SoftProductKey)
  354.             CloseRegKey $(SoftNetRuleKey)
  355.             CloseRegKey $(SoftServiceKey)
  356.             CloseRegKey $(SoftParameterKey)
  357.             CloseRegKey $(SoftLinkageKey)
  358.             goto fatalRegistry
  359.         endif
  360.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(AdapterNetRuleSoftwareType)}, +
  361.                             {use,$(NoTitle),$(!REG_VT_SZ),$(AdapterNetRuleSoftwareUse)}, +
  362.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(AdapterNetRuleSoftwareClass)}, +
  363.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(AdapterNetRuleSoftwareBindForm)}, +
  364.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(AdapterNetRuleSoftwareBindable)}, +
  365.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  366.         Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  367.         set RegistryErrorIndex = $($R0)
  368.         Ifstr $(RegistryErrorIndex) != NO_ERROR
  369.             CloseRegKey $(SoftProductKey)
  370.             CloseRegKey $(SoftNetRuleKey)
  371.             CloseRegKey $(SoftServiceKey)
  372.             CloseRegKey $(SoftParameterKey)
  373.             CloseRegKey $(SoftLinkageKey)
  374.             goto fatalRegistry
  375.         endif
  376.         
  377.         CloseRegKey $(SoftProductKey)
  378.         CloseRegKey $(SoftNetRuleKey)
  379.         CloseRegKey $(SoftServiceKey)
  380.         CloseRegKey $(SoftParameterKey)
  381.         CloseRegKey $(SoftLinkageKey)
  382.  
  383.         OpenRegKey $(!REG_H_LOCAL) "" $(TransportParamKeyName) $(MAXIMUM_ALLOWED) DAParamKey
  384.         SetRegValue $(DAParamKey) {$(InstallInProcess),$(NoTitle),$(!REG_VT_DWORD),2}
  385.     endif
  386.  
  387.     EndWait
  388.     goto successful
  389.  
  390. bind =+
  391.     ;
  392.     ;    When user terminates NCPA, bind is invoked.  Therefore, without knowing
  393.     ;    what the user has done to the NCPA (add new card, remove a card, etc.), 
  394.     ;    bind has to find out and does things accordingly.
  395.     ;
  396.  
  397.     ;
  398.     ;    If this is the binding review for the Transport Driver...
  399.     ;
  400.  
  401. ;Debug:
  402. ;    Set DlgText = "oemsetup.INF:  bind=+ Section, NTN_RegBase ="$(!NTN_RegBase)
  403. ;    Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(DlgText)
  404. ;    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  405. ;        set RegistryErrorIndex = ERROR
  406. ;    endif
  407.  
  408.        ifstr(i) $(!NTN_RegBase) == $(TransportProductKeyName)
  409.  
  410.         ;{ To fix TCP/IP problem: 02-26-98, HD
  411.         Set RegKey = $(TransportParamKeyName)
  412.         OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) DAParamKey
  413.  
  414.         ;Check if installinprocess here. if it is, then don't disable other bindings.
  415.  
  416.         GetRegValue $(DAParamKey) $(InstallInProcess) InProcessRec
  417.         set InProcessValue = *($(InProcessRec),4)
  418.  
  419.         ifstr(i) $(InProcessValue) == ""
  420.             GetRegValue $(DAParamKey) $(DisableOtherReviewBindingsText) disableBindingRec
  421.             set disableBindingValue = *($(disableBindingRec),4)
  422.             ifstr(i) $(disableBindingRec) == ""
  423.                 SetRegValue $(DAParamKey) {$(DisableOtherReviewBindingsText),$(NoTitle),$(!REG_VT_DWORD),1}
  424.                 RunProgram ExitCode "" "" $(DisableOtherReviewBindings) 5
  425.             endif
  426.         endif
  427.         CloseRegKey $(DAParamKey)
  428.         ;} To fix TCP/IP problem: 02-26-98, HD
  429.  
  430.         ;
  431.         ;    Open the Linkage Key and get the Bind Value
  432.         ;
  433.         Debug-Output "PassThru: Reviewing bindings in "$(TransportLinkageKeyName)
  434.         OpenRegKey $(!REG_H_LOCAL) "" $(TransportLinkageKeyName) $(MAXIMUM_ALLOWED) TransportLinkageKey
  435.         ifstr(i) $(TransportLinkageKey) != ""
  436.             GetRegValue $(TransportLinkageKey) "Bind" BindList
  437.             Debug-Output "PassThru: BindList: "$(BindList)
  438.             Set Binding = *($(BindList),4)
  439.             Debug-Output "PassThru: Binding:  "$(Binding)
  440.             CloseRegKey $(TransportLinkageKey)
  441.         else
  442.             Debug-Output "PassThru: failed to open Linkage Key for "$(TransportServiceKeyName)
  443.             goto fatalregistry
  444.         endif
  445.         ;
  446.         ;    Parse the Bindings to create a list of Adapter cards
  447.         ;
  448.         set CardList = {}
  449.         set TempCardList = {}
  450.         set CreateCardList = {}
  451.         set NICIndex = 0
  452.         ForListDo $(Binding)
  453.             Split-String $($), "\", BindInfo
  454.             QueryListSize BindListSize $(BindInfo)
  455.             set CardName = *($(BindInfo),$(BindListSize))
  456.             Debug-Output "PassThru: Cardname: "$(CardName)
  457.             ifstr(i) $(TempCardList) == {}
  458.                 set TempCardList = {$(CardName)}
  459.             else
  460.                 set TempCardList = >($(TempCardList),$(CardName))
  461.             endif
  462.         EndForListDo
  463.  
  464.         ; 020998: For add new and remove last NIC error:  Inverting Binding List {
  465.         QueryListSize NICIndex $(TempCardList)
  466.         ForListDo $(TempCardList)
  467.             ifstr(i) $(CardList) == {}
  468.                 set CardList = {*($(TempCardList),$(NICIndex))}
  469.             else
  470.                 set CardList = >($(CardList),*($(TempCardList),$(NICIndex)))
  471.             endif
  472.             set-sub NICIndex = $(NICIndex),1
  473.         EndForListDo
  474.         ; 020998: end of inverting binding list }
  475.         
  476.  
  477.         ;
  478.         ;  Getting total number of Virtual NIC
  479.         ;
  480.         Set TotalVirtualNIC = 0
  481.         Set LastCard = 1
  482.         ForListDo $(CardList)
  483.             Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\Signature"
  484.             OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) VirtualNICKey
  485.             ifstr(i) $(VirtualNICKey) == ""
  486.             ;  Real NIC, but check its media type.  If type 1, then lastCardRemoved=False.
  487.                 Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters"
  488.                 OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) RealNicParam
  489.                 GetRegValue $(RealNicParam) "MediaType" MediaTypeRec
  490.                 Set MediaTypeVal = *($(MediaTypeRec),4)
  491.                 ifstr(i) $(MediaTypeVal) == 1
  492.                     Set LastCard = 0
  493.                 endif
  494.             else
  495.                 Set-add TotalVirtualNIC = $(TotalVirtualNIC), 1
  496.             endif
  497.         EndForListDo
  498.  
  499.  
  500.         Debug-Output "PassThru: Cardlist: "$(CardList)
  501.  
  502.         ;
  503.         ;  For each real LAN adapter the transport is bound to...
  504.         ;
  505.         Set AddedNewVirtualAdapter = "No"
  506.         Set RemovedNIC = "No"
  507.         ForListDo $(CardList)
  508.             Debug-Output "PassThru: Processing "$($)"..."
  509.             ;
  510.             ;    Check if this is a virtual adapter that WE created.
  511.             ;
  512.             Set MediaTypeRecord = ""
  513.             Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters"
  514.             OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) CardParamKey
  515.             GetRegValue $(CardParamKey) "MediaType" MediaTypeRecord
  516.             ifstr(i) $(MediaTypeRecord) == ""
  517.                 goto continueCardList
  518.             endif
  519.  
  520.             Set MediaTypeValue = *($(MediaTypeRecord),4)
  521.             ifstr(i) $(MediaTypeValue) != 1
  522.                 ;
  523.                 ; Wedge supports only media type # 1 NIC
  524.                 ;
  525.                 goto continueCardList
  526.             else-ifstr(i) $(MediaTypeValue) == 1
  527.                 Set MediaTypeValue = *($(MediaTypeRecord),4)
  528.                 ;
  529.                 ;if ATM mediatype, don't create virtual NIC
  530.                 ;
  531.                 ;    Get Title field of mapped Nic:
  532.                 ;
  533.                 Set RealNICCard = $($)
  534.                 Set RegKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  535.                 OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) NetCardKey
  536.                 ifstr(i) $(NetCardKey) != ""
  537.                     EnumRegKey $(NetCardKey) NetCardKeyList
  538.                     ForListDo $(NetCardKeyList)
  539.                         Set NetCardNum = *( $($), 1 )
  540.                         Set RegKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$(NetCardNum)
  541.                         OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) NetCardNumKey
  542.                         GetRegValue $(NetCardNumKey) "ServiceName" NetCardServiceNameValue
  543.                         Set NetCardServiceName = *( $(NetCardServiceNameValue), 4 )
  544.                         ifstr(i) $(NetCardServiceName) == $(RealNICCard)
  545.                             GetRegValue $(NetCardNumKey) "Title" NetCardTitleRec
  546.                             Set NetCardTitle = *( $(NetCardTitleRec), 4 )
  547.                         endif
  548.                     EndForListDo
  549.                 endif
  550.                 CloseRegKey $(NetCardKey)
  551.                 CloseRegKey $(NetCardNumKey)
  552.                 Split-String $(NetCardTitle), " ", itemizedTitle
  553.                 Ifcontains "ATM" in $(itemizedTitle)
  554.                     goto continueCardList
  555.                 else
  556.                     set anATMCard = 0
  557.                     ForListDo $(itemizedTitle)
  558.                         Split-String $($), "M", ATMPrependTitle
  559.                         Ifcontains "AT" in $(ATMPrependTitle)
  560.                             set anATMCard = 1
  561.                         endif
  562.                         Split-String $($), "A", ATMAppendTitle
  563.                         Ifcontains "TM" in $(ATMAppendTitle)
  564.                             set anATMCard = 1
  565.                         else
  566.                             ForListDo $(ATMAppendTitle)
  567.                                 Split-String $($), "M", ATMInsideTitle
  568.                                 Ifcontains "T" in $(ATMInsideTitle)
  569.                                     set anATMCard = 1
  570.                                 endif
  571.                             EndForListDo
  572.                         endif
  573.                     EndForListDo
  574.                     ifstr(i) $(anATMCard) == "1"
  575.                         goto continueCardList
  576.                     endif
  577.                 endif
  578.             endif
  579.             Debug-Output "PassThru: NTN_ServiceBase: "$(!NTN_ServiceBase)
  580.             Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\Signature"
  581.             Debug-Output "PassThru: pre-check: about to open "$(RegKey)
  582.             OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) PassThruKey
  583.             ifstr(i) $(PassThruKey) == ""
  584.  
  585.                 Debug-Output "PassThru: WILL bind to "$($)
  586.                 ;020998 {
  587.                 ;
  588.                 ;    Open/Create the protocol specific key under the adapter's parameters key
  589.                 ;
  590.                 Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\"$(TransportProductSoftwareName)
  591.                 Debug-Output "PassThru: about to open "$(RegKey)
  592.                 OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) PassThruKey
  593.                 ifstr(i) $(PassThruKey) == ""
  594.                     Debug-Output "PassThru: creating "$(TransportProductSoftwareName)" key under the adapter"
  595.                     CreateRegKey $(!REG_H_LOCAL) {$(RegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" PassThruParamsKey
  596.                 else
  597.                     Debug-Output "PassThru: Have processed "$($)" already"
  598.                     CloseRegKey $(PassThruKey)
  599.                     goto continueCardList
  600.                 endif
  601.                 ifstr(i) $(PassThruParamsKey) == ""
  602.                     Debug-Output "PassThru: Failed to open/create the \Parameters\"$(TransportProductSoftwareName)" key under the adapter"
  603.                     goto fatalRegistry
  604.                 endif
  605.                 ;
  606.                 ;    Now add a virtual hardware component to represent the ELAN
  607.                 ;
  608.                 Debug-Output "PassThru: Adding Adapter Hardware Component to Registry"
  609.                 Shell $(UtilityInf), AddHardwareComponent, +
  610.                     $(AdapterProductHardwareName), +
  611.                     $(STF_CONTEXTINFNAME), +
  612.                     $(AdapterProductKeyName)
  613.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  614.                     Debug-Output "PassThru: ShellCode error."
  615.                     goto ShellCodeError
  616.                 endif
  617.                 set RegistryErrorIndex = $($R0)
  618.                 Ifstr(i) $(RegistryErrorIndex) !=  NO_ERROR
  619.                     Debug-Output "PassThru: Failed to Add Hardware Component"
  620.                     CloseRegKey $($R1)
  621.                     CloseRegKey $($R2)
  622.                     CloseRegKey $($R3)
  623.                     goto fatalRegistry
  624.                 endif
  625.                     
  626.                 ;
  627.                 ;    Pair information of real and virtual NICs -- HD --
  628.                 ;
  629.                 ;    Get Title field of mapped Nic:
  630.                 ;
  631.                 Set RealNICCard = $($)
  632.                 Set RegKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  633.                 OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) NetCardKey
  634.                 ifstr(i) $(NetCardKey) != ""
  635.                     EnumRegKey $(NetCardKey) NetCardKeyList
  636.                     ForListDo $(NetCardKeyList)
  637.                         Set NetCardNum = *( $($), 1 )
  638.                         Set RegKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$(NetCardNum)
  639.                         OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) NetCardNumKey
  640.                         GetRegValue $(NetCardNumKey) "ServiceName" NetCardServiceNameValue
  641.                         Set NetCardServiceName = *( $(NetCardServiceNameValue), 4 )
  642.                         ifstr(i) $(NetCardServiceName) == $(RealNICCard)
  643.                             GetRegValue $(NetCardNumKey) "Title" NetCardTitleRec
  644.                             Set NetCardTitle = *( $(NetCardTitleRec), 4 )
  645.                         endif
  646.                     EndForListDo
  647.                 endif
  648.                 CloseRegKey $(NetCardKey)
  649.                 CloseRegKey $(NetCardNumKey)
  650.                 ;
  651.                 ;    End of getting Title field for mapped NIC
  652.                 ;
  653.     
  654.                 set KeyParameters = $($R3)
  655.                 set KeyAdapterRules = $($R2)
  656.                    set AdapterNumber = $($R4)
  657.                 set VirtNICTitle = "3Com Virtual NIC - DynamicAccess 1.5 ["$(NetCardTitle)"]"
  658.                 set VirtNICDesc = "3Com Virtual NIC - DynamicAccess 1.5 ["$(NetCardTitle)"]"
  659.                 set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  660.                                     {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(VirtNICTitle)},+
  661.                                     {Description,$(NoTitle),$(!REG_VT_SZ),$(VirtNICDesc)},+
  662.                                     {ProductName,$(NoTitle),$(!REG_VT_SZ),$(AdapterProductHardwareName)},+
  663.                                     {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  664.                                     {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  665.                 Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  666.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  667.                     Debug-Output "PassThru: ShellCode error"
  668.                     goto ShellCodeError
  669.                 endif
  670.                 CloseRegKey $($R1)
  671.                 
  672.                 set TempProdName = """"$(AdapterProductHardwareName)$(AdapterNumber)""""
  673.                 set TempBindForm = $(TempProdName)$(AdapterNetRuleHardwareBindForm)
  674.                 set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(AdapterNetRuleHardwareType)},+
  675.                                     {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  676.                                     {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(AdapterNetRuleHardwareClass)}, +
  677.                                     {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  678.                 Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  679.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  680.                     Debug-Output "PassThru: ShellCode error."
  681.                     goto ShellCodeError
  682.                 endif
  683.                 set RegistryErrorIndex = $($R0)
  684.                 Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  685.                     EndWait
  686.                     Debug-Output "PassThru: Registry error: add value list."
  687.                     CloseRegKey $(KeyParameters)
  688.                     CloseRegKey $(KeyAdapterRules)
  689.                     goto fatalregistry
  690.                 endif
  691.                 CloseRegKey $(KeyAdapterRules)
  692.     
  693.                 Set NewValueList = {{MappedNic,$(NoTitle),$(!REG_VT_SZ),"\Device\"$($)},+
  694.                                     {virtualNicNumber,$(NoTitle),$(!REG_VT_SZ),$(AdapterNumber)},+
  695.                                     {MediaType,$(NoTitle),$(!REG_VT_DWORD),$(MediaTypeValue)},+
  696.                                     {MappedNICTitle,$(NoTitle),$(!REG_VT_SZ),$(NetCardTitle)}}
  697.                 Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  698.     
  699.                 ; Create a key of the type
  700.                 ;    PassThru2\Parameters\Signature\
  701.                 ;
  702.                 Set SigRegKey = $(!NTN_ServiceBase)"\"$(AdapterProductHardwareName)$(AdapterNumber)"\Parameters\Signature"
  703.                 Debug-Output "SigRegKey is "$(SigRegKey)
  704.                 CreateRegKey $(!REG_H_LOCAL) {$(SigRegKey),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" SigKey
  705.                 ifstr(i) $(SigKey) == ""
  706.                     Debug-Output "Failed to create "$(SigRegKey)
  707.                    endif
  708.                 CloseRegKey $(KeyParameters)
  709.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  710.                     Debug-Output "PassThru: ShellCode error."
  711.                     goto ShellCodeError
  712.                 endif
  713.                 set RegistryErrorIndex = $($R0)
  714.                 Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  715.                     Debug-Output "PassThru: Registry error: Add value list"
  716.                     goto fatalregistry
  717.                 endif
  718.     
  719.                 ;
  720.                 ;     Note that a virtual adapter was added.
  721.                 ;
  722.                 Set AddedNewVirtualAdapter = "Yes"
  723.     
  724. ;                ifstr(i) $(ElanKey) != ""
  725. ;                    CloseRegKey $(ElanKey)
  726. ;                endif
  727. ;
  728.                 ifstr(i) $(PassThruParamsKey) != ""
  729.                     set NewValueList = {{Device,$(NoTitle),$(!REG_VT_SZ),$(AdapterProductHardwareName)$(AdapterNumber)},+
  730.                                         {AdapterNumber,$(NoTitle),$(!REG_VT_SZ),$(AdapterNumber)}}
  731.                     Shell $(UtilityInf), AddValueList, $(PassThruParamsKey), $(NewValueList)
  732.                     CloseRegKey $(PassThruParamsKey)
  733.                 endif
  734.                 ;020998 }
  735.  
  736.             else
  737.                 Debug-Output "PassThru: Skipping bind to ourselves "$($)
  738.                 ;    Also, if the mappedNic is removed, then remove its virtual NIC.
  739.                 ;    Check to see if the mappedNic exists!  -- HD --
  740.                 Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\"
  741.                 OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) virtualNicParams
  742.                 GetRegValue $(virtualNicParams) "MappedNic" mappedNicNameRecord
  743.                 Set mappedNicDeviceName = *($(mappedNicNameRecord),4)
  744.                 Split-String $(mappedNicDeviceName), "\", mappedNicInfo
  745.                 QueryListSize NicNameLength $(mappedNicInfo)
  746.                 set mappedNicName = *($(mappedNicInfo),$(NicNameLength))
  747.                 Set RegKey = $(!NTN_ServiceBase)"\"$(mappedNicName)
  748.  
  749.                 OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) mappedNicEntry
  750.                 ifstr(i) $(mappedNicEntry) == ""
  751.                     ;    mappedNic was removed; therefore, remove its virtual Nic as well -- HD --
  752.  
  753.                     Set RemovedNIC = "Yes"
  754.                     ;
  755.                     ;    If last NIC was removed, remove Wedge also.
  756.                     ;
  757.  
  758.                     GetRegValue $(virtualNicParams) "virtualNicNumber" virtualNicNumberIndex
  759.                     set virtualNicNumberValue = *($(virtualNicNumberIndex),4)
  760.                     Set RegKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$(virtualNicNumberValue)
  761.  
  762.                     Shell $(UtilityInf), RemoveHardwareComponent,+
  763.                           $(Manufacturer),$(AdapterProductSoftwareName),$(RegKey)
  764.  
  765.                     Set RegKey = $(TransportParamKeyName)
  766.                     OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) DAParamKey
  767.                     GetRegValue $(DAParamKey) $(DisableOtherReviewBindingsText) disableBindingRec
  768.                     set DisableOtherReviewBindingValue = *($(disableBindingRec),4)
  769.                     ifint $(DisableOtherReviewBindingValue) == 1
  770.                         SetRegValue $(DAParamKey) {$(DisableOtherReviewBindingsText),$(NoTitle),$(!REG_VT_DWORD),2}
  771.                         RunProgram ExitCode "" "" $(DisableOtherReviewBindings) 4
  772.                     endif
  773.                     CloseRegKey $(DAParamKey)
  774.                 endif
  775.                 goto continueCardList
  776.             endif
  777.  
  778.  
  779. continueCardList = +
  780.             
  781.         EndForListDo
  782.  
  783.         ;
  784.         ;    If we added a virtual adapter, tell NCPA to review bindings
  785.         ;    again after this completes.
  786.         ;
  787.         ifstr(i) $(AddedNewVirtualAdapter) == "Yes"
  788.  
  789.             Set RegKey = $(TransportParamKeyName)
  790.             OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) DAParamKey
  791.  
  792.             ;Check if installinprocess here. if it is, then don't disable other bindings.
  793.  
  794.             GetRegValue $(DAParamKey) $(InstallInProcess) InProcessRec
  795.             set InProcessValue = *($(InProcessRec),4)
  796.  
  797.             ifstr(i) $(InProcessValue) == ""
  798.                 GetRegValue $(DAParamKey) $(DisableOtherReviewBindingsText) disableBindingRec
  799.                 set disableBindingValue = *($(disableBindingRec),4)
  800.                 ifint $(disableBindingValue) == 1
  801.                     SetRegValue $(DAParamKey) {$(DisableOtherReviewBindingsText),$(NoTitle),$(!REG_VT_DWORD),2}
  802.                     RunProgram ExitCode "" "" $(DisableOtherReviewBindings) 4
  803.                 endif
  804.                 GetRegValue $(DAParamKey) $(StartDetachedText) StartDetachedRec
  805.                 ifstr(i) $(StartDetachedRec) == ""                
  806.                     SetRegValue $(DAParamKey) {$(StartDetachedText),$(NoTitle),$(!REG_VT_DWORD),1}
  807.                     StartDetachedProcess STATUS_SUCCESSFUL "" "" $(DASetupNT) 1
  808.                 endif
  809.             endif
  810.  
  811.             CloseRegKey $(DAParamKey)
  812.  
  813.         endif
  814.  
  815.  
  816.         ifstr(i) $(RemovedNIC) == "Yes"
  817.  
  818.  
  819.             ifstr(i) $(LastCard) == 1
  820.                 goto LastCardRemoved
  821.             endif
  822.  
  823.  
  824.             Set RegKey = $(TransportParamKeyName)
  825.             OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) DAParamKey
  826.  
  827.             ;Check if installinprocess here. if it is, then don't disable other bindings.
  828.  
  829.             GetRegValue $(DAParamKey) $(InstallInProcess) InProcessRec
  830.             set InProcessValue = *($(InProcessRec),4)
  831.  
  832.             ifstr(i) $(InProcessValue) == ""
  833.                 GetRegValue $(DAParamKey) $(DisableOtherReviewBindingsText) disableBindingRec
  834.                 set disableBindingValue = *($(disableBindingRec),4)
  835.                 ifint $(disableBindingValue) == 1
  836.                     SetRegValue $(DAParamKey) {$(DisableOtherReviewBindingsText),$(NoTitle),$(!REG_VT_DWORD),2}
  837.  
  838.                     RunProgram ExitCode "" "" $(DisableOtherReviewBindings) 4
  839.                 endif
  840.             endif
  841.  
  842.             GetRegValue $(DAParamKey) $(StartDetachedText) StartDetachedRec
  843.             ifstr(i) $(StartDetachedRec) == ""                
  844.                 SetRegValue $(DAParamKey) {$(StartDetachedText),$(NoTitle),$(!REG_VT_DWORD),1}
  845.                 StartDetachedProcess STATUS_SUCCESSFUL "" "" $(DASetupNT) 1
  846.             endif
  847.  
  848.             CloseRegKey $(DAParamKey)
  849.         endif
  850.  
  851.     endif
  852.  
  853.     goto successful
  854.  
  855. deinstall =+
  856.  
  857. ;
  858. ;    To synch TCP/IP configuration again with current setup.
  859. ;    
  860.     RunProgram ExitCode "" "" $(DASetupNT) t
  861. ;    Done synch TCP/IP
  862.  
  863.     Split-String $(!NTN_RegBase), "\", RegLoc
  864.  
  865.     Ifcontains(i) "NetworkCards" in $(RegLoc)
  866.     ;    Removing just the virtual NIC is not allowed:
  867. ;dialog#1
  868.         Set DlgText = "If you want to uninstall 3Com's DynamicAccess software, select the DAPassThru Driver Transport and click Remove."
  869.         Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(DlgText)
  870.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  871.             set RegistryErrorIndex = ERROR
  872.         endif
  873.         Return STATUS_SUCCESSFUL        
  874.     endif
  875.  
  876.     Ifcontains(i) "DAPassThru" in $(RegLoc)
  877.     ;    Removing just the virtual NIC is not allowed:
  878. ;dialog#2
  879.         Set DlgText = "What do you want to do? (1) If you want to remove 3Com's DynamicAccess software, select DAPassThru Transport protocol and click Remove.  (2) If you want to remove your Adapter, select the adapter and click Remove.  Do no remove the 3Com's virtual NIC."
  880.         Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(DlgText)
  881.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  882.             set RegistryErrorIndex = ERROR
  883.         endif
  884.         Return STATUS_SUCCESSFUL        
  885.     endif
  886. ;dialog0
  887.     Set DlgText = "You are about to uninstall the 3Com DynamicAccess Protocol!"
  888.      Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(DlgText)
  889.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  890.         set RegistryErrorIndex = ERROR
  891.     endif
  892.  
  893.     ifstr $($R1) == "CANCEL"
  894.         Return STATUS_SUCCESSFUL
  895.     endif
  896.  
  897. LastCardRemoved =+
  898. ;    Set RegKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion"
  899. ;    OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) NTVersionKey
  900. ;    GetRegValue $(NTVersionKey) "CurrentVersion" NTVersionRec
  901. ;    Set NTVersion = *($(NTVersionRec),4)
  902. ;    CloseRegKey $(NTVersionKey)
  903.  
  904. ;    ifstr(i) $(NTVersion) == "4.0"
  905. ;        RunProgram ExitCode "" "" $(DASetupNT) d
  906. ;    else-ifstr(i) $(NTVersion) == "3.51"
  907. ;        Set DlgText = "oemsetup.INF:  Need to also run DASetup.exe d"
  908. ;        Shell "Subroutn.Inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(DlgText)
  909. ;        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  910. ;            set RegistryErrorIndex = ERROR
  911. ;        endif
  912. ;    endif
  913.  
  914. ;    AddfileToDeleteList $(ProductSoftwareImagePathTxt)
  915. ;    AddfileToDeleteList $(ProductMiniportSoftwareImagePathTxt)
  916. ;    AddfileToDeleteList $(PostProcessInf)
  917. ;    AddfileToDeleteList $(DASetupNT)
  918. ;;    AddfileToDeleteList $(DADeinstallNT)
  919. ;;    Return STATUS_SUCCESSFUL        
  920. ;;    endif
  921.  
  922.  
  923.     ;ifstr(i) $(TransportProductKey) == ""
  924.     ;    CloseRegKey $(TransportProductKey)
  925.     ;    set Error = "To uninstall this adapter, remove '"$(TransportProductSoftwareDescription)"' from Protocols"
  926.     ;    set from = end
  927.     ;    goto nonfatalinfo
  928.        ;endif
  929.     ;CloseRegKey $(TransportProductKey)
  930.  
  931.     ;
  932.     ;    Build a list of real LAN adapters that the transport is bound to
  933.     ;    
  934.  
  935.     OpenRegKey $(!REG_H_LOCAL) "" $(TransportLinkageKeyName) $(MAXIMUM_ALLOWED) TransportLinkageKey
  936.     ifstr(i) $(TransportLinkageKey) != ""
  937.         GetRegValue $(TransportLinkageKey) "Bind" BindList
  938.         Debug-Output "PassThru: Remove: BindList: "$(BindList)
  939.         Set Binding = *($(BindList),4)
  940.         Debug-Output "PassThru: Remove: Binding:  "$(Binding)
  941.         CloseRegKey $(TransportLinkageKey)
  942.     else
  943.         Debug-Output "PassThru: failed to open key "$(TransportLinkageKeyName)
  944.         goto skipRemoveBindings
  945.     endif
  946.     set CardList = {}
  947.     set CreateCardList = {}
  948.     ForListDo $(Binding)
  949.         Split-String $($), "\", BindInfo
  950.         QueryListSize BindListSize $(BindInfo)
  951.         set CardName = *($(BindInfo),$(BindListSize))
  952.         Debug-Output "PassThru: Remove: Cardname: "$(CardName)
  953.         ifstr(i) $(CardList) == {}
  954.             set CardList = {$(CardName)}
  955.         else
  956.             set CardList = >($(CardList),$(CardName))
  957.         endif
  958.     EndForListDo
  959.  
  960.     Debug-Output "PassThru: Cardlist: "$(CardList)
  961.     ;
  962.     ;    For each real LAN adapter in the list...
  963.     ;
  964.     ForListDo $(CardList)
  965.         ;
  966.         ;    Open the Elan list key
  967.         ;
  968.         ;Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\"$(TransportProductSoftwareName)"\ElanList"
  969.         ;OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) ElanListKey
  970.  
  971.         Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\Signature"
  972.         OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) DASignatureKey
  973.  
  974.         ifstr(i) $(DASignatureKey) != ""
  975.             CloseRegKey $(DASignatureKey)
  976.             Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters"
  977.             OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) VirtNICParam
  978.             GetRegValue $(VirtNICParam) "virtualNicNumber" VirtNICNoRec
  979.             GetRegValue $(VirtNICParam) "MappedNic" RealNICRec
  980.             Set VirtNICNo = *($(VirtNICNoRec),4)
  981.             Set AdapterRegBase = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$(VirtNICNo)
  982.             Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  983.                 $(AdapterProductSoftwareName), $(AdapterRegBase)
  984.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  985.                 Debug-Output "PassThru: ShellCode error"
  986.                 goto ShellCodeError
  987.             endif
  988.             CloseRegKey $(VirtNICParam)
  989.             set RealNIC = *($(RealNICRec),4)
  990.             Split-String $(RealNIC), "\", RealNICInfo
  991.             QueryListSize RealNICItems $(RealNICInfo)
  992.             set RealCardName = *($(RealNICInfo),$(RealNICItems))
  993.             Set RegKey = $(!NTN_ServiceBase)"\"$(RealCardName)"\Parameters"
  994.             OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) RealNICParam
  995.             ifstr(i) $(RealNICParam) != ""
  996. ;
  997. ;Don't do this for Python + transfer current configuration back to real NIC.
  998. ;Will be deleted later in .c program.
  999. ;                DeleteRegTree $(RealNICParam) $(TransportProductSoftwareName)
  1000.                 CloseRegKey $(RealNICParam)
  1001.             else
  1002.                 Debug-Output "PassThru: Failed to delete "$(RegKey)
  1003.             endif
  1004.         endif
  1005.  
  1006. ;        Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters\"$(TransportProductSoftwareName)
  1007. ;        OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) ElanListKey
  1008. ;        ifstr(i) $(ElanListKey) != ""
  1009. ;            GetRegValue $(ElanListKey) "AdapterNumber" AdapterNoValue
  1010. ;            ;CloseRegKey $(ElanListKey)
  1011. ;            Debug-Output "PassThru: AdapterNoValue:  "$(AdapterNoValue)
  1012. ;            ;
  1013. ;            ;    Open the Elan0 key and get the adapter number
  1014. ;            ;
  1015. ;            ;Set RegKey = $(RegKey)"\Elan0"
  1016. ;            ;OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) ElanKey
  1017. ;            ;ifstr(i) $(ElanKey) != ""
  1018. ;            ;    GetRegValue $(ElanKey) "AdapterNumber" AdapterNoValue
  1019. ;            ;    CloseRegKey $(ElanKey)
  1020. ;            ;else
  1021. ;            ;    Debug-Output "PassThru: failed to open key "$(RegKey)", skipping this adapter"
  1022. ;            ;    goto continueRemoveBindings
  1023. ;            ;endif
  1024. ;            Set AdapterNo = *($(AdapterNoValue),4)
  1025. ;
  1026. ;            ;
  1027. ;            ;    Remove the virtual hardware component that represents the ELAN.
  1028. ;            ;    This will remove the adapter software component as well.
  1029. ;            ;
  1030. ;            Set AdapterRegBase = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$(AdapterNo)
  1031. ;            Debug-Output "PassThru: removing adapter number "$(AdapterNo)" RegBase "$(AdapterRegBase)
  1032. ;            Debug-Output "PassThru: Manufacturer: "$(Manufacturer)", AdapterProductSoftwareName: "$(AdapterProductSoftwareName)", AdpterRegBase: "$(AdpterRegBase)
  1033. ;            Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1034. ;                $(AdapterProductSoftwareName), $(AdapterRegBase)
  1035. ;            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1036. ;                Debug-Output "PassThru: ShellCode error"
  1037. ;                goto ShellCodeError
  1038. ;            endif
  1039. ;
  1040. ;            ;
  1041. ;            ;    Close the Elan list key and
  1042. ;            ;    delete the whole PassThru transport specific key from the real LAN adapter
  1043. ;            ;
  1044. ;            CloseRegKey $(ElanListKey)
  1045. ;            Debug-Output "PassThru: NTN_ServiceBase: "$(!NTN_ServiceBase)
  1046. ;            Set RegKey = $(!NTN_ServiceBase)"\"$($)"\Parameters"
  1047. ;            Debug-Output "PassThru: Deleting protocol specific key from LAN adapter"
  1048. ;            Debug-Output "PassThru: Key is "$(RegKey)
  1049. ;            OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) ParamsKey
  1050. ;            ifstr(i) $(ParamsKey) != ""
  1051. ;                DeleteRegTree $(ParamsKey) $(TransportProductSoftwareName)
  1052. ;                CloseRegKey $(ParamsKey)
  1053. ;            else
  1054. ;                Debug-Output "PassThru: Failed to delete "$(RegKey)
  1055. ;            endif
  1056. ;
  1057. ;        endif
  1058.  
  1059. continueRemoveBindings =+
  1060.     
  1061.     EndForListDo
  1062.  
  1063. skipRemoveBindings =+
  1064.  
  1065.     Debug-Output "PassThru: Removing "$(TransportProductSoftwareName)" Software Component from Registry"
  1066.  
  1067.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1068.         $(TransportProductSoftwareName)
  1069.  
  1070.     ; ignore errors for now
  1071.  
  1072. RemovePassThru = +
  1073.  
  1074.     Set RegKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion"
  1075.     OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) NTVersionKey
  1076.     GetRegValue $(NTVersionKey) "CurrentVersion" NTVersionRec
  1077.     Set NTVersion = *($(NTVersionRec),4)
  1078.     CloseRegKey $(NTVersionKey)
  1079.  
  1080.     RunProgram ExitCode "" "" $(DASetupNT) d
  1081.  
  1082.     AddfileToDeleteList $(ProductSoftwareImagePathTxt)
  1083.     AddfileToDeleteList $(ProductMiniportSoftwareImagePathTxt)
  1084.     AddfileToDeleteList $(PostProcessInf)
  1085.     AddfileToDeleteList $(DASetupNT)
  1086.     AddfileToDeleteList $(SetupINFName)
  1087.     AddfileToDeleteList    $(DASmartN)
  1088.     AddfileToDeleteList $(DA15CFGEXE)
  1089.     ;AddfileToDeleteList    $(DA15CFGINI)
  1090.     AddfileToDeleteList    $(DACFGHLP)
  1091.     ;AddfileToDeleteList    $(DACFGCPL) ;done in restore pacecfg in .c program
  1092.     AddfileToDeleteList    $(DACFGCPLSAV)
  1093.     ;AddfileToDeleteList    $(DACFGAPPLST)
  1094.  
  1095.  
  1096.  
  1097.     Set RegKey = $(!NTN_ServiceBase)
  1098.     OpenRegKey $(!REG_H_LOCAL) "" $(RegKey) $(MAXIMUM_ALLOWED) PassThru_Key
  1099.     
  1100.     ifstr(i) $(PassThru_Key) != ""
  1101.         Debug-Output "PassThru: about to delete "$(RegKey)
  1102.         DeleteRegTree $(PassThru_Key) $(AdapterProductSoftwareName)
  1103.         CloseRegKey $(PassThru_Key)
  1104.     else
  1105.         Debug-Output "PassThru: Failed to delete "$(RegKey)
  1106.     endif
  1107.  
  1108.     goto end
  1109.  
  1110. configure =+
  1111.  
  1112.     set Error = "Configuration Not Implemented"
  1113.     set from = end
  1114.     goto nonfatalinfo
  1115.     
  1116. update = +
  1117.  
  1118.     set Error = "Update Not Implemented, Remove and Reinstall"
  1119.     set from = end
  1120.     goto nonfatalinfo
  1121.  
  1122. successful = +
  1123.     goto end
  1124. warning = +
  1125.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1126.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1127.         goto ShellCodeError
  1128.     endif
  1129.     ifstr(i) $($R1) == "OK"
  1130.         goto $(to)
  1131.     else-ifstr(i) $($R1) == "CANCEL"
  1132.         goto $(from)
  1133.     else
  1134.         goto "end"
  1135.     endif
  1136. nonfatalinfo = +
  1137.     Set CommonStatus = STATUS_USERCANCEL
  1138.     Set Severity = STATUS
  1139.     goto nonfatalmsg
  1140. nonfatal = +
  1141.     Set Severity = NONFATAL
  1142.     goto nonfatalmsg
  1143. nonfatalmsg = +
  1144.     ifstr(i) $(Error) == ""
  1145.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1146.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1147.             goto ShellCodeError
  1148.         endif
  1149.         set Error = $($R0)
  1150.     endif
  1151.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1152.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1153.         goto ShellCodeError
  1154.     endif
  1155.     ifstr(i) $($R1) == "OK"
  1156.         goto $(from)
  1157.     else
  1158.         goto "end"
  1159.     endif
  1160. fatalregistry = +
  1161.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1162.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1163.         goto ShellCodeError
  1164.     endif
  1165.     set Error = $($R0)
  1166.     goto fatal
  1167. fatal = +
  1168.     ifstr(i) $(Error) == ""
  1169.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1170.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1171.             goto ShellCodeError
  1172.         endif
  1173.         set Error = $($R0)
  1174.     endif
  1175.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1176.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1177.         goto ShellCodeError
  1178.     endif
  1179.     goto setfailed
  1180. ShellCodeError = +
  1181.     set DlgType      = "MessageBox"
  1182.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1183.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  1184.     set STF_MB_TYPE  = 1
  1185.     set STF_MB_ICON  = 3
  1186.     set STF_MB_DEF   = 1
  1187.     ui start "Error Message"
  1188.     goto setfailed
  1189. setfailed = +
  1190.     set CommonStatus = STATUS_FAILED
  1191.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1192.         set OEM_ABANDON_ON = FALSE
  1193.         goto deinstall
  1194.     endif
  1195.     goto end
  1196. end = +
  1197.     goto term
  1198. term = +
  1199.     Return $(CommonStatus)
  1200.  
  1201. [StripTrailSlash]
  1202.     Split-String $($0) "\" InList
  1203.     QueryListSize InListSize, $(InList)
  1204.     Ifint $(InListSize) <= 1
  1205.         Return $($0)
  1206.     Endif
  1207.     Set NewString = ""
  1208.     ForListDo $(InList)
  1209.         ifint $(#) < $(InListSize)
  1210.             Set NewString = $(NewString)$($)
  1211.         else-ifstr $($) != "\"
  1212.             Set NewString = $(NewString)$($)
  1213.         endif
  1214.     EndForListDo
  1215.     Return $(NewString)
  1216.  
  1217. [Install-Option]
  1218.     set STF_VITAL = ""
  1219.     ifstr(i) $(AddCopy) == "YES"
  1220.         Debug-Output "PassThru: oemsetup.inf: PlatformDir "$(PlatformDir)
  1221.  
  1222.         ;AddSectionFilesToCopyList Files-Platform-Drivers $(PlatformDir) $(!STF_WINDOWSSYSPATH)\drivers
  1223.         AddSectionFilesToCopyList Files-Platform-Drivers $(InfDir) $(!STF_WINDOWSSYSPATH)\drivers
  1224.         AddSectionFilesToCopyList Post-Process-Program $(InfDir) $(!STF_WINDOWSSYSPATH)
  1225.         AddSectionFilesToCopyList Files-Platform-Utility $(InfDir) $(!STF_WINDOWSSYSPATH)
  1226.         AddSectionFilesToCopyList Files-Inf $(InfDir) $(!STF_WINDOWSSYSPATH)
  1227.     endif
  1228.     ifstr(i) $(DoCopy) == "YES"
  1229.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1230.        CopyFilesInCopyList
  1231.     endif
  1232.     ifstr(i) $(DoConfig) == "YES"
  1233.     endif
  1234.     Exit
  1235.  
  1236. [Install-Update]
  1237.    set STF_VITAL        = ""
  1238.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1239.    ;AddSectionFilesToCopyList Files-Platform-Drivers $(PlatformDir) $(!STF_WINDOWSSYSPATH)\drivers
  1240.    AddSectionFilesToCopyList Files-Platform-Drivers $(InfDir) $(!STF_WINDOWSSYSPATH)\drivers
  1241.    AddSectionFilesToCopyList Files-Platform-Utility $(InfDir) $(!STF_WINDOWSSYSPATH)
  1242.    AddSectionFilesToCopyList Files-Inf $(InfDir) $(!STF_WINDOWSSYSPATH)
  1243.    exit
  1244.  
  1245. [Source Media Descriptions]
  1246.      1 = "DAPassThru Driver Installation Disk", TAGFILE = disk1
  1247.  
  1248. [ProductType]
  1249. STF_PRODUCT  = Winnt
  1250.  
  1251. [Files-Inf]
  1252. ;1, oemsetup.INF, SIZE=999, RENAME=$(!UG_Filename)
  1253. 1, oemsetup.INF, SIZE=999
  1254.  
  1255. [Files-Platform-Drivers]
  1256. ;1, passthru.SYS , SIZE=999
  1257. 1, DAMINI.SYS , SIZE=999
  1258. 1, DAPROT.SYS, SIZE=999
  1259.  
  1260. [Files-Platform-Utility]
  1261. 1, DASetup.EXE, SIZE=999
  1262. 1, DA15cfg.EXE, SIZE=999
  1263. 1, DAcfg.hlp, SIZE=999
  1264. 1, DASmartN.EXE, SIZE=999
  1265. ;1, DA15cfg.INI, SIZE=999
  1266. ;1, Pacecfg.cpl, SIZE=999
  1267. ;1, DAcfgApp.lst, SIZE=999
  1268. ;1, DADeinstallNT.EXE, SIZE=999
  1269.  
  1270. [Post-Process-Program]
  1271. 1, PRUN.INF, SIZE=999
  1272.  
  1273. [DialogConstantsENG]
  1274. Help                        = "&Help"
  1275. Exit                        = "Cancel"
  1276. OK                          = "OK"
  1277. HelpContext                 = ""
  1278. Continue                    = "Continue"
  1279. Cancel                      = "Cancel"
  1280.  
  1281.