home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 February / VPR9602A.ISO / drvlib / netcard / ppc / streamer / oemsetup.inf < prev    next >
INI File  |  1995-10-27  |  29KB  |  971 lines

  1. ;-------------------------------------------------------------------
  2. ;
  3. ;   MODULE NAME:        OEMSETUP.INF
  4. ;
  5. ;   DESCRIPTION:        Installation parameter script for busmaster
  6. ;                       network adapter drivers running under
  7. ;                       Microsoft Windows NT.
  8. ;
  9. ;                       This script is interpreted by SETUP.EXE
  10. ;                       during driver installation.  It consists
  11. ;                       of the following four required sections
  12. ;                       and other supporting sections:
  13. ;
  14. ;                       1.  Identify
  15. ;                       2.  ReturnOptions
  16. ;                       3.  InstallOption
  17. ;                       4.  Source Media Descriptions
  18. ;-------------------------------------------------------------------
  19.  
  20. ;-------------------------------------------------------------------
  21. ;   SECTION NAME:       Identify
  22. ;
  23. ;   DESCRIPTION:        This required section verifies that this
  24. ;                       script supports the option currently selected.
  25. ;
  26. ;   INPUT:              None.
  27. ;
  28. ;   OUTPUT:             $($R0)      Status
  29. ;                       $($R1)      Option Type
  30. ;                       $($R2)      Diskette Description
  31. ;-------------------------------------------------------------------
  32.  
  33. [Identify]
  34.  
  35.     set Status      =   STATUS_SUCCESSFUL
  36.     set OptionType  =   NetAdapter
  37.     set Media       =   #("Source Media Descriptions", 1, 1)
  38.     return $(Status) $(OptionType) $(Media)
  39.  
  40. [Source Media Descriptions]
  41.  
  42.     1  = "IBM Streamer Installation Disk"
  43.     2  = "Windows NT Setup CD-ROM Disk"
  44.  
  45.  
  46. ;-------------------------------------------------------------------
  47. ;   SECTION NAME:       ReturnOptions
  48. ;
  49. ;   DESCRIPTION:        This required section returns the list of
  50. ;                       options supported by this script and the
  51. ;                       text list representing the options.
  52. ;
  53. ;
  54. ;   INPUT:              $($0)       Language code
  55. ;
  56. ;   OUTPUT:             $($R0)      Status
  57. ;                       $($R1)      Option List
  58. ;                       $($R2)      Option Text List
  59. ;-------------------------------------------------------------------
  60.  
  61. [ReturnOptions]
  62.  
  63.     set Status          =   STATUS_FAILED
  64.     set OptionList      =   {}
  65.     set OptionTextList  =   {}
  66.     set LanguageList    =   ^(LanguagesSupported, 1)
  67.  
  68.     ifcontains(i) $($0) not-in $(LanguageList)
  69.         set Status = STATUS_NOLANGUAGE
  70.         goto End_ReturnOptions
  71.     endif
  72.  
  73.     ifstr(i) $($1) == ""
  74.         goto OK_ReturnOptions
  75.     endif
  76.  
  77.     set PlatformList = ^(PlatformsSupported, 1)
  78.     Ifcontains(i) $($1) in $(PlatformList)
  79.         goto OK_ReturnOptions
  80.     else
  81.         set Status = STATUS_NOTSUPPORTED
  82.         goto End_ReturnOptions
  83.     endif
  84.  
  85. OK_ReturnOptions = +
  86.     set OptionList      = ^(Options, 1)
  87.     set OptionTextList  = ^(OptionsText$($0), 1)
  88.     set Status          = STATUS_SUCCESSFUL
  89.  
  90. End_ReturnOptions = +
  91.     Return $(Status) $(OptionList) $(OptionTextList)
  92.  
  93. [LanguagesSupported]
  94.  
  95.     ENG
  96.  
  97. [PlatformsSupported]
  98.  
  99.     MCA
  100.     ISA
  101.     EISA
  102.  
  103. [Options]
  104.  
  105.     STREAMER
  106.  
  107. [OptionsTextENG]
  108.  
  109.     STREAMER    =   "IBM Streamer Family Adapters"
  110.  
  111.  
  112. ;-------------------------------------------------------------------
  113. ;
  114. ;   SECTION NAME:       InstallOption
  115. ;
  116. ;   DESCRIPTION:        This required section is shelled to by main
  117. ;                       installation processing or by NCPASHEL.INF
  118. ;                       during reconfiguration, removal, update,
  119. ;                       etc.  It performs three main functions:
  120. ;
  121. ;                       1.  Copies files representing options
  122. ;                       2.  Configures the installed option
  123. ;                       3.  Updates the registry for the installed
  124. ;                           option.
  125. ;
  126. ; INPUT:                $($0)       Language to use
  127. ;                       $($1)       OptionID to install
  128. ;                       $($2)       SourceDirectory
  129. ;                       $($3)       AddCopy  (YES | NO)
  130. ;                       $($4)       DoCopy   (YES | NO)
  131. ;                       $($5)       DoConfig (YES | NO)
  132. ;
  133. ; OUTPUT:               $($R0)      Status
  134. ;
  135. ;------------------------------------------------------------------------
  136.  
  137. [InstallOption]
  138.  
  139.     StartWait
  140.  
  141.     set Status  =   STATUS_FAILED
  142.  
  143.     set Option   = $($1)
  144.     set SrcDir   = $($2)
  145.     set AddCopy  = $($3)
  146.     set DoCopy   = $($4)
  147.     set DoConfig = $($5)
  148.  
  149.     set LanguageList = ^(LanguagesSupported, 1)
  150.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  151.         Return STATUS_NOLANGUAGE
  152.     endif
  153.  
  154.     read-syms GeneralConstants
  155.     read-syms FileConstants
  156.     read-syms FileConstants$(!STF_LANGUAGE)
  157.  
  158.     detect date
  159.  
  160.     set-title  $(FunctionTitle)
  161.  
  162.     set to   = Begin
  163.     set from = Begin
  164.  
  165.     set CommonStatus = STATUS_SUCCESSFUL
  166.  
  167.     EndWait
  168.  
  169. Begin = +
  170.  
  171.     ifstr(i) $(!NTN_InstallMode) == DeInstall
  172.         set from = fatal
  173.         set to   = fatal
  174.         goto RemoveAdapter
  175.     endif
  176.  
  177.     ifstr(i) $(!NTN_InstallMode) == Update
  178.         set from = fatal
  179.         set to   = fatal
  180.         goto UpgradeSoftware
  181.     endif
  182.  
  183.     ifstr(i) $(!NTN_InstallMode) == Bind
  184.         set from = fatal
  185.         set to   = fatal
  186.         goto BindingAdapter
  187.     endif
  188.  
  189.     ifstr(i) $(!NTN_InstallMode) == Configure
  190.         set CommonStatus = STATUS_REBOOT
  191.         ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  192.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  193.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  194.                 goto ShellCodeError
  195.             endif
  196.             set Error = $($R0)
  197.             set from  = end
  198.             set to    = end
  199.             goto NonFatalInfo
  200.         endif
  201.         set from = fatal
  202.         set to   = fatal
  203.         goto ConfigureAdapter
  204.     endif
  205.  
  206.     set OEM_ABANDON_OPTIONS = {}
  207.     set OEM_ABANDON_SOFTWARE = FALSE
  208.     set OEM_ABANDON_ON = TRUE
  209.     set from = fatal
  210.     set to = fatal
  211.     goto InstallAdapter
  212.  
  213. InstallAdapter = +
  214.  
  215.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  216.  
  217.     Ifstr $(KeyProduct) == $(KeyNull)
  218.         set OldVersionExisted = $(FALSE)
  219.         goto LoadDLL
  220.     endif
  221.  
  222. OldInstall = +
  223.  
  224.     CloseRegKey $(KeyProduct)
  225.  
  226.     ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
  227.  
  228.         Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  229.             $(ProductVersion)
  230.  
  231.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  232.             goto ShellCodeError
  233.         endif
  234.  
  235.         goto end
  236.  
  237.     endif
  238.  
  239.     Shell $(UtilityInf), CardExistedDlg
  240.  
  241.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  242.         goto ShellCodeError
  243.     endif
  244.  
  245.     ifstr(i) $($R1) != "OK"
  246.         Set CommonStatus = STATUS_USERCANCEL
  247.         goto end
  248.     endif
  249.  
  250.     set OldVersionExisted = $(TRUE)
  251.  
  252. LoadDLL = +
  253.  
  254.     set OldSource = $(!STF_SRCDIR)
  255.  
  256.     Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(!STF_SRCDIR)
  257.  
  258.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  259.         goto fatal
  260.     endif
  261.     Ifstr(i) $($R0) == STATUS_FAILED
  262.         goto fatal
  263.     endif
  264.     Ifstr(i) $($R0) == STATUS_USERCANCEL
  265.         goto end
  266.     endif
  267.  
  268.     set !STF_SRCDIR = $($R1)
  269.  
  270.     install "Install-Dll"
  271.  
  272.     set !STF_SRCDIR = $(OldSource)
  273.  
  274.     StartWait
  275.  
  276.     Set STREAMER_2BYTE = 143
  277.     Set STREAMER_1BYTE_LIST = {160, 162, 164, 168}
  278.     Set AdapterList = {}
  279.  
  280.     ForListDo $(STREAMER_1BYTE_LIST)
  281.  
  282.         Set STREAMER_1BYTE = $($)
  283.  
  284.         set-mul mcaid = $(STREAMER_2BYTE), 256
  285.         set-add mcaid = $(mcaid), $(STREAMER_1BYTE)
  286.         set-dectohex mcaid_hex = $(mcaid)
  287.  
  288.         Shell $(UtilityInf), MCAFindBus, $(STREAMER_1BYTE), $(STREAMER_2BYTE)
  289.  
  290.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  291.             goto ShellCodeError
  292.         endif
  293.  
  294.         ifstr $($R0) != "NO_ERROR"
  295.             set Error = $($R0)
  296.             goto fatal
  297.         endif
  298.  
  299.         ifstr(i) $($R1) != {}
  300.  
  301.             QueryListSize ListSize $(AdapterList)
  302.  
  303.             set MCA_List = $($R1)
  304.  
  305.             ForListDo $(MCA_List)
  306.                 set BusSlotMca = $($)
  307.                 set AdapterList = >($(AdapterList), $(BusSlotMca))
  308.             EndForListDo
  309.  
  310.             QueryListSize ListSize $(AdapterList)
  311.  
  312.         endif
  313.  
  314.     EndForListDo
  315.  
  316.     ;   ------------------------------------------------------------
  317.     ;   Prompt for PCI card installation
  318.     ;   ------------------------------------------------------------
  319.  
  320.     Set DlgType = "MessageBox"
  321.     Set STF_MB_TITLE = "Bus Type Determination"
  322.     Set STF_MB_TEXT  = "Do you wish to configure a PCI network adapter?"
  323.     Set STF_MB_TYPE  = "3" ; YES and NO buttons
  324.     Set STF_MB_ICON  = "1" ; No icon
  325.     Set STF_MB_DEF   = "2" ; Default is NO
  326.     ui start "PCI"
  327.     ifstr(i) $(DLGEVENT) == "YES"
  328.         Set BusSlotID = {0, 0, $(PCI_ADAPTER_ID)}
  329.         Set AdapterList = >($(AdapterList), $(BusSlotID))
  330.     endif
  331.  
  332.     ;   ------------------------------------------------------------
  333.     ;   End of PCI logic
  334.     ;   ------------------------------------------------------------
  335.  
  336.     QueryListSize ListSize $(AdapterList)
  337.  
  338.     ifstr(i) $(AdapterList) == {}
  339.         set Error = $(CANNOT_FIND_ANY_CARD)
  340.         set CommonStatus = STATUS_USERCANCEL
  341.         set from = "end"
  342.         goto nonfatal
  343.     endif
  344.  
  345.     ifint $(OldVersionExisted) == $(FALSE)
  346.         goto NewDriverInstall
  347.     else
  348.         goto AfterNewDriverInstall
  349.     endif
  350.  
  351. NewDriverInstall = +
  352.  
  353.     Ifstr(i) $(DoCopy) == "YES"
  354.        Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  355.        Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  356.            Goto ShellCodeError
  357.        Else-Ifstr(i) $($R0) == STATUS_FAILED
  358.            Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  359.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  360.                goto ShellCodeError
  361.            endif
  362.            set Error = $($R0)
  363.            Goto fatal
  364.        Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  365.            Goto successful
  366.        Endif
  367.        Set SrcDir = $($R1)
  368.     Endif
  369.  
  370.     install "Install-Option"
  371.  
  372.     ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  373.        Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  374.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  375.            goto ShellCodeError
  376.        endif
  377.        set Error = $($R0)
  378.        goto fatal
  379.     endif
  380.  
  381.     Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  382.         $(ProductSoftwareName), +
  383.         $(ProductSoftwareName), +
  384.         $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  385.         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  386.         $(NetEventDLL)
  387.  
  388.     Set OEM_ABANDON_SOFTWARE = TRUE
  389.  
  390.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  391.         goto ShellCodeError
  392.     endif
  393.  
  394.     set RegistryErrorIndex = $($R0)
  395.     Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  396.         EndWait
  397.         CloseRegKey $($R1)
  398.         CloseRegKey $($R2)
  399.         CloseRegKey $($R3)
  400.         CloseRegKey $($R4)
  401.         CloseRegKey $($R5)
  402.         goto FatalRegistry
  403.     endif
  404.  
  405.     Set SoftProductKey      = $($R1)
  406.     Set SoftNetRuleKey      = $($R2)
  407.     Set SoftServiceKey      = $($R3)
  408.     Set SoftParameterKey    = $($R4)
  409.     Set SoftLinkageKey      = $($R5)
  410.  
  411.     set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  412.                        {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  413.                        {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  414.                        {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  415.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  416.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  417.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  418.  
  419.     Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  420.  
  421.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  422.         goto ShellCodeError
  423.     endif
  424.  
  425.     set RegistryErrorIndex = $($R0)
  426.     Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  427.         EndWait
  428.         CloseRegKey $(SoftProductKey)
  429.         CloseRegKey $(SoftNetRuleKey)
  430.         CloseRegKey $(SoftServiceKey)
  431.         CloseRegKey $(SoftParameterKey)
  432.         CloseRegKey $(SoftLinkageKey)
  433.         goto FatalRegistry
  434.     endif
  435.  
  436.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  437.                         {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  438.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  439.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  440.                         {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  441.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  442.  
  443.     Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  444.  
  445.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  446.         goto ShellCodeError
  447.     endif
  448.  
  449.     set RegistryErrorIndex = $($R0)
  450.     CloseRegKey $(SoftProductKey)
  451.     CloseRegKey $(SoftNetRuleKey)
  452.     CloseRegKey $(SoftServiceKey)
  453.     CloseRegKey $(SoftParameterKey)
  454.     CloseRegKey $(SoftLinkageKey)
  455.     Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  456.         EndWait
  457.         goto FatalRegistry
  458.     endif
  459.  
  460. AfterNewDriverInstall = +
  461.  
  462.     ForListDo $(AdapterList)
  463.  
  464.         set BusNum = *($($),1)
  465.         set SlotNum = *($($),2)
  466.         set NETCARD_ID = *($($),3)
  467.  
  468.         Shell $(UtilityInf), IsNetCardAlreadyInstalled, +
  469.             $(BusNum), +
  470.             $(SlotNum), +
  471.             $(ProductHardwareDescription), +
  472.             $(ProductHardwareName)
  473.  
  474.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  475.             goto ShellCodeError
  476.         endif
  477.         ifstr $($R0) != "NO_ERROR"
  478.             set Error = $($R0)
  479.             goto fatal
  480.         endif
  481.  
  482.         ifstr(i) $($R1) == "YES"
  483.             goto NextAdapter
  484.         endif
  485.  
  486.         Shell $(UtilityInf), AddHardwareComponent, +
  487.             $(ProductHardwareName),+
  488.             $(STF_CONTEXTINFNAME),+
  489.             $(ProductKeyName)
  490.  
  491.         ifint $($R4) != -1
  492.             Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  493.         endif
  494.  
  495.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  496.             goto ShellCodeError
  497.         endif
  498.         set RegistryErrorIndex = $($R0)
  499.         Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  500.             EndWait
  501.             CloseRegKey $($R1)
  502.             CloseRegKey $($R2)
  503.             CloseRegKey $($R3)
  504.             goto FatalRegistry
  505.         endif
  506.  
  507.         Set HardNetCardKey      = $($R1)
  508.         Set HardNetRuleKey      = $($R2)
  509.         Set HardParameterKey    = $($R3)
  510.         Set AdapterNumber       = $($R4)
  511.         ifint $(NETCARD_ID) == $(PCI_ADAPTER_ID)
  512.             Set-add SlotNum = $(AdapterNumber), "16"
  513.         endif
  514.  
  515.         ifint $(NETCARD_ID) == 36768
  516.             set MyTitle = "Slot "$(SlotNum)": IBM LANStreamer MC 32 Adapter"
  517.         else-ifint $(NETCARD_ID) == 36770
  518.             set MyTitle = "Slot "$(SlotNum)": IBM Auto LANStreamer MC 32 Adapter"
  519.         else-ifint $(NETCARD_ID) == 36772
  520.             set MyTitle = "Slot "$(SlotNum)": IBM LANStreamer MC 16 Adapter"
  521.         else-ifint $(NETCARD_ID) == 36776
  522.             set MyTitle = "Slot "$(SlotNum)": IBM EtherStreamer MC 32 Adapter"
  523.         else-ifint $(NETCARD_ID) == $(PCI_ADAPTER_ID)
  524.             set MyTitle = "["$(SlotNum)"] IBM Auto LANStreamer PCI Adapter"
  525.         else
  526.             set MyTitle = "["$($R4)"] "$(ProductHardwareTitle)
  527.         endif
  528.  
  529.         Set MyService = "Streamer"$(AdapterNumber)
  530.  
  531.         Set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  532.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(MyTitle)},+
  533.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  534.                            {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  535.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  536.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  537.  
  538.         Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  539.  
  540.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  541.             goto ShellCodeError
  542.         endif
  543.  
  544.         CloseRegKey $(HardParameterKey)
  545.  
  546.         RunProgram ExitCode "" "" $(!STF_WINDOWSSYSPATH)"\stsetup.exe" +
  547.             $(MyService) $(SlotNum) $(NETCARD_ID)
  548.  
  549.         set CFG_ReturnCode = $(DLG_PB_CANCEL)
  550.         ifint $(ExitCode) == 0
  551.             set CFG_ReturnCode = $(DLG_PB_OK)
  552.         endif
  553.  
  554.         ifint $(CFG_ReturnCode) != $(DLG_PB_OK)
  555.             set CommonStatus = STATUS_USERCANCEL
  556.             goto abandon
  557.         endif
  558.  
  559.         set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  560.         set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  561.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  562.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  563.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  564.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  565.  
  566.         Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  567.  
  568.         CloseRegKey $(HardNetCardKey)
  569.         CloseRegKey $(HardNetRuleKey)
  570.         CloseRegKey $(HardParameterKey)
  571.  
  572.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  573.             goto ShellCodeError
  574.         endif
  575.  
  576. NextAdapter = +
  577.  
  578.     EndForListDo
  579.  
  580. LastAdapter = +
  581.  
  582.     EndWait
  583.  
  584.     goto successful
  585.  
  586. ConfigureAdapter = +
  587.  
  588.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) NetCardKey
  589.     ifstr(i) $(NetCardKey) == ""
  590.         set CommonStatus = STATUS_USERCANCEL
  591.         goto successful
  592.     endif
  593.     GetRegValue $(NetCardKey) "ServiceName" ServiceInfo
  594.     set ServiceName = *($(ServiceInfo),4)
  595.     CloseRegKey $(NetCardKey)
  596.  
  597.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) ParamKey
  598.     ifstr(i) $(ParamKey) == ""
  599.         goto successful
  600.     endif
  601.  
  602.     set NETCARD_ID = "?"
  603.     GetRegValue $(ParamKey),"McaPosId", RegList
  604.     ifstr *($(RegList), 4) != ""
  605.         set NETCARD_ID = *($(RegList), 4)
  606.     endif
  607.  
  608.     set SlotNum = "?"
  609.     GetRegValue $(ParamKey),"SlotNumber", RegList
  610.     ifstr *($(RegList), 4) != ""
  611.         set SlotNum = *($(RegList), 4)
  612.     endif
  613.  
  614.     CloseRegKey $(ParamKey)
  615.  
  616.     RunProgram ExitCode "" "" $(!STF_WINDOWSSYSPATH)"\stsetup.exe" +
  617.         $(ServiceName) $(SlotNum) $(NETCARD_ID)
  618.  
  619.     set CFG_ReturnCode = $(DLG_PB_CANCEL)
  620.     ifint $(ExitCode) == 0
  621.         set CFG_ReturnCode = $(DLG_PB_OK)
  622.     endif
  623.  
  624.     ifint $(CFG_ReturnCode) != $(DLG_PB_OK)
  625.         set CommonStatus = STATUS_USERCANCEL
  626.         goto end
  627.     endif
  628.  
  629.     goto successful
  630.  
  631. BindingAdapter =+
  632.  
  633.     set Error = "Binding: Sorry, not yet implemented."
  634.     goto fatal
  635.  
  636. RemoveAdapter = +
  637.  
  638.  
  639.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  640.  
  641.         Shell $(UtilityInf), RemoveSoftwareComponent, +
  642.             $(Manufacturer), +
  643.             $(ProductSoftwareName)
  644.  
  645.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  646.             goto ShellCodeError
  647.         endif
  648.  
  649.         set RegistryErrorIndex = $($R0)
  650.  
  651.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  652.             goto FatalRegistry
  653.         endif
  654.  
  655.     else
  656.  
  657.         Shell $(UtilityInf), RemoveHardwareComponent, +
  658.             $(Manufacturer), +
  659.             $(ProductSoftwareName), +
  660.             $(!NTN_RegBase)
  661.  
  662.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  663.             goto ShellCodeError
  664.         endif
  665.  
  666.         set RegistryErrorIndex = $($R0)
  667.  
  668.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  669.             goto FatalRegistry
  670.         endif
  671.  
  672.     endif
  673.  
  674.     goto end
  675.  
  676. UpgradeSoftware = +
  677.  
  678.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  679.  
  680.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  681.  
  682.         Ifstr $(KeyProduct) != $(KeyNull)
  683.  
  684.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  685.             set Version = *($(VersionInfo), 4)
  686.  
  687.             Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  688.  
  689.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  690.                 goto ShellCodeError
  691.             endif
  692.  
  693.             set !UG_Filename = $($R0)
  694.  
  695.             ifstr(i) $(!UG_Filename) != ""
  696.                 install "Install-Update"
  697.                 ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  698.                     goto fatal
  699.                 endif
  700.             endif
  701.  
  702.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  703.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  704.  
  705.             ifint $(Version) != $(ProductVersion)
  706.             endif
  707.  
  708.             CloseRegKey $(KeyProduct)
  709.  
  710.         else
  711.  
  712.             goto FatalRegistry
  713.  
  714.         endif
  715.  
  716.     else
  717.  
  718.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  719.               $(MAXIMUM_ALLOWED) NetworkCardKey
  720.  
  721.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  722.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  723.             set ServiceName = *($(ServiceNameInfo), 4)
  724.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  725.                 $(MAXIMUM_ALLOWED) NetRuleKey
  726.  
  727.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  728.             else
  729.                 goto FatalRegistry
  730.             endif
  731.  
  732.             CloseRegKey $(NetRules)
  733.             CloseRegKey $(NetworkCardKey)
  734.         else
  735.             goto FatalRegistry
  736.         endif
  737.  
  738.         OpenRegKey $(!REG_H_LOCAL) "" +
  739.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  740.               $(MAXIMUM_ALLOWED) ServiceKey
  741.  
  742.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  743.             CloseRegKey $(ServiceKey)
  744.         else
  745.             goto FatalRegistry
  746.         endif
  747.     endif
  748.  
  749.     goto end
  750.  
  751. successful = +
  752.     goto end
  753.  
  754. abandon = +
  755.     ForListDo $(OEM_ABANDON_OPTIONS)
  756.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  757.             $(ProductSoftwareName), $($)
  758.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  759.             goto ShellCodeError
  760.         endif
  761.         set RegistryErrorIndex = $($R0)
  762.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  763.             goto FatalRegistry
  764.         endif
  765.     EndForListDo
  766.  
  767.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  768.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  769.             $(ProductSoftwareName), FALSE
  770.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  771.             goto ShellCodeError
  772.         endif
  773.         set RegistryErrorIndex = $($R0)
  774.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  775.             goto FatalRegistry
  776.         endif
  777.     endif
  778.     goto end
  779.  
  780. warning = +
  781.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  782.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  783.         goto ShellCodeError
  784.     endif
  785.     ifstr(i) $($R1) == "OK"
  786.         goto $(to)
  787.     else-ifstr(i) $($R1) == "CANCEL"
  788.         goto $(from)
  789.     else
  790.         goto "end"
  791.     endif
  792.  
  793. NonFatalInfo = +
  794.     Set CommonStatus = STATUS_USERCANCEL
  795.     Set Severity = STATUS
  796.     goto NonFatalMsg
  797.  
  798. nonfatal = +
  799.     Set Severity = NONFATAL
  800.     goto NonFatalMsg
  801.  
  802. NonFatalMsg = +
  803.     ifstr(i) $(Error) == ""
  804.         Set Severity = NONFATAL
  805.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  806.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  807.             goto ShellCodeError
  808.         endif
  809.         set Error = $($R0)
  810.     endif
  811.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  812.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  813.         goto ShellCodeError
  814.     endif
  815.     ifstr(i) $($R1) == "OK"
  816.         goto $(from)
  817.     else
  818.         goto "end"
  819.     endif
  820.  
  821. FatalRegistry = +
  822.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  823.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  824.         goto ShellCodeError
  825.     endif
  826.     set Error = $($R0)
  827.     goto fatal
  828.  
  829. fatal = +
  830.     ifstr(i) $(Error) == ""
  831.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  832.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  833.             goto ShellCodeError
  834.         endif
  835.         set Error = $($R0)
  836.     endif
  837.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  838.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  839.         goto ShellCodeError
  840.     endif
  841.     goto setfailed
  842.  
  843. ShellCodeError = +
  844.     set DlgType      = "MessageBox"
  845.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  846.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  847.     set STF_MB_TYPE  = 1
  848.     set STF_MB_ICON  = 3
  849.     set STF_MB_DEF   = 1
  850.     ui start "Error Message"
  851.     goto setfailed
  852.  
  853. setfailed = +
  854.     set CommonStatus = STATUS_FAILED
  855.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  856.         set OEM_ABANDON_ON = FALSE
  857.         goto abandon
  858.     endif
  859.     goto end
  860.  
  861. end = +
  862.     goto term
  863.  
  864. term = +
  865.  
  866.     Return $(CommonStatus)
  867.  
  868. [GeneralConstants]
  869.  
  870.     from                =   ""
  871.     to                  =   ""
  872.     KeyNull             =   ""
  873.     MAXIMUM_ALLOWED     =   33554432
  874.     RegistryErrorIndex  =   NO_ERROR
  875.     KeyProduct          =   ""
  876.     TRUE                =   1
  877.     FALSE               =   0
  878.     NoTitle             =   0
  879.     OldVersionExisted   =   $(FALSE)
  880.  
  881.  
  882. [FileConstants]
  883.  
  884.     UtilityInf          =   "UTILITY.INF"
  885.     SubroutineInf       =   "SUBROUTN.INF"
  886.     SoftwareType        =   "driver"
  887.     StreamerDLL         =   "callcfg.dll"
  888.     NetEventDLL         =   "%SystemRoot%\System32\netevent.dll"
  889.     DLG_PB_OK           =   1281        ;   User pressed "OK" pushbutton
  890.     DLG_PB_CANCEL       =   1282        ;   User pressed "CANCEL" pushbutton
  891.     PCI_ADAPTER_ID      =   24          ;   0x0018 in decimal
  892.     Manufacturer        =   "Microsoft"
  893.     ProductMajorVersion =   "3"
  894.     ProductMinorVersion =   "1"
  895.     ProductVersion      =   $(ProductMajorVersion)"."$(ProductMinorVersion)
  896.     ProductSoftwareName     = "Streamer"
  897.     ProductSoftwareImagePath = "%SystemRoot%\system32\drivers\streamer.sys"
  898.     NetRuleSoftwareType     = "StreamerSys ndisDriver StreamerDriver"
  899.     NetRuleSoftwareUse      = $(SoftwareType)
  900.     NetRuleSoftwareBindForm = """StreamerSys"" yes no container"
  901.     NetRuleSoftwareClass    = {"streamer basic"}
  902.     NetRuleSoftwareBindable = {"streamerDriver streamerAdapter non exclusive 100"}
  903.     ProductHardwareName     = "Streamer"
  904.     NetRuleHardwareType     = "Streamer streamerAdapter"
  905.     NetRuleHardwareBindForm = " yes yes container"
  906.     NetRuleHardwareClass    = {"streamerAdapter basic"}
  907.     ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  908.     ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  909.  
  910. [FileConstantsENG]
  911.  
  912.     FunctionTitle               = "IBM Streamer Family Adapter Card Setup"
  913.     ProductSoftwareDescription  = "IBM Streamer Family Adapter Driver"
  914.     ProductHardwareDescription  = "IBM Streamer Family Adapter "
  915.     CANNOT_FIND_ANY_CARD        = "Network card is not present in the system"
  916.     ProductSoftwareTitle        = "IBM Streamer Family Adapter Driver"
  917.     ProductHardwareTitle        = "IBM Streamer Family Adapter "
  918.     ShellCodeErrorTitle         = "Error: "$(FunctionTitle)
  919.     ShellCodeErrorText          = "OEMSETUP.INF Shell Code Error."
  920.  
  921. [date]
  922.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  923.  
  924. [Files-Dll]
  925. 1, stsetup.exe, SIZE=57344
  926. 1, callcfg.dll, SIZE=26112
  927. 1, cfgedit.exe, SIZE=117760
  928.  
  929. [Files-Inf]
  930. 1, oemsetup.inf, SIZE=28036, RENAME=$(!UG_Filename)
  931.  
  932. [Files-STREAMER]
  933.  
  934. 1, STREAMER.SYS, SIZE=115200
  935.  
  936. [Install-Option]
  937.  
  938.     set STF_VITAL = ""
  939.  
  940.     ifstr(i) $(AddCopy) == "YES"
  941.  
  942.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  943.  
  944.     endif
  945.  
  946.     ifstr(i) $(DoCopy) == "YES"
  947.  
  948.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  949.        CopyFilesInCopyList
  950.  
  951.     endif
  952.  
  953.     Exit
  954.  
  955. [Install-Update]
  956.    set STF_VITAL        = ""
  957.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  958.  
  959.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  960.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  961.  
  962.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  963.    CopyFilesInCopyList
  964.    exit
  965.  
  966. [Install-Dll]
  967.    set STF_VITAL        = ""
  968.    AddSectionFilesToCopyList Files-Dll $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)
  969.    CopyFilesInCopyList
  970.    exit
  971.