;***********************************************************************
;
; OEMSETUP.INF
;
;       Intel network card and driver SETUP INF file.
;
;***********************************************************************

;-----------------------------------------------------------------------
; OPTION TYPE
; -----------
; This identifies the Option type we are dealing with.  The different
; possible types are:
;
; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
;
;  Types specific to networking:
;
; NetAdapter,        a netcard / adapter combination or just a netcard
; NetDriver,         just a netcard driver
; NetTransport,      a complete NDIS-compliant TDI transport stack
; NetService,        an NT networking service
; NetWork,           a complete network ensemble.
; NetProvider        a complete network which supports NT MPR protocol
;-----------------------------------------------------------------------

[Identification]
    OptionType = NetAdapter

;-----------------------------------------------------------------------
; PlatformsSupported
; ------------------
; This identifies the platforms supported by the adapter card.
; Possible types are:
;
; ISA and EISA
;-----------------------------------------------------------------------

[PlatformsSupported]
    ISA
    EISA
    MCA
    "Jazz-Internal Bus"
    PCMCIA
    PCI

[LanguagesSupported]
    ENG

;-----------------------------------------------------------------------
; OPTION LIST
; -----------
; This section lists the OEM Option key names.  These keys are locale
; independent and used to represent the option in a locale independent
; manner.
;
;-----------------------------------------------------------------------

[Options]
    TKXP16
    ;PCMCIA
    ;COMBO

[OptionsTextENG]
    TKXP16 = "Intel TokenExpress 16/4 Adapter"
    ;PCMCIA = "Olicom GoCard TR 16/4"
    ;COMBO  = "Olicom GoCard TR/Modem 144"

[IOBaseAddrChoices]
IOBase_0  = "Auto detect", 0
IOBase_1  = "0A00-0A1F", 2560
IOBase_2  = "0A20-0A3F", 2592
IOBase_3  = "0A40-0A5F", 2624
IOBase_4  = "0A60-0A7F", 2656
IOBase_5  = "0A80-0A9F", 2688
IOBase_6  = "0AA0-0ABF", 2720
IOBase_7  = "0AC0-0ADF", 2752
IOBase_8  = "0AE0-0AFF", 2874
IOBase_9  = "0B00-0B1F", 2816
IOBase_10 = "0B20-0B3F", 2848
IOBase_11 = "0B40-0B5F", 2880
IOBase_12 = "0B60-0B7F", 2912
IOBase_13 = "0B80-0B9F", 2944
IOBase_14 = "0BA0-0BBF", 2976
IOBase_15 = "0BC0-0BDF", 3008
IOBase_16 = "0BE0-0BFF", 3040
IOBase_20 = "0A20-0A23,0A30-0A3F", 2592
IOBase_21 = "0A24-0A27,0A40-0A4F", 2596
IOBase_22 = "0A50-0A53,0A60-0A6F", 2640
IOBase_23 = "0A54-0A57,0A70-0A7F", 2644

[ReceiveBufferCountChoices]
RBC_1 = "32",32
RBC_2 = "31",31
RBC_3 = "30",30
RBC_4 = "29",29
RBC_5 = "28",28
RBC_6 = "27",27
RBC_7 = "26",26
RBC_8 = "25",25
RBC_9 = "24",24
RBC_10 = "23",23
RBC_11 = "22",22
RBC_12 = "21",21
RBC_13 = "20",20
RBC_14 = "19",19
RBC_15 = "18",18
RBC_16 = "17",17
RBC_17 = "16",16
RBC_18 = "15",15
RBC_19 = "14",14
RBC_20 = "13",13
RBC_21 = "12",12
RBC_22 = "11",11
RBC_23 = "10",10
RBC_24 = "9",9
RBC_25 = "8",8
RBC_26 = "7",7
RBC_27 = "6",6
RBC_28 = "5",5

[TransmitBufferCountChoices]
XBC_1 = "32",32
XBC_2 = "31",31
XBC_3 = "30",30
XBC_4 = "29",29
XBC_5 = "28",28
XBC_6 = "27",27
XBC_7 = "26",26
XBC_8 = "25",25
XBC_9 = "24",24
XBC_10 = "23",23
XBC_11 = "22",22
XBC_12 = "21",21
XBC_13 = "20",20
XBC_14 = "19",19
XBC_15 = "18",18
XBC_16 = "17",17
XBC_17 = "16",16
XBC_18 = "15",15
XBC_19 = "14",14
XBC_20 = "13",13
XBC_21 = "12",12
XBC_22 = "11",11
XBC_23 = "10",10
XBC_24 = "9",9
XBC_25 = "8",8
XBC_26 = "7",7
XBC_27 = "6",6
XBC_28 = "5",5
XBC_29 = "4",4
XBC_30 = "3",3
XBC_31 = "2",2

[MaxFrameSizeChoices]
MFS_1 = "8 KBytes",8192
MFS_2 = "6 KBytes",6144
MFS_3 = "4 KBytes",4096
MFS_4 = "2 KBytes",2048

[BusNumberChoices]
BusNo_1 = "0",0
BusNo_2 = "1",1
BusNo_3 = "2",2
BusNo_4 = "3",3
BusNo_5 = "4",4
BusNo_6 = "5",5
BusNo_7 = "6",6
BusNo_8 = "7",7

[IOBasePCMCIAChoices]
; 3E0h is where PCIC is (normally) located
; 240h is where TCIC is (normally) located
; therefore user cannot select these for locating the adapter
IOBase_1  = "200h",512
IOBase_2  = "220h",544
IOBase_3  = "260h",608
IOBase_4  = "280h",640
IOBase_5  = "2A0h",672
IOBase_6  = "2C0h",714
IOBase_7  = "2E0h",746
IOBase_8  = "300h",768
IOBase_9  = "320h",800
IOBase_10 = "340h",832
IOBase_11 = "360h",864
IOBase_12 = "380h",896
IOBase_13 = "3A0h",928
IOBase_14 = "3C0h",960
IOBase_15 = "A00h",2560
IOBase_16 = "A20h",2592
IOBase_17 = "A40h",2624
IOBase_18 = "A60h",2656
IOBase_19 = "A80h",2688
IOBase_20 = "AA0h",2720
IOBase_21 = "AC0h",2752
IOBase_22 = "AE0h",2784
IOBase_23 = "B00h",2816
IOBase_24 = "B20h",2848
IOBase_25 = "B40h",2880
IOBase_26 = "B60h",2912
IOBase_27 = "B80h",2944
IOBase_28 = "BA0h",2976
IOBase_29 = "BC0h",3008
IOBase_30 = "BE0h",3040

[MemWinChoices]
MemWin_1  = "A0000h", 655360
MemWin_2  = "A1000h", 659456
MemWin_3  = "A2000h", 663552
MemWin_4  = "A3000h", 667648
MemWin_5  = "A4000h", 671744
MemWin_6  = "A5000h", 675840
MemWin_7  = "A6000h", 679936
MemWin_8  = "A7000h", 684032
MemWin_9  = "A8000h", 688128
MemWin_10 = "A9000h", 692224
MemWin_11 = "AA000h", 696320
MemWin_12 = "AB000h", 700416
MemWin_13 = "AC000h", 704512
MemWin_14 = "AD000h", 708608
MemWin_15 = "AE000h", 712704
MemWin_16 = "AF000h", 716800
MemWin_17 = "B0000h", 720896
MemWin_18 = "B1000h", 724992
MemWin_19 = "B2000h", 729088
MemWin_20 = "B3000h", 733184
MemWin_21 = "B4000h", 737280
MemWin_22 = "B5000h", 741376
MemWin_23 = "B6000h", 745472
MemWin_24 = "B7000h", 749568
MemWin_25 = "B8000h", 753664
MemWin_26 = "B9000h", 757760
MemWin_27 = "BA000h", 761856
MemWin_28 = "BB000h", 765952
MemWin_29 = "BC000h", 770048
MemWin_30 = "BD000h", 774144
MemWin_31 = "BE000h", 778240
MemWin_32 = "BF000h", 782336
MemWin_33 = "C0000h", 786432
MemWin_34 = "C1000h", 790528
MemWin_35 = "C2000h", 794624
MemWin_36 = "C3000h", 798720
MemWin_37 = "C4000h", 802816
MemWin_38 = "C5000h", 806912
MemWin_39 = "C6000h", 811008
MemWin_40 = "C7000h", 815104
MemWin_41 = "C8000h", 819200
MemWin_42 = "C9000h", 823296
MemWin_43 = "CA000h", 827392
MemWin_44 = "CB000h", 831488
MemWin_45 = "CC000h", 835584
MemWin_46 = "CD000h", 839680
MemWin_47 = "CE000h", 843776
MemWin_48 = "CF000h", 847872
MemWin_49 = "D0000h", 851968
MemWin_50 = "D1000h", 856064
MemWin_51 = "D2000h", 860160
MemWin_52 = "D3000h", 864256
MemWin_53 = "D4000h", 868352
MemWin_54 = "D5000h", 872448
MemWin_55 = "D6000h", 876544
MemWin_56 = "D7000h", 880640
MemWin_57 = "D8000h", 884736
MemWin_58 = "D9000h", 888832
MemWin_59 = "DA000h", 892928
MemWin_60 = "DB000h", 897024
MemWin_61 = "DC000h", 901120
MemWin_62 = "DD000h", 905216
MemWin_63 = "DE000h", 909312
MemWin_64 = "DF000h", 913408
MemWin_65 = "E0000h", 917504
MemWin_66 = "E1000h", 921600
MemWin_67 = "E2000h", 925696
MemWin_68 = "E3000h", 929792
MemWin_69 = "E4000h", 933888
MemWin_70 = "E5000h", 937984
MemWin_71 = "E6000h", 942080
MemWin_72 = "E7000h", 946176
MemWin_73 = "E8000h", 950272
MemWin_74 = "E9000h", 954368
MemWin_75 = "EA000h", 958464
MemWin_76 = "EB000h", 962560
MemWin_77 = "EC000h", 966656
MemWin_78 = "ED000h", 970752
MemWin_79 = "EE000h", 974848
MemWin_80 = "EF000h", 978944
MemWin_81 = "F0000h", 983040
MemWin_82 = "F1000h", 987136
MemWin_83 = "F2000h", 991232
MemWin_84 = "F3000h", 995328
MemWin_85 = "F4000h", 999424
MemWin_86 = "F5000h", 1003520
MemWin_87 = "F6000h", 1007616
MemWin_88 = "F7000h", 1011712
MemWin_89 = "F8000h", 1015808
MemWin_90 = "F9000h", 1019904
MemWin_91 = "FA000h", 1024000
MemWin_92 = "FB000h", 1028096
MemWin_93 = "FC000h", 1032192
MemWin_94 = "FD000h", 1036288
MemWin_95 = "FE000h", 1040384
MemWin_96 = "FF000h", 1044480

