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

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