OEMSETUP.inf Driver File Contents (rfc1577_234_v20.zip)

Driver Package File Name: rfc1577_234_v20.zip
File Size: 3.9 MB

;============================================================================================
;
; Integrated Telecom Express Inc. ADSL NIC Driver Installation Set, for Apollo, Windows NT4
;
; Copyright (c) 1998-2001, Integrated Telecom Express Inc.
;
;============================================================================================

; To enable/disable MAPI and DLL auto properties
; uncomment/comment all lines in section [Files-MAPIA2]
; uncomment/comment all lines start with LoadLibrary,LibraryProcedure, and freeLibrary 

[IntstallOptions]
 Install_ADSL_MAPI = "YES"
 Install_AMGM_PROT = "YES"
 Install_TCPIP = "YES"

[Identification]
    OptionType = NetAdapter
[PlatformsSupported]
    PCI
[Options]
    A2

[FileConstants]
UtilityInf      = "UTILITY.INF"
subroutineinf   = "SUBROUTN.INF"
SoftwareType    = "driver"
Exit_Code       = 0
NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
Manufacturer    = "GreatSpeed"


VendorID = 5233  ;; 1471 (Grea vendor ID)

ProductSoftwareA2Name     = "A2"
ProductSoftwareA2Title    = "GreatSpeed ADSL PCI NIC"
ProductSoftwareA2ImagePath = "\SystemRoot\System32\drivers\Grea95A2.sys"
NetRuleSoftwareA2Type     = "Grea95A2Sys ndisDriver Grea95A2Driver"
NetRuleSoftwareA2Use      = $(SoftwareType)
NetRuleSoftwareA2BindForm = """Grea95A2Sys"" yes no container"
NetRuleSoftwareA2Class    = {"Grea95A2Driver basic"}
NetRuleSoftwareSWA2Bindable = {"Grea95A2Driver A2Adapter non exclusive 100"}
ProductA2MajorVersion     = "1"
ProductA2MinorVersion     = "13"
ProductA2Version          = $(ProductA2MajorVersion)"."$(ProductA2MinorVersion)

OptionHelpFile = "GreaADSL.hlp"

ProductHardwareA2Name = "A2"
ProductHardwareA2Title = "GreatSpeed ADSL PCI NIC"
NetRuleHardwareA2Type  = "A2 A2Adapter"
NetRuleHardwareA2Class = {"A2Adapter basic"}
AdapterA2Type = 5   ;; PCI board
HelpA2Id = 20
A2CFID = 392     ;; 0x0188
ProductKeyA2Name  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareA2Name)"\CurrentVersion"
ParamKeyA2Name    = $(!NTN_ServiceBase)"\"$(ProductHardwareA2Name)"\Parameters"


NetRuleHardwareBindForm = " yes yes container"
VersionKeyName    = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion"

[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
NT350VersionConstant = "3.50"
NT310VersionConstant = "3.10"
NT400VersionConstant = "4.0"
DefaultVpi       ="0"
DefaultVci       ="35"
DefaultTxCellQueueLength = "10000"
DefaultRxCellQueueLength = "10000"
DefaultFraming        ="0"
DefaultModemOpMode    ="1"
DefaultAtuC_VendorID  ="0"
DefaultIncTxPower     ="0"
DefaultBoardConf      ="1"
DefaultLEDType        ="0"
DefaultEnPower        ="0"
DefaultDiscTimeOut    ="30"

DefaultProtocol      ="0"
DefaultVpiBert       ="0"
DefaultVciBert       ="21"

DefaultQoS	     ="0"
DefaultPCR           ="1811"
DefaultSCR           ="905"
DefaultMBS           ="448"
DefaultAVR           ="905"
DefaultMinRate       ="1358"

DefaultIPAddress     ="192.168.1.2"
DefaultSubnetMask    ="255.255.255.0"
DefaultOam           ="0"
DefaultBitSwap       ="1"


MinVpi           ="0"
MaxVpi           ="255"
MinVci           ="0"
MaxVci           ="65535"
UpdateMsg        ="Setup need to reinstall ADSL Mapi application"
OSVer            ="NT4"
NDI_INSTALL	 = 1
NDI_REMOVE	 = 2
NDI_CONFIG	 = 4
NDI_UPDATE       = 8

;DialogDllName = "defpa.dll"
[date]
    Now = {} ? $(!LIBHANDLE) GetSystemDate
[Identify]
    read-syms Identification
    set Status     = STATUS_SUCCESSFUL
    set Identifier = $(OptionType)
    set SourceMedia      = #("Source Media Descriptions", 1, 1)
    Return $(Status) $(Identifier) $(SourceMedia)
[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]
    Set !G:DebugOutputControl = 1
    set CurrLang = $($0)
    set Option   = $($1)
    set SrcDir   = $($2)
    set AddCopy  = $($3)
    set DoCopy   = $($4)
    set DoConfig = $($5)
    set LanguageList = ^(LanguagesSupported, 1)
    Ifcontains(i) $($0) NOT-IN $(LanguageList)
	Return STATUS_NOLANGUAGE
    endif
    set-subst LF = "\n"
    set-subst DQ = "\42"
    read-syms GeneralConstants
    read-syms FileConstants
    read-syms IntstallOptions
    
    set NetRuleSoftwareBindable = $($R1)
    read-syms DialogConstants$(!STF_LANGUAGE)
    ifstr(i) $(!NTN_Origination) == "NCPA"
	set Continue = "OK"
    endif
    read-syms FileConstants$(!STF_LANGUAGE)
    detect date
    set-title  $(Function$(Option)Title)
    set to   = Begin
    set from = Begin
    set CommonStatus = STATUS_SUCCESSFUL
    EndWait
Begin = +

;*********** add this to check correct platform supported********
   ifstr(i) $(!STF_PLATFORM) == "Alpha"      
      set CommonStatus = STATUS_USERCANCEL
      goto end
   else-ifstr(i) $(!STF_PLATFORM) == "Alpha_AXP"
      set CommonStatus = STATUS_USERCANCEL
      goto end
   endif
   
   ;Get NT OS Version

   OpenRegKey $(!REG_H_LOCAL) "" $(VersionKeyName) $(MAXIMUM_ALLOWED) KeyVersion
   GetRegValue $(KeyVersion),"CurrentVersion",VersionStruct
   CloseRegKey $(KeyVersion)
   Set NTVersion = *($(VersionStruct),4)
   set Help_Directory = "WINNT"
   
   Ifstr(i) $(NTVersion) == $(NT400VersionConstant)
	Debug-Output "$(InfFile) :$(NTVersion) = $(NT400VersionConstant) "      
   else
	set Error = "This version of Windows NT is not support by this product"
	goto fatal
   endif
   
;****************************************************************

    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
	  Ifstr(i) $(ProductKey$(Option)Name) == $(!NTN_RegBase)
	       Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
	       ifint $($ShellCode) != $(!SHELL_CODE_OK)
		     goto ShellCodeError
	       endif
	       set Error = $($R0)
	       set from = end
	       set to = end
	       goto nonfatalinfo
	  else
	       set StartLabel = configureadapter
	  endif
   else
	set StartLabel = installadapter
	set OEM_ABANDON_OPTIONS = {}
	set OEM_ABANDON_SOFTWARE = FALSE
	set OEM_ABANDON_ON = TRUE
    endif
    set from = $(fatal)
    set to = $(fatal)
    goto $(StartLabel)
    
installadapter = +

    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKey$(Option)Name) $(MAXIMUM_ALLOWED) KeyProduct
    Ifstr $(KeyProduct) != $(KeyNull)
	CloseRegKey $(KeyProduct)
	ifstr(i) !(NTN_RegBase) == $(ProductKey$(Option)Name)
	   Shell $(UtilityInf), VerExistedDlg, $(ProductSoftware$(Option)Title),+
	       $(Product$(Option)Version)
	   ifint $($ShellCode) != $(!SHELL_CODE_OK)
	       goto ShellCodeError
	   endif
	   goto end
	else
	   Shell $(UtilityInf), CardExistedDlg
	   ifint $($ShellCode) != $(!SHELL_CODE_OK)
	      goto ShellCodeError
	   endif
	   ifstr(i) $($R1) != "OK"
	       set CommonStatus = STATUS_USERCANCEL
	       goto end
	   endif
	   set OldVersionExisted = $(TRUE)
	endif
    Endif
    ifstr(i) $(DoCopy) == "YES"
	Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
	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-Hlp"
    endif

    Goto installproduct
    
configureadapter = +
 Debug-Output "$(InfFile) : Configureadapter"

    Debug-Output $(InfName)": Configure Adapter "$(!NTN_RegBase)
    IfStr $(KeyProduct) == $(KeyNull)
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
	IfStr $(KeyProduct) == $(KeyNull)
	    Set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
	    Debug-Output $(InfName)": Cannot find component product key"
	    GoTo FatalRegistry
	EndIf
    EndIf


    Debug-Output $(InfName)": Shelling to FindService"
    Shell $(UtilityInf) FindService, $(KeyProduct)
    IfInt $($ShellCode) != $(!SHELL_CODE_OK)
	Debug-Output $(InfName)": FindService shell failure"
	GoTo ShellCodeError
    EndIf
    IfStr(i) $($R0) != NO_ERROR
	Debug-Output $(InfName)": FindService Shell error: "$($R0)
	GoTo FatalRegistry
    EndIf

    Set KeyParameters = $($R2)
    CloseRegKey $($R1)
    CloseRegKey ($KeyParameters)

    IfStr $(KeyParameters) == $(KeyNull)
	Set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
	Debug-Output $(InfName)": Cannot find component service"
	GoTo FatalRegistry
    EndIf

    ;set DlgType      = "MessageBox"
    ;set STF_MB_TITLE = "ConfigureAdapter"
    ;set STF_MB_TEXT  = $(KeyParameters)
    ;set STF_MB_TYPE  = 1
    ;set STF_MB_ICON  = 2
    ;set STF_MB_DEF   = 1
    ;ui start "update Message" 

    
   LoadLibrary "GreatSpeed ADSL PCI NIC" $(!STF_WINDOWSSYSPATH)\NDINT4.dll DllHandle
   LibraryProcedure Result, $(DllHandle), MyNdiProc, $(OSVer), $(Option), "1483", $(NDI_CONFIG)
   freeLibrary $(DllHandle)

    
 goto end
 
installproduct =+
    StartWait
    
    set DeviceID = $($(Option)CFID) 
    Shell $(UtilityInf), GetPCIInformation, $(VendorID) $(DeviceID)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	   goto ShellCodeError
    endif
    
    ifstr(i) $($R0) == {}
	 set Error = $(CANNOT_FIND_ANY_CARD)
	 set CommonStatus = USER_CANCEL
	 set from = end
	 goto nonfatal
    endif
    
    set AdapterList = $($R0)

    ifint $(OldVersionExisted) == $(FALSE)
	Ifstr(i) $(DoCopy) == "YES"
	   Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
	   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
	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
	Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
	    $(ProductSoftware$(Option)Name), +
	    $(ProductSoftware$(Option)Name), +
	    $(ProductSoftware$(Option)Title), $(STF_CONTEXTINFNAME), +
	    $(ProductSoftware$(Option)ImagePath), "kernel", "NDIS", {}, "",+
	    $(NetEventDLL)
	Set OEM_ABANDON_SOFTWARE = TRUE
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    goto ShellCodeError
	endif
	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
	    EndWait
	    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),$(Product$(Option)MajorVersion)},+
			   {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(Product$(Option)MinorVersion)},+
			   {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftware$(Option)Title)},+
			   {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftware$(Option)Description)},+
			   {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftware$(Option)Name)},+
			   {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
	Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    goto ShellCodeError
	endif
	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
	    EndWait
	    CloseRegKey $(SoftProductKey)
	    CloseRegKey $(SoftNetRuleKey)
	    CloseRegKey $(SoftServiceKey)
	    CloseRegKey $(SoftParameterKey)
	    CloseRegKey $(SoftLinkageKey)
	    goto fatalregistry
	endif
	set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftware$(Option)Type)},+
			    {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftware$(Option)Use)}, +
			    {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftware$(Option)BindForm)}, +
			    {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftware$(Option)Class)}, +
			    {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareSW$(Option)Bindable)}, +
			    {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
	Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    goto ShellCodeError
	endif
	set RegistryErrorIndex = $($R0)
	CloseRegKey $(SoftProductKey)
	CloseRegKey $(SoftNetRuleKey)
	CloseRegKey $(SoftServiceKey)
	CloseRegKey $(SoftParameterKey)
	CloseRegKey $(SoftLinkageKey)
	Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
	    EndWait
	    goto fatalregistry
	endif
    endif

    ForListDo $(AdapterList)
    set BusNum = *($($),1)
    set DeviceNum = *($($),2)
    set FunctionNum = *($($),3)
    Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
	  $(DeviceNum), $(ProductHardware$(Option)Description), $(ProductHardware$(Option)Name) "YES"
	    ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
	    endif
	    ifstr $($R0) != "NO_ERROR"
		set Error = $($R0)
		goto fatal
	    endif
	    ifstr(i) $($R1) != "YES"
		StartWait
		Shell $(UtilityInf), AddHardwareComponent, $(ProductHardware$(Option)Name),$(STF_CONTEXTINFNAME),$(ProductKey$(Option)Name)
		ifint $($R4) != -1
		    Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
		endif
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		    goto ShellCodeError
		endif
		set RegistryErrorIndex = $($R0)
		Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
		     EndWait
		     CloseRegKey $($R1)
		     CloseRegKey $($R2)
		     CloseRegKey $($R3)
		     goto fatalregistry
		endif
		
    
		Set HardNetCardKey      = $($R1)
		Set HardNetRuleKey      = $($R2)
		Set HardParameterKey    = $($R3)
		set AdapterNumber       = $($R4)
		set AdapterServiceName  = $($R5)
		
		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),$(ProductHardware$(Option)Name)},+
				    {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
				    {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
		Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		     goto ShellCodeError
		endif
		set BusTypeNum = 5
		set NewValueList = {{AdapterType,$(NoTitle),$(!REG_VT_DWORD),$(Adapter$(Option)Type)},+
				    {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
				    {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)}}
		Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		    goto ShellCodeError
		endif

		set NewValueList = {{Vpi,$(NoTitle),$(!REG_VT_DWORD),$(DefaultVpi)}, +
				    {Vci,$(NoTitle),$(!REG_VT_DWORD),$(DefaultVci)},+
				    {TxCellQueueLength,$(NoTitle),$(!REG_VT_DWORD),$(DefaultTxCellQueueLength)},+
                                    {RxCellQueueLength,$(NoTitle),$(!REG_VT_DWORD),$(DefaultRxCellQueueLength)},+
				    {ModemOpMode,$(NoTitle),$(!REG_VT_DWORD),$(DefaultModemOpMode)},+
				    {Protocol,$(NoTitle),$(!REG_VT_DWORD),$(DefaultProtocol)},+
				    {Vpi_BERT,$(NoTitle),$(!REG_VT_DWORD),$(DefaultVpiBert)},+
				    {Vci_BERT,$(NoTitle),$(!REG_VT_DWORD),$(DefaultVciBert)},+
                                    {Framing,$(NoTitle),$(!REG_VT_DWORD),$(DefaultFraming)},+
				    {QoS,$(NoTitle),$(!REG_VT_DWORD),$(DefaultQoS)},+
				    {PCR,$(NoTitle),$(!REG_VT_DWORD),$(DefaultPCR)},+
				    {SCR,$(NoTitle),$(!REG_VT_DWORD),$(DefaultSCR)},+
				    {MBS,$(NoTitle),$(!REG_VT_DWORD),$(DefaultMBS)},+
				    {AVR,$(NoTitle),$(!REG_VT_DWORD),$(DefaultAVR)},+
				    {MinRate,$(NoTitle),$(!REG_VT_DWORD),$(DefaultMinRate)},+
				    {BoardConf,$(NoTitle),$(!REG_VT_DWORD),$(DefaultBoardConf)},+
				    {Oam,$(NoTitle),$(!REG_VT_DWORD),$(DefaultOam)},+
				    {BitSwap,$(NoTitle),$(!REG_VT_DWORD),$(DefaultBitSwap)},+
				    {LEDType,$(NoTitle),$(!REG_VT_DWORD),$(DefaultLEDType)},+
				    {EnPower,$(NoTitle),$(!REG_VT_DWORD),$(DefaultEnPower)},+
				    {DiscTimeOut,$(NoTitle),$(!REG_VT_DWORD),$(DefaultDiscTimeOut)},+
				    {IncTxPower,$(NoTitle),$(!REG_VT_DWORD),$(DefaultIncTxPower)},+
				    {AtuC_VendorID,$(NoTitle),$(!REG_VT_DWORD),$(DefaultAtuC_VendorID)} }
		
		Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		    goto ShellCodeError
		endif

		
		set TempProdName = """"$(ProductHardware$(Option)Name)$(AdapterNumber)""""
		set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
		set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardware$(Option)Type)},+
				    {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
				    {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardware$(Option)Class)}, +
				    {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
		Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
		    goto ShellCodeError
		endif
		CloseRegKey $(HardNetCardKey)
		CloseRegKey $(HardNetRuleKey)
		set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
				    {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(DeviceNum)},+
				    {FunctionNumber,$(NoTitle),$(!REG_VT_DWORD),$(FunctionNum)}}
		Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)

	   ifstr $(Install_TCPIP) == "YES" 
	   OpenRegKey $(HardParameterKey) "" "Tcpip" $(MAXIMUM_ALLOWED) TCPIPKey

            ifstr(i) $(TCPIPKey) == ""
                CreateRegKey $(HardParameterKey) {"Tcpip",$(NoTitle),GenericClass} "" +
                $(MAXIMUM_ALLOWED) "" TCPIPKey
                debug-output "set Parameters"
                set NewValueList = {{EnableDHCP,$(NoTitle),$(!REG_VT_DWORD),0},+
									{AutoIPAddress,$(NoTitle),$(!REG_VT_DWORD),1},+
                                    {UseZeroBroadcast,$(NoTitle),$(!REG_VT_DWORD),0},+
                                    {IPAddress,$(NoTitle),$(!REG_VT_MULTI_SZ),$(DefaultIPAddress)},+
                                    {DefaultGateway,$(NoTitle),$(!REG_VT_MULTI_SZ),{}},+
                                    {SubnetMask,$(NoTitle),$(!REG_VT_MULTI_SZ),$(DefaultSubnetMask)},+
                                    {LLInterface,$(NoTitle),$(!REG_VT_SZ),""}}

                Shell  $(UtilityInf), AddValueList, $(TCPIPKey), $(NewValueList)
                ifstr(i) $(TCPIPKey) != ""
                    ifint $(EnableDHCPForThisAdapter) == 1
                        set NewValueList = {{IPAddress,$(NoTitle),$(!REG_VT_MULTI_SZ),{"0.0.0.0"}},+
                                            {DefaultGateway,$(NoTitle),$(!REG_VT_MULTI_SZ),{}},+
                                            {SubnetMask,$(NoTitle),$(!REG_VT_MULTI_SZ),{"0.0.0.0"}}}

                        Shell  $(UtilityInf), AddValueList, $(TCPIPKey), $(NewValueList)

                        ifint $($ShellCode) != $(!SHELL_CODE_OK)
                            Debug-Output "Can not write reg."
                            goto ShellCodeError
                        endif
                    else
                        ifstr(i) $(DefaultIPAddress) != ""
                            set IPAddressInfo = {}
                            GetRegValue $(TCPIPKey) "IPAddress" IPAddressInfo
                            set IPAddress = *($(IPAddressInfo), 4)
                            
							ifstr(i) $(IPAddress) == ""
                                set NewValueList = {{IPAddress,$(NoTitle),$(!REG_VT_MULTI_SZ),{$(DefaultIPAddress)}}}
                                Shell  $(UtilityInf), AddValueList, $(TCPIPKey), $(NewValueList)
                                ifint $($ShellCode) != $(!SHELL_CODE_OK)
                                            Debug-Output "Can not write reg."
                                            goto ShellCodeError
                                        endif
                                    endif
                                endif
                                ifstr(i) $(DefaultSubnetMask) != ""
                                    set SubnetMasInfo = {}
                                    GetRegValue $(TCPIPKey) "SubnetMask" SubnetMaskInfo
                                    set SubnetMask = *($(SubnetMaskInfo), 4)
                                    ifstr(i) $(SubnetMask) == ""
                                        set NewValueList = {{SubnetMask,$(NoTitle),$(!REG_VT_MULTI_SZ),{$(DefaultSubnetMask)}}}
                                        Shell  $(UtilityInf), AddValueList, $(TCPIPKey), $(NewValueList)
                                        ifint $($ShellCode) != $(!SHELL_CODE_OK)
                                            Debug-Output "Can not write reg."
                                            goto ShellCodeError
                                        endif
                                    endif
                                endif
                                ifstr(i) $(DefaultGateway) != ""
                                    GetRegValue $(TCPIPKey) "DefaultGateway" GatewayInfo
                                    set Gateway = *($(GatewayInfo), 4)
                                    ifstr(i) $(Gateway) == ""
                                        set NewValueList = {{DefaultGateway,$(NoTitle),$(!REG_VT_MULTI_SZ),{$(DefaultGateway)}}}
                                        Shell  $(UtilityInf), AddValueList, $(TCPIPKey), $(NewValueList)
                                        ifint $($ShellCode) != $(!SHELL_CODE_OK)
                                            Debug-Output "Can not write reg."
                                            goto ShellCodeError
                                        endif
                                    endif
                                endif

                            endif
                        endif
                    endif
                    CloseRegKey $(TCPIPKey)
                endif

	   endif    





		CloseRegKey $(HardParameterKey) 
		
		ifstr $(Install_AMGM_PROT) == "YES"                      
			Shell "", DiagRegistry  
			install "Install-AMGM"
			Shell $(!STF_WINDOWSPATH)\inf\nt40amgm.inf, InstallOption, $(CurrLang),+ 
			"amgm" ,$(SrcDir), YES, YES, YES, NO                
		endif
		ifstr $(Install_ADSL_MAPI) == "YES"
                        install "Install-MAPI"
                        OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" +
		        $(MAXIMUM_ALLOWED) KeyRun
;		        SetRegValue $(KeyRun) {ADSL_$(Option),$(NoTitle),$(!REG_VT_SZ),$(!STF_WINDOWSSYSPATH)\MAPIICON.EXE}
		        SetRegValue $(KeyRun) {ADSL_$(Option),$(NoTitle),$(!REG_VT_SZ),$(!STF_WINDOWSSYSPATH)\DLLMAPI6.EXE}
		        CloseRegKey $(KeyRun) 
		
			;set DlgType      = "MessageBox"
	    		;set STF_MB_TITLE = "installproduct"
	    		;set STF_MB_TEXT  = $(HardParameterKey)
	    		;set STF_MB_TYPE  = 1
	    		;set STF_MB_ICON  = 2
	    		;set STF_MB_DEF   = 1
	    		;ui start "update Message" 
    		
                        LoadLibrary "GreatSpeed ADSL PCI NIC" $(!STF_WINDOWSSYSPATH)\NDINT4.dll DllHandle
	    		LibraryProcedure Result, $(DllHandle), MyNdiProc, $(OSVer), $(Option), "1483", $(NDI_INSTALL), $(Install_ADSL_MAPI)
	    		freeLibrary $(DllHandle)
		endif    

		EndWait               
	    endif   ;;;ifstr(i) $($R1) != "YES"                     
	    
TermProcess =+
    EndForListDo
    EndWait
    goto successful

updateparameters =+

    set HardParameterKey    = $($R3)
    set NewValueList = {{Vpi,$(NoTitle),$(!REG_VT_DWORD),$(VpiValue)}, +
			{Vci,$(NoTitle),$(!REG_VT_DWORD),$(VciValue)},+
			{TxCellQueueLength,$(NoTitle),$(!REG_VT_DWORD),$(TxCellQueueLengthValue)},+
			{RxCellQueueLength,$(NoTitle),$(!REG_VT_DWORD),$(RxCellQueueLengthValue)}}
	 
 
    Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
    ifint $($ShellCode) != $(!SHELL_CODE_OK)
	goto ShellCodeError
    endif
    CloseRegKey $(KeyParameters)
    goto successful

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

    ifstr $(Install_AMGM_PROT) == "YES"                          
	  OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\amgm" $(!REG_KEY_READ) KeyAmgm 
	  ifstr $(KeyAmgm) != "" 
		Shell $(!STF_WINDOWSPATH)\inf\nt40amgm.inf, InstallOption, $(CurrLang),"amgm" ,$(SrcDir), YES, YES, YES, -inf 
	  CloseRegKey $(KeyAmgm) 
	  endif                        
    endif               
    
    ;set DlgType      = "MessageBox"
    ;set STF_MB_TITLE = "RemoveAdapter"
    ;set STF_MB_TEXT  = $(STF_CONTEXTINFNAME)
    ;set STF_MB_TYPE  = 1
    ;set STF_MB_ICON  = 2
    ;set STF_MB_DEF   = 1
    ;ui start "update Message" 
     
    LoadLibrary "GreatSpeed ADSL PCI NIC" $(!STF_WINDOWSSYSPATH)\NDINT4.dll DllHandle
    LibraryProcedure Result, $(DllHandle), MyNdiProc, $(OSVer), $(Option), "1483", $(NDI_REMOVE), $(STF_CONTEXTINFNAME)
    freeLibrary $(DllHandle)
    			 
    Ifstr(i) $(ProductKey$(Option)Name) == $(!NTN_RegBase)
	Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
	    $(ProductSoftware$(Option)Name)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    goto ShellCodeError
	endif
	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    goto fatalregistry
	endif
    else
	Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
	    $(ProductSoftware$(Option)Name), $(!NTN_RegBase)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    goto ShellCodeError
	endif
	set RegistryErrorIndex = $($R0)
	Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
	    goto fatalregistry
	endif               
    endif 
    
    EndWait
    goto end
    
UpgradeSoftware = +
     StartWait
     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKey$(Option)Name) $(MAXIMUM_ALLOWED) KeyProduct
     Ifstr $(KeyProduct) != $(KeyNull)
	   Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
	   ifint $($ShellCode) != $(!SHELL_CODE_OK)
	       Debug-Output "ShellCode error"
	       goto ShellCodeError
	   endif
	   set !UG_Filename = $($R0)	

	   ifstr $(Install_ADSL_MAPI) == "YES" 
	   
	         ;set DlgType      = "MessageBox"
                 ;set STF_MB_TITLE = "UpgradeSoftware"
                 ;set STF_MB_TEXT  = "close"
                 ;set STF_MB_TYPE  = 1
                 ;set STF_MB_ICON  = 2
                 ;set STF_MB_DEF   = 1
                 ;ui start "update Message" 
                 
                LoadLibrary "GreatSpeed ADSL PCI NIC" $(!STF_WINDOWSSYSPATH)\NDINT4.dll DllHandle
    	   	LibraryProcedure Result, $(DllHandle), MyNdiProc, $(OSVer), $(Option), "1483", $(NDI_UPDATE), "CLOSE"
    	   	freeLibrary $(DllHandle)

	   endif
	      
	   install "Install-Update"
	   ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
	       goto fatal
	   endif
	   SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(Product$(Option)MajorVersion)}
	   SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(Product$(Option)MinorVersion)}
	   CloseRegKey $(KeyProduct)
	   
	   ifstr $(Install_AMGM_PROT) == "YES"                   
		Shell "", DiagRegistry  
		install "Install-AMGM"
	   endif

	   ifstr $(Install_ADSL_MAPI) == "YES" 
	   
	         ;set DlgType      = "MessageBox"
                 ;set STF_MB_TITLE = "UpgradeSoftware"
                 ;set STF_MB_TEXT  = "open"
                 ;set STF_MB_TYPE  = 1
                 ;set STF_MB_ICON  = 2
                 ;set STF_MB_DEF   = 1
                 ;ui start "update Message" 
	   
                LoadLibrary "GreatSpeed ADSL PCI NIC" $(!STF_WINDOWSSYSPATH)\NDINT4.dll DllHandle
    	   	LibraryProcedure Result, $(DllHandle), MyNdiProc, $(OSVer), $(Option), "1483", $(NDI_UPDATE), "OPEN"
    	   	freeLibrary $(DllHandle)

	   endif    	   	
	  
     else
	   goto fatalregistry
     endif
     
     EndWait
     
     goto end
successful = +
    goto end
abandon = +
    ForListDo $(OEM_ABANDON_OPTIONS)
	Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
	    $(ProductSoftware$(Option)Name), $($)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    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), +
	    $(ProductSoftware$(Option)Name), FALSE
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
	    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 CommonStatus = STATUS_USERCANCEL
    Set Severity = STATUS
    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 = $(ShellCodeErrorTitle)
    set STF_MB_TEXT  = $(ShellCodeErrorText)
    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
;    ifstr(i) $(DoCopy) == "YES"
       set !STF_NCPA_FLUSH_COPYLIST = TRUE
       CopyFilesInCopyList
;    endif
    Exit

[Install-AMGM]
    set STF_VITAL = ""
    AddSectionFilesToCopyList Files-AMGMInf $(SrcDir) $(!STF_WINDOWSPATH)\inf
    AddSectionFilesToCopyList Files-AMGMSys $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
    set !STF_NCPA_FLUSH_COPYLIST = TRUE
    CopyFilesInCopyList
    Exit    

[Install-MAPI]
    set STF_VITAL = ""    
    AddSectionFilesToCopyList Files-MAPI$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
    set !STF_NCPA_FLUSH_COPYLIST = TRUE
    CopyFilesInCopyList
    Exit       
[Install-Hlp]
   set STF_VITAL = ""
   AddSectionFilesToCopyList Files-Hlp $(SrcDir)$(Help_Directory) $(!STF_WINDOWSPATH)
   set !STF_NCPA_FLUSH_COPYLIST = TRUE
   CopyFilesInCopyList
   Exit
[Install-Update]
   set STF_VITAL        = ""
   set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
;  AddSectionFilesToCopyList Files-Hlp $(SrcDir)$(Help_Directory) $(!STF_WINDOWSPATH)
   AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSPATH)\inf
   AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
   
   ifstr $(Install_AMGM_PROT) == "YES"                   
	AddSectionFilesToCopyList Files-AMGMInf $(SrcDir) $(!STF_WINDOWSPATH)\inf
	AddSectionFilesToCopyList Files-AMGMSys $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers              
   endif
   ifstr $(Install_ADSL_MAPI) == "YES"
	 AddSectionFilesToCopyList Files-MAPI$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
   endif                   
	   
   set !STF_NCPA_FLUSH_COPYLIST = TRUE
   CopyFilesInCopyList
   exit
[Source Media Descriptions]
    1  = "GreatSpeed Drivers"
[ProductType]
STF_PRODUCT  = Winnt
STF_PLATFORM = I386
STF_PLATFORM = Alpha
[Files-Inf]
1,oemsetup.inf,    SIZE=38000,     RENAME=$(!UG_Filename)

[Files-A2]
1,Grea95A2.SY_ , SIZE=163000, OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=Grea95A2.SYS

[Files-AMGMInf]
1,nt40amgm.inf,  SIZE=16000, OVERWRITE=ALWAYS

[Files-AMGMSys]
1,AMGM.SY_,      SIZE=4000,OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=AMGM.SYS

[Files-MAPIA2]
1,NDINT4.DL_   , SIZE=84000,  OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=NDINT4.DLL
1,DLLMAPI.EX_  , SIZE=84000,  OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=DLLMAPI.EXE
1,DLLMAPI2.EX_ , SIZE=84000,  OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=DLLMAPI2.EXE
1,DLLMAPI6.EX_ , SIZE=84000,  OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=DLLMAPI6.EXE	
1,DLLMAPI7.EX_ , SIZE=84000,  OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=DLLMAPI7.EXE	
1,DLLMAPI8.EX_ , SIZE=84000,  OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=DLLMAPI8.EXE	
1,UINSADSL.EX_ , SIZE=84000,  OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=UINSADSL.EXE	
1,MAPIICON.EX_ , SIZE=164000, OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=MAPIICON.EXE
1,MAPIDRV.DL_  , SIZE=164000, OVERWRITE=ALWAYS ,DECOMPRESS, RENAME=MAPIDRV.DLL
1,AdslCfg.ini  , SIZE=16000,  OVERWRITE=ALWAYS
1,ReadMe.htm   , SIZE=16000,  OVERWRITE=ALWAYS


[Files-Hlp]
1,GreaADSL.HL_ , SIZE=999, DECOMPRESS, RENAME=GreaADSL.HLP
[LanguagesSupported]
    ENG
[OptionsTextENG]
    A2  = "GreatSpeed ADSL PCI NIC"
[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:"

ProductSoftwareA2Description = "GreatSpeed ADSL PCI NIC"
FunctionA2Title = "GreatSpeed ADSL PCI NIC Setup"
ProductHardwareA2Description = "GreatSpeed ADSL PCI NIC"


NoList  = ^(NoChoices, 1)
NoValues = ^(NoChoices, 2)
ShellCodeErrorTitle     = "Error: "$(Function$(Option)Title)
ShellCodeErrorText      = "Shell Code Error."
CANNOT_FIND_ANY_CARD    = "Network card is not present in the system"
[DialogConstantsENG]
Help        = "&Help"
Exit        = "Cancel"
OK          = "OK"
HelpContext = ""
Continue    = "Continue"
Cancel      = "Cancel"

;set DlgType      = "MessageBox"
;set STF_MB_TITLE = "dbg messge here"
;set STF_MB_TEXT  = "dbg messge here"
;set STF_MB_TYPE  = 1
;set STF_MB_ICON  = 2
;set STF_MB_DEF   = 1
;ui start "update Message" 
server: web5, load: 1.00