[InterruptChoices]
Interrupt_1  = "3", 3
Interrupt_2  = "4", 4
Interrupt_3  = "5", 5
Interrupt_4  = "7", 7
Interrupt_5  = "9", 9
Interrupt_6  = "10",10
Interrupt_7  = "11",11
Interrupt_8  = "12",12
Interrupt_9  = "14",14
Interrupt_10 = "15",15

[ComPortChoices]
Com_1 = "COM1", 1016
Com_2 = "COM2", 760
Com_3 = "COM3", 1000
Com_4 = "COM4", 744
Com_5 = "COM5", 24
Com_6 = "Disabled", 0

[IOBasePCMCIAControllerChoices]
IOBase_1  = "Default",992
IOBase_2  = "3E2h",994
IOBase_3  = "Disable PCMCIA",0

[WaitstateChoices]
Waitstate_1  = "0", 0
Waitstate_2  = "1", 1
Waitstate_3  = "2", 2
Waitstate_4  = "3", 3
Waitstate_5  = "4", 4
Waitstate_6  = "5", 5
Waitstate_7  = "6", 6
Waitstate_8  = "7", 7
Waitstate_9  = "8", 8
Waitstate_10 = "9", 9
Waitstate_11 = "10",10
Waitstate_12 = "11",11
Waitstate_13 = "12",12
Waitstate_14 = "13",13
Waitstate_15 = "14",14
Waitstate_16 = "15",15

[DatasizeChoices]
Datasize_1 = 1, 1,"&16 Bit"
Datasize_2 = 2, 0,"&8 Bit"

[RingSpeedChoices]
RS_1 = "16 Mbps", 16
RS_2 = "4 Mbps", 4

;-----------------------------------------------------------------------
; Constants for use with dialogs
;-----------------------------------------------------------------------

