;***********************************************************************
;
; OEMSETNT.INF
;
;       Olicom 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]
    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]
    OCE4XMP10
    OCE4XMP100

[OptionsTextENG]
    OCE4XMP10  = "Olicom Ethernet PCI/II 10 Adapter"
    OCE4XMP100 = "Olicom Ethernet PCI/II 10/100 Adapter"

[XmitBufCountChoices]
TB_4 = "4",4
TB_5 = "5",5
TB_6 = "6",6
TB_7 = "7",7
TB_8 = "8",8
TB_9 = "9",9
TB_10 = "10",10
TB_11 = "11",11
TB_12 = "12",12
TB_13 = "13",13
TB_14 = "14",14
TB_15 = "15",15
TB_16 = "16",16

[RecBufCountChoices]
RB_4 = "4",4
RB_5 = "5",5
RB_6 = "6",6
RB_7 = "7",7
RB_8 = "8",8
RB_9 = "9",9
RB_10 = "10",10
RB_11 = "11",11
RB_12 = "12",12
RB_13 = "13",13
RB_14 = "14",14
RB_15 = "15",15
RB_16 = "16",16

[SpeedChoices]
;;;SP_1 = "Auto negotiate",0
SP_2 = "10 Mbps",10
;;;SP_3 = "100 Mbps",100

[DuplexChoices]
LM_1 = "Auto negotiate",0
LM_2 = "Half duplex",1
LM_3 = "Full duplex",2

