Annotation of ntddk/src/setup/inf/ndis/oemnade2.inf, revision 1.1.1.1

1.1       root        1: ;***********************************************************************
                      2: ;
                      3: ; OEMNADE2.INF
                      4: ;
                      5: ;       Elink II network card and driver SETUP INF file.
                      6: ;
                      7: ; History:
                      8: ;       davidhov        00-Feb-1992     Created
                      9: ;       terryk          27-Feb-1992     Reorganize section location
                     10: ;                                       added comment
                     11: ;       terryk          03-Mar-1992     Changed to Elink II setup
                     12: ;       terryk          02-Apr-1992     Code review changed
                     13: ;       davidhov        03-Apr-1992     Enhanced to use new INF section
                     14: ;                                       structure from SunilP, et al.
                     15: ;       davidhov        06-Dec-1992     Netcard Detection
                     16: ;***********************************************************************
                     17: 
                     18: ;-----------------------------------------------------------------------
                     19: ; OPTION TYPE
                     20: ; -----------
                     21: ; This identifies the Option type we are dealing with.  The different
                     22: ; possible types are:
                     23: ;
                     24: ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
                     25: ;
                     26: ;  Types specific to networking:
                     27: ;
                     28: ; NetAdapter,        a netcard / adapter combination or just a netcard
                     29: ; NetDriver,         just a netcard driver
                     30: ; NetTransport,      a complete NDIS-compliant TDI transport stack
                     31: ; NetService,        an NT networking service
                     32: ; NetWork,           a complete network ensemble.
                     33: ; NetProvider        a complete network which supports NT MPR protocol
                     34: ;-----------------------------------------------------------------------
                     35: 
                     36: [Identification]
                     37:     OptionType = NetAdapter
                     38: 
                     39: ;-----------------------------------------------------------------------
                     40: ; PlatformsSupported
                     41: ; ------------------
                     42: ; This identifies the platforms supported by the adapter card.
                     43: ; Possible types are:
                     44: ;
                     45: ; ISA, EISA and MCA
                     46: ;-----------------------------------------------------------------------
                     47: 
                     48: [PlatformsSupported]
                     49:     ISA
                     50:     EISA
                     51:     "Jazz-Internal Bus"
                     52: 
                     53: ;-----------------------------------------------------------------------
                     54: ; OPTION LIST
                     55: ; -----------
                     56: ; This section lists the OEM Option key names.  These keys are locale
                     57: ; independent and used to represent the option in a locale independent
                     58: ; manner.
                     59: ;
                     60: ;-----------------------------------------------------------------------
                     61: 
                     62: [Options]
                     63:     ELNKII
                     64: 
                     65: ;***********************************************************************
                     66: ; CONSTANTS FOR USING DIALOGS
                     67: ;***********************************************************************
                     68: 
                     69: [FileConstants]
                     70: ;
                     71: ;  File names, etc.
                     72: ;
                     73: UtilityInf      = "UTILITY.INF"
                     74: ParamInf        = "NCPARAM.INF"
                     75: subroutineinf   = "SUBROUTN.INF"
                     76: SoftwareType    = "driver"
                     77: Exit_Code       = 0
                     78: 
                     79: ;
                     80: ; EventLog Message File
                     81: ;
                     82: NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
                     83: IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
                     84: 
                     85: ; Product Info
                     86: ;
                     87: Manufacturer    = "Microsoft"
                     88: ProductMajorVersion     = "3"
                     89: ProductMinorVersion     = "1"
                     90: ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
                     91: ;
                     92: ; Software
                     93: ;
                     94: ProductSoftwareName     = "Elnkii"
                     95: ProductSoftwareImagePath = "\SystemRoot\System32\drivers\elnkii.sys"
                     96: NetRuleSoftwareType     = "elnkiiSys ndisDriver elnkiiDriver"
                     97: NetRuleSoftwareUse      = $(SoftwareType)
                     98: NetRuleSoftwareBindForm = """ElnkIISys"" yes no container"
                     99: NetRuleSoftwareClass    = {"elnkiiDriver basic"}
                    100: NetRuleSoftwareBindable = {"elnkiiDriver elnkiiAdapter non exclusive 100"}
                    101: ;
                    102: ; Hardware
                    103: ;
                    104: ProductHardwareName     = "Elnkii"
                    105: NetRuleHardwareType     = "elnkii elnkiiAdapter"
                    106: NetRuleHardwareBindForm = " yes yes container"
                    107: NetRuleHardwareClass    = {"elnkiiAdapter basic"}
                    108: ;
                    109: ; Registry Key
                    110: ;
                    111: ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
                    112: ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
                    113: 
                    114: 
                    115: [GeneralConstants]
                    116: ;
                    117: ;  Program flow control variables.
                    118: ;
                    119: from      = ""
                    120: to        = ""
                    121: ;
                    122: ;  Return codes; Exit_Code is set to one of these
                    123: ;
                    124: ExitCodeOk     = 0
                    125: ExitCodeCancel = 1
                    126: ExitCodeFatal  = 2
                    127: 
                    128: KeyNull         = ""
                    129: MAXIMUM_ALLOWED   = 33554432
                    130: RegistryErrorIndex = NO_ERROR
                    131: KeyProduct      = ""
                    132: KeyParameters   = ""
                    133: 
                    134: TRUE            = 1
                    135: FALSE           = 0
                    136: NoTitle            = 0
                    137: 
                    138: ExitState   = "Active"
                    139: OldVersionExisted = $(FALSE)
                    140: 
                    141: DriverPath      = $(!STF_NTPATH)\drivers
                    142: 
                    143: [date]
                    144:     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
                    145:     ; Minute, Second }
                    146:     Now = {} ? $(!LIBHANDLE) GetSystemDate
                    147: 
                    148: 
                    149: ;---------------------------------------------------------------------------
                    150: ; 1. Identify
                    151: ;
                    152: ; DESCRIPTION:   To verify that this INF deals with the same type of options
                    153: ;                as we are choosing currently.
                    154: ;
                    155: ; INPUT:         None
                    156: ;
                    157: ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
                    158: ;                $($R1): Option Type (COMPUTER ...)
                    159: ;                $($R2): Diskette description
                    160: ;---------------------------------------------------------------------------
                    161: 
                    162: [Identify]
                    163:     ;
                    164:     ;
                    165:     read-syms Identification
                    166: 
                    167:     set Status     = STATUS_SUCCESSFUL
                    168:     set Identifier = $(OptionType)
                    169:     set Media      = #("Source Media Descriptions", 1, 1)
                    170: 
                    171:     Return $(Status) $(Identifier) $(Media)
                    172: 
                    173: ;------------------------------------------------------------------------
                    174: ; 2. ReturnOptions:
                    175: ;
                    176: ; DESCRIPTION:   To return the option list supported by this INF and the
                    177: ;                localised text list representing the options.
                    178: ;
                    179: ;
                    180: ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
                    181: ;
                    182: ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
                    183: ;                                STATUS_NOLANGUAGE
                    184: ;                                STATUS_FAILED
                    185: ;                                STATUS_NOTSUPPORTED
                    186: ;
                    187: ;                $($R1): Option List
                    188: ;                $($R2): Option Text List
                    189: ;------------------------------------------------------------------------
                    190: 
                    191: [ReturnOptions]
                    192:     ;
                    193:     ;
                    194:     set Status        = STATUS_FAILED
                    195:     set OptionList     = {}
                    196:     set OptionTextList = {}
                    197: 
                    198:     ;
                    199:     ; Check if the language requested is supported
                    200:     ;
                    201:     set LanguageList = ^(LanguagesSupported, 1)
                    202:     Ifcontains(i) $($0) in $(LanguageList)
                    203:         ;
                    204:         ; Check if the platforms requested is supported
                    205:         ;
                    206:         ifstr(i) $($1) == ""
                    207:                         goto returnoptions
                    208:         endif
                    209: 
                    210:         set PlatformList = ^(PlatformsSupported, 1)
                    211:         Ifcontains(i) $($1) in $(PlatformList)
                    212:                         goto returnoptions
                    213:         else
                    214:                         set Status = STATUS_NOTSUPPORTED
                    215:                         goto finish_ReturnOptions
                    216:         endif
                    217:     else
                    218:                 set Status = STATUS_NOLANGUAGE
                    219:                 goto finish_ReturnOptions
                    220:     endif
                    221: 
                    222:     ;
                    223:     ; form a list of all the options and another of the text representing
                    224:     ;
                    225: 
                    226: returnoptions = +
                    227:     set OptionList     = ^(Options, 1)
                    228:     set OptionTextList = ^(OptionsText$($0), 1)
                    229:     set Status         = STATUS_SUCCESSFUL
                    230: 
                    231: finish_ReturnOptions = +
                    232:     Return $(Status) $(OptionList) $(OptionTextList)
                    233: 
                    234: ;------------------------------------------------------------------------
                    235: ;
                    236: ; InstallOption:
                    237: ;
                    238: ;      This section is shelled to by main installation processing
                    239: ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
                    240: ;
                    241: ;
                    242: ; FUNCTION:  To copy files representing Options
                    243: ;            To configure the installed option
                    244: ;            To update the registry for the installed option
                    245: ;
                    246: ; INPUT:     $($0):  Language to use
                    247: ;            $($1):  OptionID to install
                    248: ;            $($2):  SourceDirectory
                    249: ;            $($3):  AddCopy  (YES | NO)
                    250: ;            $($4):  DoCopy   (YES | NO)
                    251: ;            $($5):  DoConfig (YES | NO)
                    252: ;
                    253: ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
                    254: ;                            STATUS_NOLANGUAGE |
                    255: ;                            STATUS_USERCANCEL |
                    256: ;                            STATUS_FAILED
                    257: ;
                    258: ;------------------------------------------------------------------------
                    259: [InstallOption]
                    260:     ;
                    261:     ; Set default values for
                    262:     ;
                    263:     set Status   = STATUS_FAILED
                    264:     ;
                    265:     ; extract parameters
                    266:     ;
                    267:     set Option   = $($1)
                    268:     set SrcDir   = $($2)
                    269:     set AddCopy  = $($3)
                    270:     set DoCopy   = $($4)
                    271:     set DoConfig = $($5)
                    272: 
                    273:     ;
                    274:     ; Check if the language requested is supported
                    275:     ;
                    276:     set LanguageList = ^(LanguagesSupported, 1)
                    277:     Ifcontains(i) $($0) NOT-IN $(LanguageList)
                    278:         Return STATUS_NOLANGUAGE
                    279:     endif
                    280: 
                    281:     set-subst LF = "\n"
                    282: 
                    283:     read-syms GeneralConstants
                    284:     read-syms FileConstants
                    285: 
                    286:     read-syms DialogConstants$(!STF_LANGUAGE)
                    287:     ifstr(i) $(!NTN_Origination) == "NCPA"
                    288:         set Continue = $(OK)
                    289:     endif
                    290:     read-syms FileConstants$(!STF_LANGUAGE)
                    291: 
                    292:     detect date
                    293: 
                    294:     set-title  $(FunctionTitle)
                    295: 
                    296:     set to   = Begin
                    297:     set from = Begin
                    298: ;
                    299: ;  Assume all is well.
                    300: ;
                    301:     set CommonStatus = STATUS_SUCCESSFUL
                    302: 
                    303:     EndWait
                    304: 
                    305: ;
                    306: ;   Set up the operation-mode-based variables and gaily welcome
                    307: ;   the user.  If the "install mode" variable is improperly set,
                    308: ;   assume this is a new installation.
                    309: ;
                    310: 
                    311: Begin = +
                    312:     Set ActivateDetection = FALSE
                    313: 
                    314:     Ifstr(i) $(!NTN_InstallMode) == deinstall
                    315:         set StartLabel = removeadapter
                    316:     else-Ifstr(i) $(!NTN_InstallMode) == Update
                    317:         set StartLabel = UpgradeSoftware
                    318:     else-Ifstr(i) $(!NTN_InstallMode) == bind
                    319:         set StartLabel = bindingadapter
                    320:     else-Ifstr(i) $(!NTN_InstallMode) == configure
                    321:         set CommonStatus = STATUS_REBOOT
                    322:         set ActivateDetection = TRUE
                    323:         set StartLabel = configureadapter
                    324:         ;
                    325:         ;   You cannot config the software component
                    326:         ;
                    327:         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
                    328:             Debug-Output "Cannot configure the Elink II driver software."
                    329:             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
                    330:             ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    331:                 Debug-Output "ShellCode error: cannot get an error string."
                    332:                 goto ShellCodeError
                    333:             endif
                    334:             set Error = $($R0)
                    335:             set from = end
                    336:             set to = end
                    337:             goto nonfatalinfo
                    338:         endif
                    339:     else
                    340:         set ActivateDetection = TRUE
                    341:         set StartLabel = installadapter
                    342:         set OEM_ABANDON_OPTIONS = {}
                    343:         set OEM_ABANDON_SOFTWARE = FALSE
                    344:         set OEM_ABANDON_ON = TRUE
                    345:     endif
                    346: 
                    347: 
                    348:     ;===================================================
                    349:     ;  Netcard Detection logic
                    350:     ;
                    351:     ;  Initialize use of netcard detection;
                    352:     ;  Construct require global parameter variables
                    353:     ;
                    354:     Debug-Output "OEMNADE2.INF: =================================================="
                    355:     Debug-Output "OEMNADE2.INF: STF_CWDIR is: "$(!STF_CWDIR)
                    356:     Debug-Output "OEMNADE2.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
                    357:     Debug-Output "OEMNADE2.INF: Option is: "$(Option)
                    358:     Debug-Output "OEMNADE2.INF: !STF_NCDETECT  is: "$(!STF_NCDETECT)
                    359:     Debug-Output "OEMNADE2.INF: !STF_NCOPTION  is: "$(!STF_NCOPTION)
                    360:     Debug-Output "OEMNADE2.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
                    361:     Debug-Output "OEMNADE2.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
                    362:     Debug-Output "OEMNADE2.INF: =================================================="
                    363: 
                    364:     Set DetectedCard = FALSE
                    365: 
                    366:     Ifstr(i) $(ActivateDetection) != TRUE
                    367:         Goto $(StartLabel)
                    368:     Endif
                    369:     ;
                    370:     ;  Set !STF_NC_PARAMS and !STF_NC_PNAMES by calling
                    371:     ;    PARAM.INF!Param_BuildTypeLists.
                    372:     ;   Pass it a list of the form:
                    373:     ;
                    374:     ;   {  { <param name>,
                    375:     ;        <name of choice list var>,
                    376:     ;        <name of default var> },
                    377:     ;      ...
                    378:     ;   }
                    379:     ;
                    380:     Set TypeList = {{IRQ, IRQ_List, IRQ_Level},+
                    381:                     {IOADDR, IOADDR_Addr_List, IOBaseAddrValue},+
                    382:                     {MEMADDR, MemBaseAddrDecList, MemBaseAddrDec},+
                    383:                     {TRANSCEIVER, TranceiverValueList, TransceiverValue}+
                    384:                     {MEMLENGTH, MemLengthList, NONE}}
                    385: 
                    386:     Debug-Output "OEMNADE2.INF: Calling Param_BuildTypeLists"
                    387:     Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
                    388:     Set Status = $($R0)
                    389:     ifstr(i) $(Status) != STATUS_SUCCESSFUL
                    390:         Goto fataldetect
                    391:     Endif
                    392: 
                    393:     Debug-Output "OEMNADE2.INF: Calling Param_SetDefaults"
                    394:     Shell $(ParamInf) Param_SetDefaults {}
                    395: 
                    396:     ;  Establish presentation versions of choice lists.
                    397: 
                    398:     Shell $(ParamInf) HexListFromDecList $(IOADDR_Addr_List)
                    399:     Set IOADDR_Hex_List = $($R0)
                    400: 
                    401:     Shell $(UtilityInf) SortList $(IRQ_List) TRUE FALSE
                    402:     Set IRQ_List = $($R0)
                    403: 
                    404:     ;  If this is a detected card, set the flag.
                    405: 
                    406:     Ifstr(i) $(!STF_NCDETECT) == YES
                    407:         Ifstr(i) $(!STF_NCOPTION) == $(Option)
                    408:            Set DetectedCard = TRUE
                    409:            Debug-Output "OEMNADE2.INF: Setting DetectedCard to TRUE"
                    410:         Endif
                    411:     Endif
                    412:     ;
                    413:     ;  End Netcard Detection logic
                    414:     ;===================================================
                    415: 
                    416:     Set MappedValue = 1
                    417:     Ifint $(MemBaseAddrDec) == 0
                    418:        Set MappedValue = 0
                    419:     Endif
                    420: 
                    421:     Shell "" DebugConfiguration "After parameter querying"
                    422: 
                    423:     Set from = $(fatal)
                    424:     Set to = $(fatal)
                    425:     Goto $(StartLabel)
                    426: 
                    427: ;-----------------------------------------------
                    428: ; Installation Section
                    429: ;-----------------------------------------------
                    430: 
                    431: installadapter = +
                    432: ;
                    433: ;   First, check whether the same version of the software exists
                    434: ;
                    435:     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
                    436: 
                    437:     Ifstr $(KeyProduct) != $(KeyNull)
                    438:         ;
                    439:         ; Same version already existed in the local machine
                    440:         ; Popup the dialog and ask the user whether he wants to continue
                    441:         ;
                    442:         CloseRegKey $(KeyProduct)
                    443: 
                    444:         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
                    445:            ;
                    446:            ; Cannot Install the same software again
                    447:            ;
                    448:            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
                    449:                $(ProductVersion)
                    450:            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    451:                Debug-Output "ShellCode error: cannot get an error string."
                    452:                goto ShellCodeError
                    453:            endif
                    454: 
                    455:            goto end
                    456:         else
                    457:            ;
                    458:            ; Add a new adapter card?
                    459:            ;
                    460:            Shell $(UtilityInf), CardExistedDlg
                    461: 
                    462:            ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    463:                Debug-Output "ShellCode error: cannot get an error string."
                    464:                goto ShellCodeError
                    465:            endif
                    466: 
                    467:            ifstr(i) $($R1) != "OK"
                    468:                set CommonStatus = STATUS_USERCANCEL
                    469:                goto end
                    470:            endif
                    471:            set OldVersionExisted = $(TRUE)
                    472:         endif
                    473:     endif
                    474: 
                    475:     ;===================================================
                    476:     ;  Netcard Detection logic
                    477:     ;
                    478:     ;   If this is a detected card, query its parameters
                    479:     ;   and merge them into the default list.
                    480:     ;
                    481: 
                    482:     ;  Indicate that there are no old parameter settings.
                    483: 
                    484:     Set CurrParamSettings = {}
                    485: 
                    486:     Ifstr(i) $(DetectedCard) != TRUE
                    487:         Goto adaptersetup
                    488:     Endif
                    489:     ;
                    490:     ;   Get the detected parameters
                    491:     ;
                    492:     StartWait
                    493:     Shell $(ParamInf) Param_QueryCard $(!STF_NCDETCARD)
                    494:     EndWait
                    495:     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
                    496:         Goto adaptersetup
                    497:     Endif
                    498:     ;
                    499:     ;   Merge the detected values in.
                    500:     ;
                    501:     Set DetectedParams = $($R1)
                    502:     Debug-Output "OEMNADE2.INF: Calling Param_SetDefaults to merge detected params"
                    503:     Shell $(ParamInf) Param_SetDefaults $(DetectedParams)
                    504:     ;
                    505:     ;  End Netcard Detection logic
                    506:     ;===================================================
                    507: 
                    508:     goto adaptersetup
                    509: 
                    510: ;-----------------------------------------------
                    511: ; Configuration Section
                    512: ;-----------------------------------------------
                    513: ;
                    514: ;   Get the current values of all the parameters
                    515: ;
                    516: configureadapter = +
                    517:     Ifstr $(KeyProduct) == $(KeyNull)
                    518:         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
                    519:         Ifstr $(KeyProduct) == $(KeyNull)
                    520:             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
                    521:             Debug-Output "Cannot find component product key"
                    522:             goto fatalregistry
                    523:         Endif
                    524:     Endif
                    525: 
                    526:     ;
                    527:     ; Get the other parameters;  they're attached to the service parameters key
                    528:     ;
                    529:     Debug-Output "INF: Shelling to FindService"
                    530:     Shell $(UtilityInf) FindService, $(KeyProduct)
                    531:     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    532:         Debug-Output "INF: FindService shell failure"
                    533:         Goto ShellCodeError
                    534:     Endif
                    535:     Ifstr(i) $($R0) != NO_ERROR
                    536:         Debug-Output "INF: FindService Shell error: "$($R0)
                    537:         Goto fatalregistry
                    538:     endif
                    539: 
                    540:     Set KeyParameters = $($R2)
                    541: 
                    542:     ;
                    543:     ;  We don't need the services key, so close it.
                    544:     ;
                    545:     CloseRegKey $($R1)
                    546: 
                    547:     Ifstr $(KeyParameters) == $(KeyNull)
                    548:         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
                    549:         Debug-Output "Cannot find component service"
                    550:         goto fatalregistry
                    551:     endif
                    552: 
                    553:     set OldVersionExisted = $(TRUE)
                    554: 
                    555:     set ValueName = ""
                    556:     set ValueData = ""
                    557:     set ValueStr  = ""
                    558:     set ValueList = {}
                    559: 
                    560:     ;
                    561:     ; Get the old values
                    562:     ;
                    563:     EnumRegValue $(KeyParameters) ValueList
                    564: 
                    565:     ForListDo $(ValueList)
                    566:         set ValueItem = $($)
                    567:         set ValueName = *($(ValueItem),1)
                    568:         set ValueData = *($(ValueItem),4)
                    569:         Ifstr(i) $(ValueName) == "Transceiver"
                    570:             set TransceiverValue = $(ValueData)
                    571:         else-ifstr(i) $(ValueName) == "MemoryMapped"
                    572:             set MappedValue = $(ValueData)
                    573:         else-ifstr(i) $(ValueName) == "InterruptNumber"
                    574:             set IRQ_Level = $(ValueData)
                    575:         else-ifstr(i) $(ValueName) == "IoBaseAddress"
                    576:             set IOBaseAddrValue = $(ValueData)
                    577:         else-ifstr(i) $(ValueName) == "BusType"
                    578:             set BusInterfaceType = $(ValueData)
                    579:         else-ifstr(i) $(ValueName) == "BusNumber"
                    580:             set BusNumber = $(ValueData)
                    581:         endif
                    582: 
                    583:     EndForListDo
                    584: 
                    585:     ;  Save the settings as they were read from the Registry.
                    586: 
                    587:     Shell $(ParamInf) Param_SaveValues
                    588:     Set CurrParamSettings = $($R0)
                    589: ;
                    590: ;   Put up the adapter configuration dialog if necessary.
                    591: ;
                    592: ;   Note that $(CurrParamSettings) has the old known parameter values.
                    593: ;
                    594: adaptersetup = +
                    595: 
                    596:     Shell "" DebugConfiguration "before displaying dialog"
                    597: 
                    598:     Set from = adapteroptions
                    599: 
                    600:     Set IOADDR_Hex_Value = *($(IOADDR_Hex_List), ~($(IOADDR_Addr_List),$(IOBaseAddrValue)))
                    601: 
                    602:     Ifint $(MappedValue) == 0
                    603:         Set CheckItemsIn = {"OFF"}
                    604:     Else
                    605:         Set CheckItemsIn = {"ON"}
                    606:     Endif
                    607: 
                    608:     Ifint $(TransceiverValue) == 1
                    609:         Set RadioIn = {1}
                    610:     Else
                    611:         Set RadioIn = {2}
                    612:     Endif
                    613: 
                    614:     ;===================================================
                    615:     ;  Netcard Detection logic
                    616:     ;
                    617:     ;   Check that this card's parameters can be
                    618:     ;   fully detected.
                    619:     ;
                    620:     Shell $(ParamInf) Param_ParameterConfidence
                    621:     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
                    622:         Debug-Output "OEMNADE2.INF: parameter confidence too low to bypass configuration"
                    623:         Goto adapteroptions
                    624:     Endif
                    625:     ;
                    626:     ;   If this is a detected card and we're in EXPRESS mode,
                    627:     ;   see if the parameters as they currently exist are
                    628:     ;   verifiably correct.
                    629:     ;
                    630:     Ifstr(i) $(DetectedCard) == TRUE
                    631:         Ifstr(i) $(!STF_INSTALL_MODE) != CUSTOM
                    632:             Goto adapterverify
                    633:         Endif
                    634:     Endif
                    635:     ;
                    636:     ;  End Netcard Detection logic
                    637:     ;===================================================
                    638: 
                    639: adapteroptions = +
                    640: 
                    641:     read-syms FileDependentDlg$(!STF_LANGUAGE)
                    642: 
                    643:     ui start "InputDlg"
                    644: 
                    645:     ifstr(i) $(DLGEVENT) == "CONTINUE"
                    646:         set IRQ_Level = $(Combo1Out)
                    647:         set IOADDR_Hex_Value = $(Combo2Out)
                    648:         set TransceiverTypeIndex = *($(RadioOut),1)
                    649:         Ifint $(TransceiverTypeIndex) == 1
                    650:             Set TransceiverValue = 1
                    651:         Else
                    652:             Set TransceiverValue = 2
                    653:         Endif
                    654:         Set Chk = *($(CheckItemsOut), 1)
                    655:         Ifstr(i) $(Chk) == "ON"
                    656:             Set MappedValue = 1
                    657:         Else
                    658:             Set MappedValue = 0
                    659:         Endif
                    660: 
                    661:         Ifint $(MappedValue) == 0
                    662:             Set MemBaseAddrDec = 0
                    663:         Else
                    664:             Set MemBaseAddrDec = *($(MemBaseAddrDecList),2)
                    665:         Endif
                    666: 
                    667:         Set IOBaseAddrValue = *($(IOADDR_Addr_List), ~($(IOADDR_Hex_List),$(IOADDR_Hex_Value)))
                    668: 
                    669:         ui pop 1
                    670:     else-ifstr(i) $(DLGEVENT) == "BACK"
                    671:         set CommonStatus = STATUS_USERCANCEL
                    672:         Debug-Output "Action: exit. Bye."
                    673:         ui pop 1
                    674:         goto end
                    675:     else
                    676:         Debug-Output "Action: unknown. Bye."
                    677:         ui pop 1
                    678:         goto end
                    679:     endif
                    680: 
                    681:     ifstr(i) $(!STF_NCDETINFO) == {}
                    682:         ; not detect. popup dialog.
                    683:         Shell $(UtilityInf),GetBusTypeDialog,$(ProductHardware$(Option)Description) $(BusInterfaceType) $(BusNumber)
                    684:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    685:             Debug-Output "ShellCode error."
                    686:             goto ShellCodeError
                    687:         endif
                    688:     
                    689:         set BusInterfaceType = $($R1)
                    690:         set BusNumber = $($R2)
                    691:     else
                    692:         ; use the STF_NCDETINFO information
                    693:         set BusInterfaceType = *($(!STF_NCDETINFO),5)
                    694:         set BusNumber = *($(!STF_NCDETINFO),6)
                    695:     endif
                    696: 
                    697: 
                    698: 
                    699: adapterverify = +
                    700: 
                    701:     Shell "" DebugConfiguration "after running dialog"
                    702: 
                    703:     ;===================================================
                    704:     ;  Netcard Detection logic
                    705:     ;
                    706:     ;   If this is a detected card, attempt to validate the options
                    707:     ;   If just a normal card, try to claim the resources which have
                    708:     ;     changed.
                    709:     ;
                    710:     Ifstr(i) $(DetectedCard) != TRUE
                    711: 
                    712:         ;  Build the current parameter list.  If this is an installation,
                    713:         ;  (indicated by the fact that the current settings list is empty)
                    714:         ;  claim all the parameters; otherwise, just claim those which
                    715:         ;  have changed.
                    716: 
                    717:         Shell $(ParamInf) Param_SaveValues
                    718:         Set NewParamSettings = $($R0)
                    719:         Ifstr(i) $(CurrParamSettings) == {}
                    720:             Set DiffParamSettings = $(NewParamSettings)
                    721:         Else
                    722:             Shell $(ParamInf) Param_DiffValues $(CurrParamSettings)
                    723:             Set DiffParamSettings = $($R0)
                    724:         Endif
                    725: 
                    726:         Debug-Output "OEMNADE2.INF: Calling Param_VerifyResources"
                    727:         Shell $(ParamInf) Param_VerifyResources $(DiffParamSettings)
                    728:         Ifstr(i) $($R0) == STATUS_SUCCESSFUL
                    729:             Debug-Output "OEMNADE2.INF: Param_VerifyResources succeeded"
                    730:             Goto skipoptions
                    731:         Endif
                    732:     Else
                    733:         Set CardVerifyIndex = $(!STF_NCDETCARD)
                    734:         Debug-Output "OEMNADE2.INF: Calling Param_VerifyCard"
                    735:         Shell $(ParamInf) Param_VerifyCard $(!STF_NCDETCARD)
                    736:         Ifstr(i) $($R0) == STATUS_SUCCESSFUL
                    737:             Debug-Output "OEMNADE2.INF: Param_VerifyCard succeeded"
                    738:             Goto skipoptions
                    739:         Endif
                    740:     Endif
                    741:     ;
                    742:     ;   Give the user a chance to retry or force the options given.
                    743:     ;
                    744:     Set from = adapteroptions
                    745:     Set to = skipoptions
                    746:     Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
                    747:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    748:         Debug-Output "ShellCode error: cannot get an error string."
                    749:         goto ShellCodeError
                    750:     endif
                    751:     set Error = $($R0)
                    752:     Goto Warning
                    753:     ;
                    754:     ;  End Netcard Detection logic
                    755:     ;===================================================
                    756: 
                    757: ;
                    758: ;   If installing, go create the necessary keys;
                    759: ;   if configuring, they're already open.
                    760: ;
                    761: skipoptions =+
                    762: 
                    763:     ifint $(OldVersionExisted) == $(TRUE)
                    764:         ifstr(i) $(!NTN_InstallMode) == configure
                    765:             goto writeparameters
                    766:         endif
                    767:     endif
                    768:     StartWait
                    769:     ;
                    770:     ; Add Software Component
                    771:     ;
                    772:     ifint $(OldVersionExisted) == $(FALSE)
                    773:         ifstr(i) $(!NTN_InstallMode) == "install"
                    774:            Ifstr(i) $(DoCopy) == "YES"
                    775: 
                    776:               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
                    777: 
                    778:               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    779:                   Goto ShellCodeError
                    780:               Else-Ifstr(i) $($R0) == STATUS_FAILED
                    781:                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
                    782:                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    783:                       goto ShellCodeError
                    784:                   endif
                    785:                   set Error = $($R0)
                    786:                   Goto fatal
                    787:               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
                    788:                   Goto successful
                    789:               Endif
                    790: 
                    791:               Set SrcDir = $($R1)
                    792: 
                    793:            Endif
                    794: 
                    795:            install "Install-Option"
                    796:            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
                    797:               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
                    798:               ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    799:                   goto ShellCodeError
                    800:               endif
                    801:               set Error = $($R0)
                    802:               goto fatal
                    803:            endif
                    804:         endif
                    805: 
                    806:         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
                    807:             $(ProductSoftwareName), +
                    808:             $(ProductSoftwareName), +
                    809:             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
                    810:             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
                    811:             $(NetEventDLL)
                    812: 
                    813:         Set OEM_ABANDON_SOFTWARE = TRUE
                    814: 
                    815:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    816:             Debug-Output "ShellCode error"
                    817:             goto ShellCodeError
                    818:         endif
                    819:         ;
                    820:         ;   At this point:
                    821:         ;     $R1 contains the product version key handle;
                    822:         ;     $R2 contains the NetRules subkey handle;
                    823:         ;     $R3 contains the new Services key handle; and
                    824:         ;     $R4 contains the Parameters key
                    825:         ;     $R5 contains the Linkage Key
                    826:         ;
                    827:         set RegistryErrorIndex = $($R0)
                    828:         set KeyProduct      = $($R1)
                    829:         Set SoftNetRulesKey = $($R2)
                    830:         CloseRegKey $($R3)
                    831:         CloseRegKey $($R4)
                    832:         CloseRegKey $($R5)
                    833: 
                    834:         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                    835:             EndWait
                    836:             Debug-Output "Registry error: add software components"
                    837:             CloseRegKey $(KeyProduct)
                    838:             CloseRegKey $(SoftNetRulesKey)
                    839:             goto fatalregistry
                    840:         endif
                    841: 
                    842:         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
                    843:                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
                    844:                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
                    845:                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
                    846:                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
                    847:                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
                    848:                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
                    849: 
                    850:         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
                    851:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    852:             Debug-Output "ShellCode error."
                    853:             goto ShellCodeError
                    854:         endif
                    855: 
                    856:         set RegistryErrorIndex = $($R0)
                    857: 
                    858:         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                    859:             EndWait
                    860:             Debug-Output "Registry error: add value list."
                    861:             CloseRegKey $(KeyProduct)
                    862:             CloseRegKey $(SoftNetRulesKey)
                    863:             goto fatalregistry
                    864:         endif
                    865: 
                    866:         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
                    867:                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
                    868:                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
                    869:                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
                    870:                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
                    871:                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
                    872: 
                    873:         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
                    874:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    875:             Debug-Output "ShellCode error."
                    876:             goto ShellCodeError
                    877:         endif
                    878: 
                    879:         set RegistryErrorIndex = $($R0)
                    880: 
                    881:         CloseRegKey $(KeyProduct)
                    882:         CloseRegKey $(SoftNetRulesKey)
                    883: 
                    884:         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                    885:             EndWait
                    886:             Debug-Output "Resgitry error: add value list."
                    887:             goto fatalregistry
                    888:         endif
                    889:     endif
                    890: ;
                    891: ;   Create the HARDWARE\Netcard region and its corresponding service
                    892: ;
                    893:     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
                    894: 
                    895:     ifint $($R4) != -1
                    896:         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
                    897:     endif
                    898: 
                    899:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    900:         Debug-Output "Cannot add hardware component"
                    901:         goto ShellCodeError
                    902:     endif
                    903: 
                    904:     set RegistryErrorIndex = $($R0)
                    905: 
                    906:     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                    907:         EndWait
                    908:         Debug-Output "Registry error: add hardware component"
                    909:         CloseRegKey $($R1)
                    910:         CloseRegKey $($R2)
                    911:         CloseRegKey $($R3)
                    912:         goto fatalregistry
                    913:     endif
                    914: 
                    915: ;
                    916: ;   At this point:
                    917: ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
                    918: ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
                    919: ;     $R3  Registry key handle for <service>\Parameters key
                    920: ;     $R4  Adapter number assigned to adapter
                    921: ;     $R5  Service name generated by combining svc name with adapter number
                    922: ;
                    923:     set KeyParameters = $($R3)
                    924:     set KeyAdapterRules = $($R2)
                    925:     set AdapterNumber = $($R4)
                    926: 
                    927:     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
                    928:                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
                    929:                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
                    930:                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
                    931:                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
                    932:                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
                    933: 
                    934:     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
                    935:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    936:         Debug-Output "ShellCode error"
                    937:         goto ShellCodeError
                    938:     endif
                    939: 
                    940:     CloseRegKey $($R1)
                    941: 
                    942:     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
                    943:     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
                    944: 
                    945:     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
                    946:                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
                    947:                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
                    948:                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
                    949: 
                    950:     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
                    951:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    952:         Debug-Output "ShellCode error."
                    953:         goto ShellCodeError
                    954:     endif
                    955: 
                    956:     set RegistryErrorIndex = $($R0)
                    957: 
                    958:     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                    959:         EndWait
                    960:         Debug-Output "Resgitry error: add value list."
                    961:         CloseRegKey $(KeyParameters)
                    962:         CloseRegKey $(KeyAdapterRules)
                    963:         goto fatalregistry
                    964:     endif
                    965: 
                    966:     CloseRegKey $(KeyAdapterRules)
                    967: 
                    968:     goto writeparameters
                    969: ;
                    970: ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
                    971: ;
                    972: writeparameters = +
                    973: ;
                    974: ;   Add the rest of the parameters to the Services area
                    975: ;
                    976:     Set NewValueList = {{Transceiver,$(NoTitle),$(!REG_VT_DWORD),$(TransceiverValue)},+
                    977:                        {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusInterfaceType)},+
                    978:                        {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNumber)},+
                    979:                        {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
                    980:                        {MemoryMapped,$(NoTitle),$(!REG_VT_DWORD),$(MappedValue)},+
                    981:                        {InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IRQ_Level)},+
                    982:                        {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)}}
                    983: 
                    984:     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
                    985: 
                    986:     CloseRegKey $(KeyParameters)
                    987: 
                    988:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                    989:         Debug-Output "ShellCode error."
                    990:         goto ShellCodeError
                    991:     endif
                    992: 
                    993:     set RegistryErrorIndex = $($R0)
                    994: 
                    995:     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                    996:         Debug-Output "Registry error: Add value list"
                    997:         goto fatalregistry
                    998:     endif
                    999: 
                   1000:     EndWait
                   1001: 
                   1002:     goto successful
                   1003: 
                   1004: ;-----------------------------------------------
                   1005: ; Binding section
                   1006: ;-----------------------------------------------
                   1007: bindingadapter =+
                   1008:     set Error = "Binding: Sorry, not yet implemented."
                   1009:     goto fatal
                   1010: 
                   1011: ;-----------------------------------------------
                   1012: ; Removeadapter section
                   1013: ;-----------------------------------------------
                   1014: 
                   1015: removeadapter = +
                   1016:     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
                   1017:         ; Remove Software Component
                   1018:         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
                   1019:             $(ProductSoftwareName)
                   1020:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1021:             Debug-Output "ShellCode error"
                   1022:             goto ShellCodeError
                   1023:         endif
                   1024: 
                   1025:         set RegistryErrorIndex = $($R0)
                   1026: 
                   1027:         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                   1028:             goto fatalregistry
                   1029:         endif
                   1030:     else
                   1031:         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
                   1032:             $(ProductSoftwareName), $(!NTN_RegBase)
                   1033:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1034:             Debug-Output "ShellCode error"
                   1035:             goto ShellCodeError
                   1036:         endif
                   1037: 
                   1038:         set RegistryErrorIndex = $($R0)
                   1039: 
                   1040:         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                   1041:             goto fatalregistry
                   1042:         endif
                   1043:     endif
                   1044: 
                   1045:     goto end
                   1046: 
                   1047: ;-----------------------------------------------
                   1048: ; Upgrade Software section
                   1049: ;-----------------------------------------------
                   1050: 
                   1051: UpgradeSoftware = +
                   1052:     ;
                   1053:     ; First determine whether we want to do upgrade or update for software
                   1054:     ; or hardware component. Then we will determine whether the Mode is
                   1055:     ; update or upgrade.
                   1056:     ;
                   1057:     ; If the same version of the product existed in the registry, we do
                   1058:     ; update. Otherwise, we will do a upgrade
                   1059:     ;
                   1060:     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
                   1061:         ; Upgrade software component
                   1062:         ;
                   1063:         ; see whether the same version exist or not
                   1064:         ;
                   1065:         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
                   1066: 
                   1067:         Ifstr $(KeyProduct) != $(KeyNull)
                   1068:             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
                   1069:             set Version = *($(VersionInfo), 4)
                   1070: 
                   1071:             ;
                   1072:             ; Update the binaries
                   1073:             ;
                   1074:             Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
                   1075: 
                   1076:             ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1077:                 Debug-Output "ShellCode error"
                   1078:                 goto ShellCodeError
                   1079:             endif
                   1080: 
                   1081:             set !UG_Filename = $($R0)
                   1082: 
                   1083:             ifstr(i) $(!UG_Filename) != ""
                   1084:                 install "Install-Update"
                   1085:                 ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
                   1086:                     goto fatal
                   1087:                 endif
                   1088:             endif
                   1089: 
                   1090:             ; Upgrade the version number
                   1091:             ;
                   1092:             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
                   1093:             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
                   1094: 
                   1095:             ;
                   1096:             ; do nothing for update
                   1097:             ;
                   1098:             ifint $(Version) != $(ProductVersion)
                   1099:                ;
                   1100:                ; If the major version number is not the same,
                   1101:                ; it is major upgrade. So let Upgrade the product
                   1102:                ;
                   1103:                ;
                   1104:                ; make other upgrade change if necessary
                   1105:                ;
                   1106:             endif
                   1107:             CloseRegKey $(KeyProduct)
                   1108:         else
                   1109:             ;
                   1110:             ; Cannot Open software key, goto ERROR
                   1111:             ;
                   1112:             goto fatalregistry
                   1113:         endif
                   1114:     else
                   1115:         ;
                   1116:         ; upgrade/update hardware component
                   1117:         ; There is no different between upgrade and update for hardware
                   1118:         ; component
                   1119:         ;
                   1120:         ; 1. Get the Service Name
                   1121:         ; 2. Change the NetRule section if necessary
                   1122:         ;
                   1123:         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
                   1124:               $(MAXIMUM_ALLOWED) NetworkCardKey
                   1125:         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
                   1126:             ;
                   1127:             ; Get Service name
                   1128:             ;
                   1129:             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
                   1130:             set ServiceName = *($(ServiceNameInfo), 4)
                   1131: 
                   1132:             ;
                   1133:             ; Change the NetRule if necessary
                   1134:             ;
                   1135:             OpenRegKey $(NetworkCardKey) "" "NetRules" +
                   1136:                 $(MAXIMUM_ALLOWED) NetRuleKey
                   1137:             Ifstr(i) $(NetRuleKey) != $(KeyNull)
                   1138:                 ;
                   1139:                 ; Make the change....
                   1140:                 ;
                   1141:             else
                   1142:                 ;
                   1143:                 ; Error, cannot open net rules key
                   1144:                 ;
                   1145:                 goto fatalregistry
                   1146:             endif
                   1147: 
                   1148:             CloseRegKey $(NetRules)
                   1149:             CloseRegKey $(NetworkCardKey)
                   1150:         else
                   1151:             ;
                   1152:             ; Error, cannot open network card key
                   1153:             ;
                   1154:             goto fatalregistry
                   1155:         endif
                   1156:         ;
                   1157:         ; 3. Change the service section of the hardware. i.e.,
                   1158:         ;    ParameterName change, value change, etc.
                   1159:         ;
                   1160:         OpenRegKey $(!REG_H_LOCAL) "" +
                   1161:               $(!NTN_ServiceBase)"\"$(ServiceName) +
                   1162:               $(MAXIMUM_ALLOWED) ServiceKey
                   1163: 
                   1164:         Ifstr(i) $(ServiceKey) != $(KeyNull)
                   1165:             ;
                   1166:             ; Get the ServiceKey to change the Start value
                   1167:             ; or Type value. Or open Parameters key to
                   1168:             ; change the hardware parameters if necessary.
                   1169:             ;
                   1170:             CloseRegKey $(ServiceKey)
                   1171:         else
                   1172:             ;
                   1173:             ; Error, cannot open network card key
                   1174:             ;
                   1175:             goto fatalregistry
                   1176:         endif
                   1177:     endif
                   1178: 
                   1179:     goto end
                   1180:     ;
                   1181:     ; End of Upgrade Software
                   1182:     ;
                   1183: 
                   1184: ;
                   1185: ;  Escape hatches
                   1186: ;
                   1187: successful = +
                   1188:     goto end
                   1189: 
                   1190: abandon = +
                   1191:     ForListDo $(OEM_ABANDON_OPTIONS)
                   1192:         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
                   1193:             $(ProductSoftwareName), $($)
                   1194:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1195:             Debug-Output "ShellCode error"
                   1196:             goto ShellCodeError
                   1197:         endif
                   1198: 
                   1199:         set RegistryErrorIndex = $($R0)
                   1200: 
                   1201:         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                   1202:             goto fatalregistry
                   1203:         endif
                   1204:     EndForListDo
                   1205: 
                   1206:     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
                   1207:         ; Remove Software Component
                   1208:         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
                   1209:             $(ProductSoftwareName), FALSE
                   1210:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1211:             Debug-Output "ShellCode error"
                   1212:             goto ShellCodeError
                   1213:         endif
                   1214: 
                   1215:         set RegistryErrorIndex = $($R0)
                   1216: 
                   1217:         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
                   1218:             goto fatalregistry
                   1219:         endif
                   1220:     endif
                   1221: 
                   1222:     goto end
                   1223: 
                   1224: ;
                   1225: ; warning display
                   1226: ;
                   1227: warning = +
                   1228:     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
                   1229:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1230:         goto ShellCodeError
                   1231:     endif
                   1232:     ifstr(i) $($R1) == "OK"
                   1233:         goto $(to)
                   1234:     else-ifstr(i) $($R1) == "CANCEL"
                   1235:         goto $(from)
                   1236:     else
                   1237:         goto "end"
                   1238:     endif
                   1239: ;
                   1240: ; non fatal error display
                   1241: ;
                   1242: nonfatalinfo = +
                   1243:     Set Severity = STATUS
                   1244:     Set CommonStatus = STATUS_USERCANCEL
                   1245:     goto nonfatalmsg
                   1246: nonfatal = +
                   1247:     Set Severity = NONFATAL
                   1248:     goto nonfatalmsg
                   1249: nonfatalmsg = +
                   1250:     ifstr(i) $(Error) == ""
                   1251:         Set Severity = NONFATAL
                   1252:         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
                   1253:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1254:             goto ShellCodeError
                   1255:         endif
                   1256:         set Error = $($R0)
                   1257:     endif
                   1258:     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
                   1259:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1260:         goto ShellCodeError
                   1261:     endif
                   1262:     ifstr(i) $($R1) == "OK"
                   1263:         goto $(from)
                   1264:     else
                   1265:         goto "end"
                   1266:     endif
                   1267: 
                   1268: ;
                   1269: ;  Registry is broken
                   1270: ;
                   1271: fatalregistry = +
                   1272:     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
                   1273:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1274:         goto ShellCodeError
                   1275:     endif
                   1276:     set Error = $($R0)
                   1277:     goto fatal
                   1278: ;
                   1279: ;  Netcard detection failure
                   1280: ;
                   1281: fataldetect = +
                   1282:     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
                   1283:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1284:         Debug-Output "ShellCode error: cannot get an error string."
                   1285:         goto ShellCodeError
                   1286:     endif
                   1287:     set Error = $($R0)
                   1288:     Goto fatal
                   1289: ;
                   1290: ; fatal error display
                   1291: ;
                   1292: fatal = +
                   1293:     ifstr(i) $(Error) == ""
                   1294:         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
                   1295:         ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1296:             goto ShellCodeError
                   1297:         endif
                   1298:         set Error = $($R0)
                   1299:     endif
                   1300:     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
                   1301:     ifint $($ShellCode) != $(!SHELL_CODE_OK)
                   1302:         goto ShellCodeError
                   1303:     endif
                   1304: 
                   1305:     goto setfailed
                   1306: 
                   1307: ;
                   1308: ;  Shelling error
                   1309: ;
                   1310: ShellCodeError = +
                   1311:     set DlgType      = "MessageBox"
                   1312:     set STF_MB_TITLE = $(ShellCodeErrorTitle)
                   1313:     set STF_MB_TEXT  = $(ShellCodeErrorText)
                   1314:     set STF_MB_TYPE  = 1
                   1315:     set STF_MB_ICON  = 3
                   1316:     set STF_MB_DEF   = 1
                   1317:     ui start "Error Message"
                   1318:     goto setfailed
                   1319: 
                   1320: setfailed = +
                   1321:     set CommonStatus = STATUS_FAILED
                   1322:     ;
                   1323:     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
                   1324:     ;
                   1325:     ifstr(i) $(OEM_ABANDON_ON) == TRUE
                   1326:         set OEM_ABANDON_ON = FALSE
                   1327:         goto abandon
                   1328:     endif
                   1329:     goto end
                   1330: 
                   1331: end = +
                   1332:     goto term
                   1333: 
                   1334: term = +
                   1335: 
                   1336:     Return $(CommonStatus)
                   1337: 
                   1338: [DebugConfiguration]
                   1339: 
                   1340:     Set InfName = "OEMNADE2.INF"
                   1341:     Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
                   1342:     Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
                   1343:     Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
                   1344:     Debug-Output $(InfName)" TransceiverValue is "$(!p:TransceiverValue)
                   1345:     Debug-Output $(InfName)" MemBaseAddrDec is "$(!p:MemBaseAddrDec)
                   1346:     Debug-Output $(InfName)" MappedValue is "$(!p:MappedValue)
                   1347: 
                   1348:     return
                   1349: 
                   1350: 
                   1351: ;***************************************************************
                   1352: ;  INSTALL SECTIONS
                   1353: ;***************************************************************
                   1354: [Install-Option]
                   1355:     set STF_VITAL = ""
                   1356: 
                   1357:     ifstr(i) $(AddCopy) == "YES"
                   1358: 
                   1359:         ;
                   1360:         ; Add the files to the copy list
                   1361:         ;
                   1362:         ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
                   1363:         ;      the other INF files
                   1364:         ;
                   1365:         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
                   1366: 
                   1367:     endif
                   1368: 
                   1369:     ifstr(i) $(DoCopy) == "YES"
                   1370: 
                   1371:        ;
                   1372:        ; Copy files in the copy list
                   1373:        ;
                   1374:        set !STF_NCPA_FLUSH_COPYLIST = TRUE
                   1375:        CopyFilesInCopyList
                   1376: 
                   1377:     endif
                   1378: 
                   1379:     Exit
                   1380: 
                   1381: [Install-Update]
                   1382:    set STF_VITAL        = ""
                   1383:    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
                   1384:    ;set STF_VERSION     = "YES"
                   1385: 
                   1386:    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
                   1387:    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
                   1388: 
                   1389:    set !STF_NCPA_FLUSH_COPYLIST = TRUE
                   1390:    CopyFilesInCopyList
                   1391: 
                   1392:    exit

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.