[FileConstants]
UtilityInf      = "UTILITY.INF"
subroutineinf   = "SUBROUTN.INF"
SoftwareType    = "driver"
Exit_Code       = 0
DialogDllName   = "octk16.dll"
HelpfileName    = "octk16.hlp"
NetEventDLL     = "%SystemRoot%\System32\netevent.dll;%SystemRoot%\System32\Drivers\Octk16.sys"
IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
Manufacturer    = "Intel"
ProductMajorVersion     = "3"
ProductMinorVersion     = "23"
ProductVersion          = $(ProductMajorVersion)"."$(ProductMinorVersion)
ProductSoftwareName     = "tkxp16"
ProductSoftwareTitle    = "Intel TokenExpress 16/4 Adapter Driver"
ProductSoftwareImagePath = "\SystemRoot\System32\drivers\octk16.sys"
NetRuleSoftwareType     = "tkxp16Sys ndisDriver tkxp16Driver"
NetRuleSoftwareUse      = $(SoftwareType)
NetRuleSoftwareBindForm = """tkxp16Sys"" yes no container"
NetRuleSoftwareClass    = {"tkxp16Driver basic"}
NetRuleSoftwareBindable = {"tkxp16Driver tkxp16Adapter non exclusive 100"}
ProductHardwareName     = "tkxp16"
ProductHardwareTKXP16Title = "Intel TokenExpress 16/4 Adapter"
ProductHardwarePCMCIATitle = "Olicom GoCard TR 16/4"
ProductHardwareCOMBOTitle  = "Olicom GoCard TR/Modem 144"
NetRuleHardwareType     = "tkxp16 tkxp16Adapter"
NetRuleHardwareBindForm = " yes yes container"
NetRuleHardwareClass    = {"tkxp16Adapter basic"}
ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"

[GeneralConstants]
from      = ""
to        = ""
ExitCodeOk     = 0
ExitCodeCancel = 1
ExitCodeFatal  = 2
KeyNull         = ""
MAXIMUM_ALLOWED   = 33554432
RegistryErrorIndex = NO_ERROR
KeyProduct      = ""
KeyParameters   = ""
TRUE            = 1
FALSE           = 0
NoTitle         = 0
ExitState       = "Active"
OldVersionExisted = $(FALSE)
DriverPath      = $(!STF_NTPATH)\drivers
[FileConstantsENG]
ProCaption   = "Windows NT Setup"
ProCancel    = "Cancel"
ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
	       "Are you sure you want to cancel copying files?"
ProCancelCap = "Network Setup Message"
ProText1     = "Copying:"
ProText2     = "To:"
TKXP16FunctionTitle = "Intel TokenExpress 16/4 Adapter Setup"
PCMCIAFunctionTitle = "Olicom GoCard TR 16/4 Setup"
COMBOFunctionTitle  = "Olicom GoCard TR/Modem 144 Setup"
ProductHardwareTKXP16Description = "Intel TokenExpress 16/4 Adapter"
ProductHardwarePCMCIADescription = "Olicom GoCard TR 16/4"
ProductHardwareCOMBODescription  = "Olicom GoCard TR/Modem 144"
ProductSoftwareDescription       = "Intel TokenExpress Adapter Driver"
FunctionTitle   = $($(Option)FunctionTitle)

IOBaseAddrList = ^(IOBaseAddrChoices, 1)
IOBaseAddrValues = ^(IOBaseAddrChoices, 2)
RcvBufCountList  = ^(ReceiveBufferCountChoices, 1)
RcvBufCountValues = ^(ReceiveBufferCountChoices, 2)
XmitBufCountList = ^(TransmitBufferCountChoices, 1)
XmitBufCountValues = ^(TransmitBufferCountChoices, 2)
FrameSizeList = ^(MaxFrameSizeChoices, 1)
FrameSizeValues = ^(MaxFrameSizeChoices, 2)
BusNoList = ^(BusNumberChoices, 1)
BusNoValues = ^(BusNumberChoices, 2)
IOBasePCMCIAList = ^(IOBasePCMCIAChoices, 1)
IOBasePCMCIAValues = ^(IOBasePCMCIAChoices, 2)
MemWinList = ^(MemWinChoices, 1)
MemWinValues = ^(MemWinChoices, 2)
InterruptList = ^(InterruptChoices, 1)
InterruptValues = ^(InterruptChoices, 2)
RingSpeedList = ^(RingSpeedChoices, 1)
RingSpeedValues = ^(RingSpeedChoices, 2)
ComPortList = ^(ComPortChoices, 1)
ComPortValues = ^(ComPortChoices, 2)
IOBasePCMCIAControllerList = ^(IOBasePCMCIAControllerChoices, 1)
IOBasePCMCIAControllerValues = ^(IOBasePCMCIAControllerChoices, 2)
WaitstateList = ^(WaitstateChoices, 1)
WaitstateValues = ^(WaitstateChoices, 2)
DatasizeList = ^(DatasizeChoices, 1)
DatasizeValues = ^(DatasizeChoices, 2)
DatasizeLabels = ^(DatasizeChoices, 3)

IOBasePCMCIADefault = 15
MemWinDefault       = 49
ComPortDefault      = 3
InterruptDefault    = 3

[DialogConstantsENG]
Help        = "&Help"
Exit        = "Cancel"
OK          = "OK"
HelpContext = ""
Continue    = "Continue"
Cancel      = "Cancel"
ContextMinimumID        = 6000
ContextContentsID       = 6000
ContextPCMCIASetupID    = 6001
ContextPCMCIAAdvancedID = 6002
ContextMaximumID        = 6020

[date]
    Now = {} ? $(!LIBHANDLE) GetSystemDate

[AskSourceDlgText]
    DlgText        = "Please enter the full path of the Intel TokenExpress 16/4 driver "+
		     "setup files. Then choose Continue."

;-----------------------------------------------------------------------
; ADAPTER PARAMETER DIALOG
; ------------------------
; This section sets up the adapter parameter dialog. All textstrings
; presented in this dialog are defined here.
;
;-----------------------------------------------------------------------
[TKXP16ParameterDlgENG]
DlgType = "RadioCombination"
DlgTemplate = "OCTK16"
Caption = $(FunctionTitle)
DlgText = "Please select values for the following fields:"
Combo1Label = "&I/O Base Address:"
Combo2Label = "&Receive Buffers:"
Combo3Label = "&Transmit Buffers:"
Combo4Label = "&Max Frame Size:"
Combo5Label = "&Bus Number:"
Label1 = "&Early Token Release:"
Radio1 = "Yes"
Radio2 = "No"
Label2 = "&Full Transmit Status:"
Radio3 = "Yes"
Radio4 = "No"
Edit1Label = "&Network Address:"
Combo1List = $(IOBaseAddrList)
Combo1Out  = $(IOBaseAddrIndex)
Combo2List = $(RcvBufCountList)
Combo2Out  = $(RcvBufCountIndex)
Combo3List = $(XmitBufCountList)
Combo3Out  = $(XmitBufCountIndex)
Combo4List = $(FrameSizeList)
Combo4Out  = $(FrameSizeIndex)
Combo5List = $(BusNoList)
Combo5Out  = $(BusNoIndex)
ComboListItemsIn  = {Combo1List, Combo2List, Combo3List, Combo4List, Combo5List}
ComboListItemsOut = {Combo1Out, Combo2Out, Combo3Out, Combo4Out, Combo5Out}
EditTextLim = 17
EditTextIn = $(NetworkAddress)
RadioOptionGreyed = {}
CBOptionsGreyed = {}
NotifyFields = {NO, NO, NO, NO, NO}
HelpContext = $(ContextContentsID)

;-----------------------------------------------------------------------
; PCMCIA PARAMETER MAIN DIALOG
; ----------------------------
; This section sets up the adapter parameter dialog. All textstrings
; presented in this dialog are defined here.
;
;-----------------------------------------------------------------------
[PCMCIAParameterDlgENG]
DlgType = "RadioCombination"
DlgTemplate = "PCMCIA"
Caption = $(FunctionTitle)
DlgText = "Please select values for the following fields:"
Free        = "&Pcmcia..."
Combo1Label = "&I/O Base Address:"
Combo2Label = "&Receive Buffers:"
Combo3Label = "&Transmit Buffers:"
Combo4Label = "&Max Frame Size:"
Combo5Label = "&Bus Number:"
Label1 = "&Early Token Release:"
Radio1 = "Yes"
Radio2 = "No"
Label2 = "&Full Transmit Status:"
Radio3 = "Yes"
Radio4 = "No"
Edit1Label = "&Network Address:"
Combo1List = $(IOBaseAddrList)
Combo1Out  = $(IOBaseAddrIndex)
Combo2List = $(RcvBufCountList)
Combo2Out  = $(RcvBufCountIndex)
Combo3List = $(XmitBufCountList)
Combo3Out  = $(XmitBufCountIndex)
Combo4List = $(FrameSizeList)
Combo4Out  = $(FrameSizeIndex)
Combo5List = $(BusNoList)
Combo5Out  = $(BusNoIndex)
ComboListItemsIn  = {Combo1List, Combo2List, Combo3List, Combo4List, Combo5List}
ComboListItemsOut = {Combo1Out, Combo2Out, Combo3Out, Combo4Out, Combo5Out}
EditTextLim = 17
EditTextIn = $(NetworkAddress)
RadioOptionGreyed = {}
CBOptionsGreyed = {}
NotifyFields = {NO, NO, NO, NO, NO}
HelpContext = $(ContextContentsID)

;-----------------------------------------------------------------------
; PCMCIA COMBO Cards PARAMETER MAIN DIALOG
; ----------------------------------------
; This section sets up the adapter parameter dialog. All textstrings
; presented in this dialog are defined here.
;
;-----------------------------------------------------------------------
[COMBOParameterDlgENG]
DlgType = "RadioCombination"
DlgTemplate = "PCMCIA"
Caption = $(FunctionTitle)
DlgText = "Please select values for the following fields:"
Free        = "&Pcmcia..."
Combo1Label = "&I/O Base Address:"
Combo2Label = "&Receive Buffers:"
Combo3Label = "&Transmit Buffers:"
Combo4Label = "&Max Frame Size:"
Combo5Label = "&Bus Number:"
Label1 = "&Early Token Release:"
Radio1 = "Yes"
Radio2 = "No"
Label2 = "&Full Transmit Status:"
Radio3 = "Yes"
Radio4 = "No"
Edit1Label = "&Network Address:"
Combo1List = $(IOBaseAddrList)
Combo1Out  = $(IOBaseAddrIndex)
Combo2List = $(RcvBufCountList)
Combo2Out  = $(RcvBufCountIndex)
Combo3List = $(XmitBufCountList)
Combo3Out  = $(XmitBufCountIndex)
Combo4List = $(FrameSizeList)
Combo4Out  = $(FrameSizeIndex)
Combo5List = $(BusNoList)
Combo5Out  = $(BusNoIndex)
ComboListItemsIn  = {Combo1List, Combo2List, Combo3List, Combo4List, Combo5List}
ComboListItemsOut = {Combo1Out, Combo2Out, Combo3Out, Combo4Out, Combo5Out}
EditTextLim = 17
EditTextIn = $(NetworkAddress)
RadioOptionGreyed = {}
CBOptionsGreyed = {}
NotifyFields = {NO, NO, NO, NO, NO}
HelpContext = $(ContextContentsID)

;-----------------------------------------------------------------------
; MORE PCMCIA PARAMETER DIALOG
; ----------------------------
; This section sets up the PCMCIA parameter dialog. All textstrings
; presented in this dialog are defined here.
;
;-----------------------------------------------------------------------

[PCMCIAMoreDlgENG]
DlgType = "RadioCombination"
DlgTemplate = "PCMCIAM"
Caption = "Pcmcia Setup"
DlgText = "Please select values for the following fields:"
Free        = "&Advanced..."
Combo1Label = "I/O &Base Address:"
Combo2Label = "&Memory Window:"
Combo3Label = "&Interrupt:"
Combo4Label = "&Ring Speed:"
Combo1List = $(IOBasePCMCIAList)
Combo1Out  = $(IOBasePCMCIAIndex)
Combo2List = $(MemWinList)
Combo2Out  = $(MemWinIndex)
Combo3List = $(InterruptList)
Combo3Out  = $(InterruptIndex)
Combo4List = $(RingSpeedList)
Combo4Out  = $(RingSpeedIndex)
ComboListItemsIn  = {Combo1List, Combo2List, Combo3List, Combo4List}
ComboListItemsOut = {Combo1Out, Combo2Out, Combo3Out, Combo4Out}
RadioOptionGreyed = {}
CBOptionsGreyed = {}
NotifyFields = {NO, NO, NO, NO, NO}
HelpContext = $(ContextPCMCIASetupID)

;-----------------------------------------------------------------------
; MORE COMBO PARAMETER DIALOG
; ---------------------------
; This section sets up the PCMCIA parameter dialog. All textstrings
; presented in this dialog are defined here.
;
;-----------------------------------------------------------------------

[COMBOMoreDlgENG]
DlgType = "RadioCombination"
DlgTemplate = "COMBOM"
Caption = "Pcmcia Setup"
DlgText = "Please select values for the following fields:"
Free        = "&Advanced..."
Combo1Label = "I/O &Base Address:"
Combo2Label = "&Memory Window:"
Combo3Label = "&Interrupt:"
Combo4Label = "&Ring Speed:"
Combo5Label = "&Com Port:"
Combo1List = $(IOBasePCMCIAList)
Combo1Out  = $(IOBasePCMCIAIndex)
Combo2List = $(MemWinList)
Combo2Out  = $(MemWinIndex)
Combo3List = $(InterruptList)
Combo3Out  = $(InterruptIndex)
Combo4List = $(RingSpeedList)
Combo4Out  = $(RingSpeedIndex)
Combo5List = $(ComPortList)
Combo5Out  = $(ComPortIndex)
ComboListItemsIn  = {Combo1List, Combo2List, Combo3List, Combo4List, Combo5List}
ComboListItemsOut = {Combo1Out, Combo2Out, Combo3Out, Combo4Out, Combo5Out}
RadioOptionGreyed = {}
CBOptionsGreyed = {}
NotifyFields = {NO, NO, NO, NO, NO}
HelpContext = $(ContextPCMCIASetupID)

;-----------------------------------------------------------------------
; PCMCIA ADVANCED SETTINGS DIALOG
; -------------------------------
; This section sets up the PCMCIA adavanced settings dialog. All
; textstrings presented in this dialog are defined here.
;
;-----------------------------------------------------------------------

[PCMCIAAdvancedDlgENG]
DlgType = "RadioCombination"
DlgTemplate = "PCMCIAADV"
Caption = "Pcmcia Advanced Settings"
DlgText = "Please select values for the following fields:"
Combo1Label = "&Controller I/O Base:"
Combo2Label = "&Additional Waitstates:"
Radio1Label = "&Datasize:"
Radio1Button1 = *($(DatasizeLabels),1)
Radio1Button2 = *($(DatasizeLabels),2)
Combo1List = $(IOBasePCMCIAControllerList)
Combo1Out  = $(IOBasePCMCIAControllerIndex)
Combo2List = $(WaitstateList)
Combo2Out  = $(WaitstateIndex)
ComboListItemsIn  = {Combo1List, Combo2List}
ComboListItemsOut = {Combo1Out, Combo2Out}
RadioIn = { $(DatasizeIndex) }
RadioOptionGreyed = {}
CBOptionsGreyed = {}
NotifyFields = {NO, NO, NO, NO, NO}
HelpContext = $(ContextPCMCIAAdvancedID)

;---------------------------------------------------------------------------
; 1. Identify
;
; DESCRIPTION:   To verify that this INF deals with the same type of options
;                as we are choosing currently.
;
; INPUT:         None
;
; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
;                $($R1): Option Type (COMPUTER ...)
;                $($R2): Diskette description
;---------------------------------------------------------------------------

[Identify]
    read-syms Identification
    set Status     = STATUS_SUCCESSFUL
    set Identifier = $(OptionType)
    set Media      = #("Source Media Descriptions", 1, 1)
    Return $(Status) $(Identifier) $(Media)

;------------------------------------------------------------------------
; 2. ReturnOptions:
;
; DESCRIPTION:   To return the option list supported by this INF and the
;                localised text list representing the options.
;
;
; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
;
; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
;                                STATUS_NOLANGUAGE
;                                STATUS_FAILED
;                                STATUS_NOTSUPPORTED
;
;                $($R1): Option List
;                $($R2): Option Text List
;------------------------------------------------------------------------

[ReturnOptions]
    set Status         = STATUS_FAILED
    set OptionList     = {}
    set OptionTextList = {}
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) in $(LanguageList)
	ifstr(i) $($1) == ""
	   goto returnoptions
	endif
	set PlatformList = ^(PlatformsSupported, 1)
	Ifcontains(i) $($1) in $(PlatformList)
	   goto returnoptions
	else
	   set Status = STATUS_NOTSUPPORTED
	   goto finish_ReturnOptions
	endif
    else
	set Status = STATUS_NOLANGUAGE
	goto finish_ReturnOptions
    endif
returnoptions = +
    set OptionList     = ^(Options, 1)
    set OptionTextList = ^(OptionsText$($0), 1)
    set Status         = STATUS_SUCCESSFUL
finish_ReturnOptions = +
    Return $(Status) $(OptionList) $(OptionTextList)

;------------------------------------------------------------------------
;
; InstallOption:
;
;      This section is shelled to by main installation processing
;      or by NCPASHEL.INF during reconfig, removal, update, etc.
;
;
; FUNCTION:  To copy files representing Options
;            To configure the installed option
;            To update the registry for the installed option
;
; INPUT:     $($0):  Language to use
;            $($1):  OptionID to install
;            $($2):  SourceDirectory
;            $($3):  AddCopy  (YES | NO)
;            $($4):  DoCopy   (YES | NO)
;            $($5):  DoConfig (YES | NO)
;
; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
;                            STATUS_NOLANGUAGE |
;                            STATUS_USERCANCEL |
;                            STATUS_FAILED
;
;------------------------------------------------------------------------

[InstallOption]
    StartWait
    set SrcDir   = ""
    set Option   = $($1)
    set SrcDir   = $($2)
    set AddCopy  = $($3)
    set DoCopy   = $($4)
    set DoConfig = $($5)
    ifstr(i) $(SrcDir) == ""
       Set SrcDir = "A:\"
    Endif
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) NOT-IN $(LanguageList)
	Return STATUS_NOLANGUAGE
    endif
    Debug-Output "STF_CWDDIR is: "$(!STF_CWDDIR)
    Debug-Output "STF_LANGUAGE is: "$(!STF_LANGUAGE)
    set-subst LF = "\n"
    read-syms GeneralConstants
    read-syms FileConstants
    read-syms DialogConstants$(!STF_LANGUAGE)
    ifstr(i) $(!NTN_Origination) == "NCPA"
	set Continue = "OK"
    endif
    read-syms FileConstants$(!STF_LANGUAGE)
    detect date
    set-title  $(FunctionTitle)
    set to   = Begin
    set from = Begin
    set CommonStatus = STATUS_SUCCESSFUL
    SetHelpFile $(HelpfileName) $(ContextMinimumID) $(ContextMaximumID)
    EndWait
Begin = +
    Ifstr(i) $(!NTN_InstallMode) == deinstall
	set StartLabel = removeadapter
    else-Ifstr(i) $(!NTN_InstallMode) == Update
	set StartLabel = UpgradeSoftware
    else-Ifstr(i) $(!NTN_InstallMode) == bind
	set StartLabel = bindingadapter
    else-Ifstr(i) $(!NTN_InstallMode) == configure
	set StartLabel = configureadapter
	Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
	    Debug-Output "Cannot configure the driver software."
	    Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
	    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "ShellCode error: cannot get an error string."
		goto ShellCodeError
	    endif
	    set Error = $($R0)
	    set from = end
	    set to = end
	    goto nonfatalinfo
	endif
    else
	set StartLabel = installadapter
	set OEM_ABANDON_OPTIONS = {}
	set OEM_ABANDON_SOFTWARE = FALSE
	set OEM_ABANDON_ON = TRUE
    endif
    set IOBaseAddrIndex = *($(IOBaseAddrList), 1)
    set BusNoIndex = *($(BusNoList), 1)
    set RcvBufCountIndex = *($(RcvBufCountList), 27)
    set XmitBufCountIndex = *($(XmitBufCountList), 25)
    set FrameSizeIndex = *($(FrameSizeList), 3)
    set NetworkAddress = *($(EditTextOut), 1)
    set RadioIn = { 1, 3 }
    set EarlyRelease = "Yes"
    set FrameStatus = "Yes"
    set IOBasePCMCIAIndex = *($(IOBasePCMCIAList), $(IOBasePCMCIADefault))
    set ComPortIndex = *($(ComPortList), $(ComPortDefault))
    set InterruptIndex = *($(InterruptList), $(InterruptDefault))
    set MemWinIndex = *($(MemWinList), $(MemWinDefault))
    set IOBasePCMCIAControllerIndex = *($(IOBasePCMCIAControllerList), 1)
    set WaitstateIndex = *($(WaitstateList), 1)
    set DatasizeIndex = 1
    set RingSpeedIndex = *($(RingSpeedList), 1)
    Shell "" DebugConfiguration "After parameter querying"
    Shell $(UtilityInf), GetBusTypeNum
    set BusTypeNum = $($R1)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "ShellCode error."
	goto ShellCodeError
    endif
    set RcvBufCountValue = *($(RcvBufCountList), ~($(RcvBufCountValues),6))
    set XmitBufCountValue = *($(XmitBufCountList), ~($(XmitBufCountValues),8))
    set FrameSizeValue = *($(FrameSizeList), ~($(FrameSizeValues),4096))
    Set from = $(fatal)
    Set to = $(fatal)
    Goto $(StartLabel)

;-----------------------------------------------
; Installation Section
;-----------------------------------------------
;
;   Get the current values of all the parameters
;
installadapter = +
    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
    Ifstr $(KeyProduct) != $(KeyNull)
	CloseRegKey $(KeyProduct)
	ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
	   Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
	       $(ProductVersion)
	   ifint $($ShellCode) != $(!SHELL_CODE_OK)
	       Debug-Output "ShellCode error: cannot get an error string."
	       goto ShellCodeError
	   endif
	   goto end
	else
	   Shell $(UtilityInf), CardExistedDlg
	   ifint $($ShellCode) != $(!SHELL_CODE_OK)
	       Debug-Output "ShellCode error: cannot get an error string."
	       goto ShellCodeError
	   endif
	   ifstr(i) $($R1) != "OK"
	       goto end
	   endif
	   set OldVersionExisted = $(TRUE)
	endif
    endif

    Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO

    Ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Goto ShellCodeError
    Else-Ifstr(i) $($R0) == STATUS_FAILED
	Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    goto ShellCodeError
	endif
	set Error = $($R0)
	Goto fatal
    Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
	Goto successful
    Endif

    Set SrcDir = $($R1)

    install "Install-Dll"

    Goto adapteroptions

;-----------------------------------------------
; Configuration Section
;-----------------------------------------------
;
;   Get the current values of all the parameters
;
configureadapter = +
    Ifstr(i) $(KeyProduct) == $(KeyNull)
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
	Ifstr $(KeyProduct) == $(KeyNull)
	    set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
	    Debug-Output "Cannot find component product key"
	    goto fatalregistry
	Endif
    Endif
    Debug-Output "INF: Shelling to FindService"
    Shell $(UtilityInf) FindService, $(KeyProduct)
    Ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "INF: FindService shell failure"
	Goto ShellCodeError
    Endif
    Ifstr(i) $($R0) != NO_ERROR
	Debug-Output "INF: FindService Shell error: "$($R0)
	Goto fatalregistry
    endif
    Set KeyParameters = $($R2)
    CloseRegKey $($R1)
    Ifstr $(KeyParameters) == $(KeyNull)
	set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
	Debug-Output "Cannot find component service"
	goto fatalregistry
    endif
    set OldVersionExisted = $(TRUE)
    set ValueName = ""
    set ValueData = ""
    set ValueStr  = ""
    set ValueList = {}
    EnumRegValue $(KeyParameters) ValueList
    ForListDo $(ValueList)
	set ValueItem = $($)
	set ValueName = *($(ValueItem),1)
	set ValueData = *($(ValueItem),4)
	ifstr(i) $(ValueName) == "RecBufCount"
	    set RcvBufCountValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "IoBase"
	    set IOBaseAddrValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "TransmitBufferCount"
	    set XmitBufCountValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "TransmitBufferSize"
	    set FrameSizeValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "BusNumber"
	    set BusNoValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "EarlyRelease"
	    set EarlyRelease = $(ValueData)
	else-ifstr(i) $(ValueName) == "FrameStatus"
	    set FrameStatus = $(ValueData)
	else-Ifstr(i) $(ValueName) == "NetworkAddress"
	    set NetworkAddress = $(ValueData)
	else-ifstr(i) $(ValueName) == "IoBaseAddress"
	    set IOBasePCMCIAValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "PCCARDAttributeMemoryAddress"
	    set MemWinValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "InterruptNumber"
	    set InterruptValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "ComPortBase"
	    set ComPortValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "PcmciaCtrlBase"
	    set IOBasePCMCIAControllerValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "WaitStates"
	    set WaitstateValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "DataSize"
	    set DatasizeValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "RingSpeed"
	    set RingSpeedValue = $(ValueData)
	endif
    EndForListDo
    ;
    ; Combo-lists and radio-buttons use a special list of parameter-names
    ; when dialogs are executed. The following section converts the actual
    ; values into the corresponding names (indexes). If a value is undefined,
    ; the first entry in the index-list is used.
    ;
    set RcvBufCountIndex = *($(RcvBufCountList), ~($(RcvBufCountValues),$(RcvBufCountValue)))
    ifstr(i) $(RcvBufCountIndex) == ""
	set RcvBufCountIndex = *($(RcvBufCountList), 27)
    endif
    set XmitBufCountIndex = *($(XmitBufCountList), ~($(XmitBufCountValues),$(XmitBufCountValue)))
    ifstr(i) $(XmitBufCountIndex) == ""
	set XmitBufCountIndex = *($(XmitBufCountList), 25)
    endif
    set FrameSizeIndex = *($(FrameSizeList), ~($(FrameSizeValues),$(FrameSizeValue)))
    ifstr(i) $(FrameSizeIndex) == ""
	set FrameSizeIndex = *($(FrameSizeList), 3)
    endif
    set IOBaseAddrIndex = *($(IOBaseAddrList), ~($(IOBaseAddrValues),$(IOBaseAddrValue)))
    ifstr(i) $(IOBaseAddrIndex) == ""
	set IOBaseAddrIndex = *($(IOBaseAddrList), 1)
    endif
    set BusNoIndex = *($(BusNoList), ~($(BusNoValues),$(BusNoValue)))
    ifstr(i) $(BusNoIndex) == ""
	set BusNoIndex = *($(BusNoList), 1)
    endif
    Ifstr(i) $(EarlyRelease) == "Yes"
	set Rad1 = 1
    else
	set Rad1 = 2
    endif
    Ifstr(i) $(FrameStatus) == "Yes"
	set Rad2 = 3
    else
	set Rad2 = 4
    endif
    set RadioIn = {$(Rad1), $(Rad2) }
    set IOBasePCMCIAIndex = *($(IOBasePCMCIAList), ~($(IOBasePCMCIAValues),$(IOBasePCMCIAValue)))
    ifstr(i) $(IOBasePCMCIAIndex) == ""
	set IOBasePCMCIAIndex = *($(IOBasePCMCIAList), 1)
    endif
    set MemWinIndex = *($(MemWinList), ~($(MemWinValues),$(MemWinValue)))
    ifstr(i) $(MemWinIndex) == ""
	set MemWinIndex = *($(MemWinList), 49)
    endif
    set InterruptIndex = *($(InterruptList), ~($(InterruptValues),$(InterruptValue)))
    ifstr(i) $(InterruptIndex) == ""
	set InterruptIndex = *($(InterruptList), 3)
    endif
    set ComPortIndex = *($(ComPortList), ~($(ComPortValues),$(ComPortValue)))
    ifstr(i) $(ComPortIndex) == ""
	set ComPortIndex = *($(ComPortList), 6)
    endif
    set IOBasePCMCIAControllerIndex = *($(IOBasePCMCIAControllerList), ~($(IOBasePCMCIAControllerValues),$(IOBasePCMCIAControllerValue)))
    ifstr(i) $(IOBasePCMCIAControllerIndex) == ""
	set IOBasePCMCIAControllerIndex = *($(IOBasePCMCIAControllerList), 1)
    endif
    set WaitstateIndex = *($(WaitstateList), ~($(WaitstateValues),$(WaitstateValue)))
    ifstr(i) $(WaitstateIndex) == ""
	set WaitstateIndex = *($(WaitstateList), 2)
    endif
    set DatasizeIndex = *($(DatasizeList), ~($(DatasizeValues),$(DatasizeValue)))
    ifstr(i) $(DatasizeIndex) == ""
	set DatasizeIndex = *($(DatasizeList), 1)
    endif
    ;
    ; This section runs the dialogs. From the main dialog (adapter parameter
    ; setup) it is possible to enter the PCMCIA dialog if requested. When
    ; exiting the PCMCIA dialog the user is returned to the main dialog.
    ;
adapteroptions = +
    Set from = adapteroptions
    set OldNetAddress = $(NetworkAddress)
    ;
    ; Load DLL containing dialogs and verification routines
    ;
    LoadLibrary "Intel Driver Disk" $(DialogDllName) DialogHandle
adapteroptions1 = +
    ;
    ; Read main dialog setup and show dialog
    ;
    read-syms $(Option)ParameterDlg$(!STF_LANGUAGE)
    ui start "InputDlg"  $(DialogHandle)
    ui pop 1
    ;
    ; Save new settings because this dialog might be called again.
    ; If CANCEL was pressed these values will not be used
    ;
    set IOBaseAddrIndex = $(Combo1Out)
    set RcvBufCountIndex = $(Combo2Out)
    set XmitBufCountIndex = $(Combo3Out)
    set FrameSizeIndex = $(Combo4Out)
    set BusNoIndex = $(Combo5Out)
    IfContains "1" IN $(RadioOut)
	set EarlyRelease = "Yes"
    else-IfContains "2" IN $(RadioOut)
	set EarlyRelease = "No"
    endif
    IfContains "3" IN $(RadioOut)
	set FrameStatus = "Yes"
    else-IfContains "4" IN $(RadioOut)
	set FrameStatus = "No"
    endif
    set NetworkAddress = *($(EditTextOut),1)
    ifstr(i) $(DLGEVENT) == "CONTINUE"
	;
	; parameters have already been stored at this stage
	;
	goto nextstep
    else-ifstr(i) $(DLGEVENT) == "EXIT"
	set CommonStatus = STATUS_USERCANCEL
	Debug-Output "Action: exit. Bye."
	FreeLibrary $(DialogHandle)
	goto end
    else-ifstr(i) $(DLGEVENT) == "FREEBUTTON1"
adapteroptions2 = +
	;
	; Read PCMCIA dialog setup and show dialog
	;
	ifstr(i) $(Option) == "PCMCIA"
	    read-syms PCMCIAMoreDlg$(!STF_LANGUAGE)
	else
	    read-syms COMBOMoreDlg$(!STF_LANGUAGE)
	Endif
	ui start "InputDlg"  $(DialogHandle)
	ui pop 1
	;
	; Save new settings because this dialog might be called again.
	; If CANCEL was pressed these values will not be used
	;
	set IOBasePCMCIAIndex = $(Combo1Out)
	set MemWinIndex = $(Combo2Out)
	set InterruptIndex = $(Combo3Out)
	set RingSpeedIndex = $(Combo4Out)
	set ComPortIndex = $(Combo5Out)
	ifstr(i) $(DLGEVENT) == "CONTINUE"
	    ;
	    ; parameters have already been stored at this stage
	    ;
	    goto adapteroptions1
	else-ifstr(i) $(DLGEVENT) == "FREEBUTTON1"
	    ;
	    ; Read PCMCIA Advanced dialog setup and show dialog
	    ;
	    read-syms PCMCIAAdvancedDlg$(!STF_LANGUAGE)
	    ui start "InputDlg"  $(DialogHandle)
	    ui pop 1
	    ;
	    ; Save new settings because this dialog might be called again.
	    ; If CANCEL was pressed these values will not be used
	    ;
	    set IOBasePCMCIAControllerIndex = $(Combo1Out)
	    set WaitstateIndex = $(Combo2Out)
	    set DatasizeIndex = *($(RadioOut),1)
	    goto adapteroptions2
	else
	    Debug-Output "Action: unknown: "$(DLGEVENT)
	    FreeLibrary $(DialogHandle)
	    goto end
	endif
    else
	Debug-Output "Action: unknown: "$(DLGEVENT)
	FreeLibrary $(DialogHandle)
	goto end
    endif

nextstep =+
    ifstr $(NetworkAddress) != ""
	;
	; If network address has been entered then verify that it is a
	; valid address (not a multicast or broadcast address)
	;
	set FLibraryErrCtl = 1
	LibraryProcedure DlgResult $(DialogHandle) VerifyAddress $(NetworkAddress)
	set FLibraryErrCtl = 0
	ifstr $(DlgResult) != "STATUS_SUCCESS"
	    FreeLibrary $(DialogHandle)
	    set Error = $(DlgResult)
	    goto nonfatal
	endif
    endif
    FreeLibrary $(DialogHandle)
    ifint $(OldVersionExisted) == $(TRUE)
	ifstr(i) $(!NTN_InstallMode) == configure
	    goto writeparameters
	endif
    endif
    StartWait
    Ifint $(OldVersionExisted) != $(FALSE)
	Goto installhardware
    Endif
    ifstr(i) $(!NTN_InstallMode) == "install"
       Ifstr(i) $(DoCopy) == "YES"
	  Ifstr(i) $(SrcDir) == ""
	     read-syms AskSourceDlgText
	     Shell $(subroutineinf) DoAskSourceEx $(SrcDir) $(DlgText)
	     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Goto ShellCodeError
	     Else-Ifstr(i) $($R0) == STATUS_FAILED
		 Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
		 ifint $($ShellCode) != $(!SHELL_CODE_OK)
		     goto ShellCodeError
		 endif
		 set Error = $($R0)
		 Goto fatal
	     Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
		 Goto successful
	     Endif
	     Set SrcDir = $($R1)
	  Endif
       Endif
       install "Install-Option"
       ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
	  Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
	  ifint $($ShellCode) != $(!SHELL_CODE_OK)
	      goto ShellCodeError
	  endif
	  set Error = $($R0)
	  goto fatal
       endif
    endif
    Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
	$(ProductSoftwareName), +
	$(ProductSoftwareName), +
	$(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
	$(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
	$(NetEventDLL), ""
    Set OEM_ABANDON_SOFTWARE = TRUE
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "ShellCode error"
	goto ShellCodeError
    endif
    set RegistryErrorIndex = $($R0)
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	EndWait
	Debug-Output "OEMNADUB.INF: Registry error: add software components"
	CloseRegKey $($R1)
	CloseRegKey $($R2)
	CloseRegKey $($R3)
	CloseRegKey $($R4)
	CloseRegKey $($R5)
	goto fatalregistry
    endif
    set SoftProductKey  = $($R1)
    Set SoftNetRuleKey = $($R2)
    Set SoftServiceKey  = $($R3)
    Set SoftParameterKey        = $($R4)
    Set SoftLinkageKey  = $($R5)
    set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
		       {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
		       {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
		       {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
		       {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
		       {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
		       {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
    Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "ShellCode error."
	goto ShellCodeError
    endif
    set RegistryErrorIndex = $($R0)
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	EndWait
	Debug-Output "Registry error: add value list."
	CloseRegKey $(SoftProductKey)
	CloseRegKey $(SoftNetRuleKey)
	CloseRegKey $(SoftServiceKey)
	CloseRegKey $(SoftParameterKey)
	CloseRegKey $(SoftLinkageKey)
	goto fatalregistry
    endif
    set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
			{use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
			{bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
			{class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
			{bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
			{InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
    Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "ShellCode error."
	goto ShellCodeError
    endif
    set RegistryErrorIndex = $($R0)
    CloseRegKey $(SoftProductKey)
    CloseRegKey $(SoftNetRuleKey)
    CloseRegKey $(SoftServiceKey)
    CloseRegKey $(SoftParameterKey)
    CloseRegKey $(SoftLinkageKey)
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	EndWait
	Debug-Output "Registry error: add value list."
	goto fatalregistry
    endif
;
;   Insert hardware component in registry
;
installhardware =+
    Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
    ifint $($R4) != -1
	Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
    endif
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "Cannot add hardware component"
	goto ShellCodeError
    endif
    set RegistryErrorIndex = $($R0)
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	EndWait
	Debug-Output "Registry error: add hardware component"
	CloseRegKey $($R1)
	CloseRegKey $($R2)
	CloseRegKey $($R3)
	goto fatalregistry
    endif
    set KeyProduct = $($R1)
    set KeyAdapterRules = $($R2)
    set KeyParameters = $($R3)
    set AdapterNumber = $($R4)
    set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
		       {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
		       {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
		       {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
		       {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
		       {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
    Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "ShellCode error"
	goto ShellCodeError
    endif
    CloseRegKey $(KeyProduct)
    Set KeyProduct = ""
    set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
    set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
    set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
			{bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
			{class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
			{InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
    Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "ShellCode error."
	goto ShellCodeError
    endif
    CloseRegKey $(KeyAdapterRules)
    set RegistryErrorIndex = $($R0)
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	EndWait
	Debug-Output "Registry error: add value list."
	CloseRegKey $(KeyParameters)
	goto fatalregistry
    endif
;
; Write Adapter Parameters to registry
;
writeparameters = +
    Shell $(UtilityInf), GetBusTypeNum
    set BusTypeNum = $($R1)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "ShellCode error."
	goto ShellCodeError
    endif
    Ifstr(i) $(KeyParameters) == $(KeyNull)
	Debug-Output "*** KeyParameters is NULL at writeparameters"
    Endif
    ;
    ; Convert selections from combo-lists and radio-buttons into actual
    ; parameter values
    ;
    set IOBaseAddrValue = *($(IOBaseAddrValues), ~($(IOBaseAddrList),$(IOBaseAddrIndex)))
    set BusNoValue = *($(BusNoValues), ~($(BusNoList),$(BusNoIndex)))
    set RcvBufCountValue = *($(RcvBufCountValues), ~($(RcvBufCountList),$(RcvBufCountIndex)))
    set XmitBufCountValue = *($(XmitBufCountValues), ~($(XmitBufCountList),$(XmitBufCountIndex)))
    set FrameSizeValue = *($(FrameSizeValues), ~($(FrameSizeList),$(FrameSizeIndex)))
    set IOBasePCMCIAValue = *($(IOBasePCMCIAValues), ~($(IOBasePCMCIAList),$(IOBasePCMCIAIndex)))
    set MemWinValue = *($(MemWinValues), ~($(MemWinList),$(MemWinIndex)))
    set InterruptValue = *($(InterruptValues), ~($(InterruptList),$(InterruptIndex)))
    set RingSpeedValue = *($(RingSpeedValues), ~($(RingSpeedList),$(RingSpeedIndex)))
    set ComPortValue = *($(ComPortValues), ~($(ComPortList),$(ComPortIndex)))
    set IOBasePCMCIAControllerValue = *($(IOBasePCMCIAControllerValues), ~($(IOBasePCMCIAControllerList),$(IOBasePCMCIAControllerIndex)))
    set WaitstateValue = *($(WaitstateValues), ~($(WaitstateList),$(WaitstateIndex)))
    set DatasizeValue = *($(DatasizeValues), ~($(DatasizeList),$(DatasizeIndex)))

    ifstr(i) $(Option) == "COMBO"
	;
	; If we're installing a ComboCard, update settings for Serial\parameters\serialtkxp16 as well
	; SERIALCOMM will be created automatically by serial.sys
	;
	ifint $(ComPortValue) != 0
	    OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\Serial\Parameters\SerialTKXP16"$(AdapterNumber) $(MAXIMUM_ALLOWED) SerialHandle
	    Ifstr $(SerialHandle) == $(KeyNull)
		OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\Serial\Parameters" $(MAXIMUM_ALLOWED) SerialKey
		CreateRegKey $(SerialKey) {"SerialTKXP16"$(AdapterNumber),0,GenericClass} "" $(MAXIMUM_ALLOWED) "" SerialHandle
		CloseRegKey $(SerialKey)
	    endif
	    ifint $(ComPortValue) != 24
		set NewValueList = {{DosDevices,       $(NoTitle),$(!REG_VT_SZ),      $(ComPortIndex)},+
			{ForceFifoEnable,  $(NoTitle),$(!REG_VT_DWORD),   0},+
			{ForceShare,       $(NoTitle),$(!REG_VT_DWORD),   1},+
			{Interrupt,        $(NoTitle),$(!REG_VT_DWORD),   $(InterruptValue)},+
			{PortAddress,      $(NoTitle),$(!REG_VT_DWORD),   $(ComPortValue)}}
	    Else
		set-add ComportBaseAddress = $(ComPortValue), $(IOBasePCMCIAValue)
		set NewValueList = {{DosDevices,       $(NoTitle),$(!REG_VT_SZ),      $(ComPortIndex)},+
			{ForceFifoEnable,  $(NoTitle),$(!REG_VT_DWORD),   0},+
			{ForceShare,       $(NoTitle),$(!REG_VT_DWORD),   1},+
			{Interrupt,        $(NoTitle),$(!REG_VT_DWORD),   $(InterruptValue)},+
			{PortAddress,      $(NoTitle),$(!REG_VT_DWORD),   $(ComportBaseAddress)}}
	    Endif
	    Shell  $(UtilityInf), AddValueList, $(SerialHandle), $(NewValueList)
	    CloseRegKey $(SerialHandle)
	    ;
	    ; Update settings comm port in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports section
	    ;
	    OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports" $(MAXIMUM_ALLOWED) SerialHandle
	    Ifstr $(SerialHandle) == $(KeyNull)
		OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Windows NT\CurrentVersion" $(MAXIMUM_ALLOWED) SerialKey
		CreateRegKey $(SerialKey) {"Ports",0,GenericClass} "" $(MAXIMUM_ALLOWED) "" SerialHandle
		CloseRegKey $(SerialKey)
	    endif
	    SetRegValue $(SerialHandle) {$(ComPortIndex)":",$(NoTitle),$(!REG_VT_SZ), "9600,n,8,1"}
	    CloseRegKey $(SerialHandle)
	Else
	    ; 
	    ; Be nice and delete the COM stuff if user really wants so
	    ; SERIALCOMM will be deleted automatically
	    ; 
	    OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\Serial\Parameters" $(MAXIMUM_ALLOWED) SerialHandle
	    DeleteRegTree $(SerialHandle) "SerialTKXP16"$(AdapterNumber)
	    CloseRegKey $(SerialHandle)
	Endif
    Endif
    ;
    ; Set up parameter list for AddValueList routine
    ;
    Set NewValueList = {{IoBase,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
			{MediaType,$(NoTitle),$(!REG_VT_DWORD),2},+
			{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
			{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNoValue)},+
			{RecBufCount,$(NoTitle),$(!REG_VT_DWORD),$(RcvBufCountValue)},+
			{TransmitBufferCount,$(NoTitle),$(!REG_VT_DWORD),$(XmitBufCountValue)},+
			{TransmitBufferSize,$(NoTitle),$(!REG_VT_DWORD),$(FrameSizeValue)},+
			{EarlyRelease,$(NoTitle),$(!REG_VT_SZ),$(EarlyRelease)},+
			{FrameStatus,$(NoTitle),$(!REG_VT_SZ),$(FrameStatus)},+
			{IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBasePCMCIAValue)},+
			{IoLength,$(NoTitle),$(!REG_VT_DWORD),31},+
			{PCCARDAttributeMemoryAddress,$(NoTitle),$(!REG_VT_DWORD),$(MemWinValue)},+
			{PCCARDAttributeMemorySize, $(NoTitle),$(!REG_VT_DWORD),4096},+
			{PCCARDAttributeMemoryOffset, $(NoTitle),$(!REG_VT_DWORD),0},+
			{InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(InterruptValue)},+
			{RingSpeed,$(NoTitle),$(!REG_VT_DWORD),$(RingSpeedValue)},+
			{ComPortBase,$(NoTitle),$(!REG_VT_DWORD),$(ComPortValue)},+
			{PcmciaCtrlBase,$(NoTitle),$(!REG_VT_DWORD),$(IOBasePCMCIAControllerValue)},+
			{Pcmcia,$(NoTitle),$(!REG_VT_DWORD),1},+
			{WaitStates,$(NoTitle),$(!REG_VT_DWORD),$(WaitstateValue)},+
			{DataSize,$(NoTitle),$(!REG_VT_DWORD),$(DatasizeValue)}}

    ifstr $(NetworkAddress) != ""
       set NewValueList = >($(NewValueList),{NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)})
    endif
    ;
    ; Now update registry
    ;
    Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
    ;
    ; If the network address has been deleted then also delete it from
    ; the registry.
    ;
    ifstr $(OldNetAddress) != ""
       ifstr $(NetworkAddress) == ""
	  DeleteRegValue $(KeyParameters) NetworkAddress
       endif
    endif
    ;
    ; If we're not installing a PCMCIA Card, remove PCMCIA specific settings
    ;
    ifstr(i) $(Option) == "TKXP16"
	DeleteRegValue $(KeyParameters) IoBaseAddress
	DeleteRegValue $(KeyParameters) IoLength
	DeleteRegValue $(KeyParameters) PCCARDAttributeMemoryAddress
	DeleteRegValue $(KeyParameters) PCCARDAttributeMemorySize
	DeleteRegValue $(KeyParameters) PCCARDAttributeMemoryOffset
	DeleteRegValue $(KeyParameters) InterruptNumber
	DeleteRegValue $(KeyParameters) RingSpeed
	DeleteRegValue $(KeyParameters) ComPortBase
	DeleteRegValue $(KeyParameters) PcmciaCtrlBase
	DeleteRegValue $(KeyParameters) Pcmcia
	DeleteRegValue $(KeyParameters) WaitStates
	DeleteRegValue $(KeyParameters) DataSize
    Endif
    ifstr(i) $(Option) == "PCMCIA"
	DeleteRegValue $(KeyParameters) ComPortBase
    Endif

    CloseRegKey $(KeyParameters)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output "ShellCode error."
	goto ShellCodeError
    endif
    set RegistryErrorIndex = $($R0)
    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	Debug-Output "Registry error: Add value list"
	goto fatalregistry
    endif
;
; Add some keywords to the PCMCIA database in the registry
;
    ifstr(i) $(Option) == "PCMCIA"
	set PCMCIADatabaseKeyName = $(!NTN_ServiceBase)"\Pcmcia\DataBase"
	OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseKeyName) $(MAXIMUM_ALLOWED) PCMCIADatabaseKey
	ifstr $(PCMCIADatabaseKey) != $(NULL)    
	    OpenRegKey $(!REG_H_LOCAL) "" $(PCMCIADatabaseKeyName) $(MAXIMUM_ALLOWED) PCMCIADatabaseOlicomKey
	    ifstr $(PCMCIADatabaseOlicomKey) != $(NULL) ; open succeeded, so delete it
		CloseRegKey $(PCMCIADatabaseOlicomKey)
		DeleteRegTree $(PCMCIADatabaseKey) "Olicom"
	    endif
	    CreateRegKey $(PCMCIADatabaseKey) {"Olicom", 0, 0} "" $(MAXIMUM_ALLOWED) "" PCMCIADatabaseOlicomKey
	    CreateRegKey $(PCMCIADatabaseOlicomKey) {"TR16/4", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseOlicom3220Key
	    SetRegValue $(PCMCIADatabaseOlicom3220Key) {Driver, 0, $(!REG_VT_SZ),"tkxp16"}
	    CloseRegKey $(PCMCIADatabaseOlicom3220Key)
	    CreateRegKey $(PCMCIADatabaseOlicomKey) {"TR 16/4 II", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseOlicom3221Key
	    SetRegValue $(PCMCIADatabaseOlicom3221Key) {Driver, 0, $(!REG_VT_SZ),"tkxp16"}
	    CloseRegKey $(PCMCIADatabaseOlicom3221Key)
    ;
    ;       When NT 3.51 sees our Combo cards, it enables a COM port only.
    ;       We therefore rely on our own enabling mechanism in these cases.
    ;
    ;       CreateRegKey $(PCMCIADatabaseOlicomKey) {"GoCard Token-Ring 16/4+Modem 14400", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseOlicom3230Key
    ;       SetRegValue $(PCMCIADatabaseOlicom3230Key) {Driver, 0, $(!REG_VT_SZ),"tkxp16"}
    ;       CloseRegKey $(PCMCIADatabaseOlicom3230Key)
    ;       CreateRegKey $(PCMCIADatabaseOlicomKey) {"GoCard Token-Ring 16/4+Modem 28800", 0, 0} "" $(MAXIMUM_ALLOWED) 0 PCMCIADatabaseOlicom3231Key
    ;       SetRegValue $(PCMCIADatabaseOlicom3231Key) {Driver, 0, $(!REG_VT_SZ),"tkxp16"}
    ;       CloseRegKey $(PCMCIADatabaseOlicom3231Key)
    
	    CloseRegKey $(PCMCIADatabaseOlicomKey)
	Endif
    Endif

    EndWait
    goto successful

bindingadapter =+
    set Error = "Binding: Sorry, not yet implemented."
    goto fatal

;-----------------------------------------------
; Remove Adapter Section
;-----------------------------------------------
;
;   Remove all adapter information from the registry
;
removeadapter = +
    Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
	Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    Debug-Output "ShellCode error"
	    goto ShellCodeError
	endif
	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    goto fatalregistry
	endif
    else
	Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName), $(!NTN_RegBase)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    Debug-Output "ShellCode error"
	    goto ShellCodeError
	endif
	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    goto fatalregistry
	endif
	;
	; Remove associated Com port
	;
	ifstr(i) $(Option) == "COMBO"
	    OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\CurrentControlSet\Services\Serial\Parameters" $(MAXIMUM_ALLOWED) SerialHandle
	    DeleteRegTree $(SerialHandle) "Serialtkxp16"$(AdapterNumber)
	    CloseRegKey $(SerialHandle)
	endif
    endif
    goto end

UpgradeSoftware = +
    ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
	OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
	Ifstr $(KeyProduct) != $(KeyNull)
	    GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
	    set Version = *($(VersionInfo), 4)
	    Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
	    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "ShellCode error"
		goto ShellCodeError
	    endif
	    set !UG_Filename = $($R0)
	    ifstr(i) $(!UG_Filename) != ""
		install "Install-Update"
		ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
		    goto fatal
		endif
	    endif
	    SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
	    SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
	    ifint $(Version) != $(ProductVersion)
	    endif
	    CloseRegKey $(KeyProduct)
	else
	    goto fatalregistry
	endif
    else
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
	      $(MAXIMUM_ALLOWED) NetworkCardKey
	Ifstr(i) $(NetworkCardKey) != $(KeyNull)
	    GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
	    set ServiceName = *($(ServiceNameInfo), 4)
	    OpenRegKey $(NetworkCardKey) "" "NetRules" +
		$(MAXIMUM_ALLOWED) NetRuleKey
	    Ifstr(i) $(NetRuleKey) != $(KeyNull)
	    else
		CloseRegKey $(NetworkCardKey)
		goto fatalregistry
	    endif
	    CloseRegKey $(NetRules)
	    CloseRegKey $(NetworkCardKey)
	else
	    goto fatalregistry
	endif
	OpenRegKey $(!REG_H_LOCAL) "" +
	      $(!NTN_ServiceBase)"\"$(ServiceName) +
	      $(MAXIMUM_ALLOWED) ServiceKey
	Ifstr(i) $(ServiceKey) != $(KeyNull)
	    CloseRegKey $(ServiceKey)
	else
	    goto fatalregistry
	endif
    endif
    goto end
successful = +
    goto end
abandon = +
    ForListDo $(OEM_ABANDON_OPTIONS)
	Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName), $($)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    Debug-Output "ShellCode error"
	    goto ShellCodeError
	endif
	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    goto fatalregistry
	endif
    EndForListDo
    Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
	Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
	    $(ProductSoftwareName), FALSE
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    Debug-Output "ShellCode error"
	    goto ShellCodeError
	endif
	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    goto fatalregistry
	endif
    endif
    goto end
warning = +
    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	goto ShellCodeError
    endif
    ifstr(i) $($R1) == "OK"
	goto $(to)
    else-ifstr(i) $($R1) == "CANCEL"
	goto $(from)
    else
	goto "end"
    endif
nonfatalinfo = +
    Set Severity = STATUS
    Set CommonStatus = STATUS_USERCANCEL
    goto nonfatalmsg
nonfatal = +
    Set Severity = NONFATAL
    goto nonfatalmsg
nonfatalmsg = +
    ifstr(i) $(Error) == ""
	Set Severity = NONFATAL
	Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    goto ShellCodeError
	endif
	set Error = $($R0)
    endif
    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	goto ShellCodeError
    endif
    ifstr(i) $($R1) == "OK"
	goto $(from)
    else
	goto "end"
    endif
fatalregistry = +
    Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	goto ShellCodeError
    endif
    set Error = $($R0)
    goto fatal
fatal = +
    ifstr(i) $(Error) == ""
	Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    goto ShellCodeError
	endif
	set Error = $($R0)
    endif
    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	goto ShellCodeError
    endif
    goto setfailed
ShellCodeError = +
    set DlgType      = "MessageBox"
    set STF_MB_TITLE = "Error: "$(FunctionTitle)
    set STF_MB_TEXT  = "Shell Code Error"
    set STF_MB_TYPE  = 1
    set STF_MB_ICON  = 3
    set STF_MB_DEF   = 1
    ui start "Error Message"
    goto setfailed
setfailed = +
    set CommonStatus = STATUS_FAILED
    ifstr(i) $(OEM_ABANDON_ON) == TRUE
	set OEM_ABANDON_ON = FALSE
	goto abandon
    endif
    goto end
end = +
    goto term
term = +
    Return $(CommonStatus)

[Install-Option]
    set STF_VITAL = ""
    ifstr(i) $(AddCopy) == "YES"
	AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
	AddSectionFilesToCopyList Files-Stat $(SrcDir) $(!STF_WINDOWSSYSPATH)
    endif
    Debug-Output "OEMSETUP.INF: [Install-Option] DoCopy = "$(DoCopy)
    ifstr(i) $(DoCopy) == "YES"
       set !STF_NCPA_FLUSH_COPYLIST = TRUE
       CopyFilesInCopyList
    endif
    Exit

[Install-Update]
   set STF_VITAL        = ""
   set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
   AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
   AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
   AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
   AddSectionFilesToCopyList Files-Stat $(SrcDir) $(!STF_WINDOWSSYSPATH)
   set !STF_NCPA_FLUSH_COPYLIST = TRUE
   CopyFilesInCopyList
   exit

[Install-Dll]
   set STF_VITAL        = ""
   ifstr(i) $(AddCopy) == "YES"
      AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
   endif
   ifstr(i) $(DoCopy) == "YES"
      set !STF_NCPA_FLUSH_COPYLIST = TRUE
      CopyFilesInCopyList
   endif
   exit

[Source Media Descriptions]
    1  = "Intel Driver Disk"

[Signature]
    FileType = MICROSOFT_DRVLIB_FILE
[GetSignature]
    read-syms Signature
    return $(FileType)

[ProductType]
STF_PRODUCT  = Winnt
STF_PLATFORM = I386

[Files-Inf]
1,      oemsetnt.inf,   SIZE=999,       RENAME=$(!UG_Filename)

[Files-TKXP16]
1,      octk16.sys,     SIZE=999

[Files-PCMCIA]
1,      octk16.sys,     SIZE=999

[Files-COMBO]
1,      octk16.sys,     SIZE=999
1,      serial.sys,     SIZE=999

[Files-Dll]
1,      octk16.dll,     SIZE=999
1,      octk16.hlp,     SIZE=999

[Files-Stat]
1,      octkstat.exe,   SIZE=999

[Files-dummy]