[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

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

[FileConstants]
UtilityInf      = "UTILITY.INF"
subroutineinf   = "SUBROUTN.INF"
SoftwareType    = "driver"
Exit_Code       = 0
DialogDllName   = "oce4xmp.dll"
HelpfileName    = "oce4xmp.hlp"
NetEventDLL     = "%SystemRoot%\System32\netevent.dll;%SystemRoot%\System32\Drivers\Oc2xem.sys"
IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
Manufacturer    = "Olicom"
ProductMajorVersion     = "3"
ProductMinorVersion     = "0"
ProductVersion          = $(ProductMajorVersion)"."$(ProductMinorVersion)
ProductSoftwareName     = "OCE4XMP"
ProductSoftwareTitle    = "Olicom Ethernet PCI/II 10/100 Adapter Driver"
ProductSoftwareImagePath = "\SystemRoot\System32\drivers\oce4xmp.sys"
NetRuleSoftwareType     = "oce4xmpSys ndisDriver oce4xmpDriver"
NetRuleSoftwareUse      = $(SoftwareType)
NetRuleSoftwareBindForm = """Oce4xMPSys"" yes no container"
NetRuleSoftwareClass    = {"oce4xmpDriver basic"}
NetRuleSoftwareBindable = {"oce4xmpDriver oce4xmpAdapter non exclusive 100"}
ProductHardwareName     = "OCE4XMP"
ProductHardwareTitle    = "Olicom Ethernet PCI/II 10/100 Adapter"
ProductHardwareOCE4XMP10Title    = "Olicom Ethernet PCI/II 10 Adapter"
ProductHardwareOCE4XMP100Title    = "Olicom Ethernet PCI/II 10/100 Adapter"
NetRuleHardwareType     = "oce4xmp oce4xmpAdapter"
NetRuleHardwareBindForm = " yes yes container"
NetRuleHardwareClass    = {"oce4xmpAdapter 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:"
OCE4XMP10FunctionTitle  = "Olicom Ethernet PCI/II 10 Adapter Setup"
OCE4XMP100FunctionTitle    = "Olicom Ethernet PCI/II 10/100 Adapter Setup"
ProductHardwareOCE4XMP10Description = "Olicom Ethernet PCI/II 10 Adapter"
ProductHardwareOCE4XMP100Description   = "Olicom Ethernet PCI/II 10/100 Adapter"
ProductSoftwareDescription          = "Olicom Ethernet PCI/II 10/100 Adapter Driver"
FunctionTitle   = $($(Option)FunctionTitle)

XmitBufCountList = ^(XmitBufCountChoices, 1)
XmitBufCountValues = ^(XmitBufCountChoices, 2)
RecBufCountList = ^(RecBufCountChoices, 1)
RecBufCountValues = ^(RecBufCountChoices, 2)
SpeedList = ^(SpeedChoices, 1)
SpeedValues = ^(SpeedChoices, 2)
DuplexList = ^(DuplexChoices, 1)
DuplexValues = ^(DuplexChoices, 2)
BusNoList = ^(BusNumberChoices, 1)
BusNoValues = ^(BusNumberChoices, 2)

XmitBufCountDefault = 1
RecBufCountDefault  = 3
SpeedDefault      = 1
DuplexDefault      = 1
BusNoDefault        = 1

[DialogConstantsENG]
Help        = "&Help"
Exit        = "Cancel"
OK          = "OK"
HelpContext = ""
Continue    = "Continue"
Cancel      = "Cancel"
ContextMinimumID        = 6000
ContextContentsID       = 6000

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

[AskSourceDlgText]
    DlgText        = "Please enter the full path of the Olicom Ethernet Adapter "+
		     "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.
;
;-----------------------------------------------------------------------

[AdapterParameterDlgENG]
DlgType = "RadioCombination"
DlgTemplate = "OCE4DLG"
Caption = $(FunctionTitle)
DlgText = "Please select values for the following fields:"
Combo1Label = "&Transmit Buffers:"
Combo2Label = "&Receive Buffers:"
Combo3Label = "&Speed:"
Combo4Label = "&Duplex mode:"
Combo5Label = "&Bus Number:"
Edit1Label = "&Network Address:"
Combo1List = $(XmitBufCountList)
Combo1Out  = $(XmitBufCountIndex)
Combo2List = $(RecBufCountList)
Combo2Out  = $(RecBufCountIndex)
Combo3List = $(SpeedList)
Combo3Out  = $(SpeedIndex)
Combo4List = $(DuplexList)
Combo4Out  = $(DuplexIndex)
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)


;---------------------------------------------------------------------------
; 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) 6000 6000
    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 XmitBufCountIndex = *($(XmitBufCountList), $(XmitBufCountDefault))
    set RecBufCountIndex = *($(RecBufCountList), $(RecBufCountDefault))
    ifstr(i) $(Option) == "OCE4XMP100"
       set SpeedList = {"Auto negotiate","10 Mbps","100 Mbps"}
       set SpeedValues = {0,10,100}
    endif
    set SpeedIndex = *($(SpeedList), $(SpeedDefault))
    set DuplexIndex = *($(DuplexList), $(DuplexDefault))
    set BusNoIndex = *($(BusNoList), $(BusNoDefault))
    set NetworkAddress = *($(EditTextOut), 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 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) == "XmitBufCount"
	    set XmitBufCountValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "RecBufCount"
	    set RecBufCountValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "Speed"
	    set SpeedValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "Duplex"
	    set DuplexString = $(ValueData)
	else-ifstr(i) $(ValueName) == "BusNumber"
	    set BusNoValue = $(ValueData)
	else-ifstr(i) $(ValueName) == "NetworkAddress"
	    set NetworkAddress = $(ValueData)
	endif
    EndForListDo
    ifstr(i) $(DuplexString) == "HALF"
	set DuplexValue = 1
    else-ifstr(i) $(DuplexString) == "FULL"
	set DuplexValue = 2
    else
	set DuplexValue = 0
    endif
    ;
    ; 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 XmitBufCountIndex = *($(XmitBufCountList), ~($(XmitBufCountValues),$(XmitBufCountValue)))
    ifstr(i) $(XmitBufCountIndex) == ""
	set XmitBufCountIndex = *($(XmitBufCountList), 1)
    endif
    set RecBufCountIndex = *($(RecBufCountList), ~($(RecBufCountValues),$(RecBufCountValue)))
    ifstr(i) $(RecBufCountIndex) == ""
	set RecBufCountIndex = *($(RecBufCountList), 1)
    endif
    set SpeedIndex = *($(SpeedList), ~($(SpeedValues),$(SpeedValue)))
    ifstr(i) $(SpeedIndex) == ""
	set SpeedIndex = *($(SpeedList), 1)
    endif
    set DuplexIndex = *($(DuplexList), ~($(DuplexValues),$(DuplexValue)))
    ifstr(i) $(DuplexIndex) == ""
	set DuplexIndex = *($(DuplexList), 1)
    endif
    set BusNoIndex = *($(BusNoList), ~($(BusNoValues),$(BusNoValue)))
    ifstr(i) $(BusNoIndex) == ""
	set BusNoIndex = *($(BusNoList), 1)
    endif
    ;
adapteroptions = +
    set from = adapteroptions
    ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
	;
	; Default parameters for unattended installation
	;
	goto unattended
    endif
    set OldNetAddress = $(NetworkAddress)
    ;
    ; Load DLL containing dialogs and verification routines
    ;
    LoadLibrary "Olicom Ethernet Driver Disk" $(DialogDllName) DialogHandle
    ;
    ; Read main dialog setup and show dialog
    ;
    read-syms AdapterParameterDlg$(!STF_LANGUAGE)

    ui start "InputDlg"  $(DialogHandle)

    ifstr(i) $(DLGEVENT) == "CONTINUE"
	;
	; parameters have already been stored at this stage
	;
	;
	; Save new settings because this dialog might be called again.
	; If CANCEL was pressed these values will not be used
	;
	set XmitBufCountIndex = $(Combo1Out)
	set RecBufCountIndex = $(Combo2Out)
	set SpeedIndex = $(Combo3Out)
	set DuplexIndex = $(Combo4Out)
	set BusNoIndex = $(Combo5Out)
	set NetworkAddress = *($(EditTextOut),1)
	ui pop 1
	goto nextstep
    else-ifstr(i) $(DLGEVENT) == "EXIT"
	set CommonStatus = STATUS_USERCANCEL
	Debug-Output "Action: exit. Bye."
	ui pop 1
	FreeLibrary $(DialogHandle)
	goto end
    else
	ui pop 1
	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) VerifyEthAddress $(NetworkAddress)
	set FLibraryErrCtl = 0
	ifstr $(DlgResult) != "STATUS_SUCCESS"
	    FreeLibrary $(DialogHandle)
	    set Error = $(DlgResult)
	    goto nonfatal
	endif
    endif
    FreeLibrary $(DialogHandle)
unattended =+
    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 XmitBufCountValue = *($(XmitBufCountValues), ~($(XmitBufCountList),$(XmitBufCountIndex)))
    set RecBufCountValue = *($(RecBufCountValues), ~($(RecBufCountList),$(RecBufCountIndex)))
    set SpeedValue = *($(SpeedValues), ~($(SpeedList),$(SpeedIndex)))
    set DuplexValue = *($(DuplexValues), ~($(DuplexList),$(DuplexIndex)))
    ifint $(DuplexValue) == 0
       set DuplexString = "AUTO"
    else-ifint $(DuplexValue) == 1
       set DuplexString = "HALF"
    else-ifint $(DuplexValue) == 2
       set DuplexString = "FULL"
    Endif
    set BusNoValue = *($(BusNoValues), ~($(BusNoList),$(BusNoIndex)))
    ;
    ; Set up parameter list for AddValueList routine
    ;
    set NewValueList = {{XmitBufCount,$(NoTitle),$(!REG_VT_DWORD),$(XmitBufCountValue)},+
			{MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
			{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
			{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNoValue)},+
			{Speed,$(NoTitle),$(!REG_VT_DWORD),$(SpeedValue)},+
			{Duplex,$(NoTitle),$(!REG_VT_SZ),$(DuplexString)},+
			{RecBufCount,$(NoTitle),$(!REG_VT_DWORD),$(RecBufCountValue)}}
    ifstr $(NetworkAddress) != ""
       set NewValueList = >($(NewValueList),{NetworkAddress,$(NoTitle),$(!REG_VT_SZ),$(NetworkAddress)})
    endif
    ;
    ; Now update registry
    ;
    Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
    ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
	Shell $(UtilityInf),AddDefaultNetCardParameters,$(KeyParameters)
    endif
    ;
    ; If the network address has been deleted then also delete it from
    ; the registry.
    ;
    ifstr $(OldNetAddress) != ""
       ifstr $(NetworkAddress) == ""
	  DeleteRegValue $(KeyParameters) NetworkAddress
       endif
    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
    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
    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 "subroutn.inf" SetupMessage $(!STF_LANGUAGE) WARNING "Fatal Error"
    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
    endif
    Debug-Output "OEMSETNT.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)
   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  = "Olicom Ethernet PCI/II 10/100 Driver Disk"
    1  = "Windows NT DRVLIB"

[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-OCE4XMP100]
1, OCE4XMP.SYS,  SIZE=999

[Files-OCE4XMP10]
1, OCE4XMP.SYS,  SIZE=999

[Files-Dll]
1, oce4xmp.dll,  SIZE=999
1, oce4xmp.hlp,  SIZE=999
1, ocmpstat.exe, SIZE=999

[Files-dummy]
