;***********************************************************************
;
; OEMNSVIP.INF
;
;		Novell NetWare/IP SETUP INF file.
;
;***********************************************************************

;
; The following is the version info for Novell
;

;VeRsIoN=v4.10 Novell Client Install for Windows NT (970414)
;CoPyRiGhT=copyright 1992-1997, by Novell, INC. All rights reserved.

[Identification]
	OptionType = NetService

[Options]
	NetWareIP

[FileConstants]
	UtilityInf		= "UTILITY.INF"
	subroutineinf	= "SUBROUTN.INF"
	NwSubsInf		= "NWSUBS.INF"
	SoftwareType	= "driver"
	Exit_Code		= 0
	DriverToLoad	= ""

	;
	; EventLog Message File
	;
	
	NetEventDLL	= "%SystemRoot%\System32\nls\"$(NLSDirName)"\nwevents.dll"
	IoLogMsgDLL	= "%SystemRoot%\System32\IoLogMsg.dll"
	
	;
	; Software
	;
	
	ProductSoftwareName			= "NetWareIP"
	ProductSoftwareImagePath	= "\SystemRoot\system32\drivers\nwip.sys"
	NetRuleSoftwareType			= "NetWareIPSys NetWareIPDriver"
	NetRuleSoftwareUse			= $(SoftwareType)
	NetRuleSoftwareBindForm		= """NetWareIPSys"" yes no container"
	NetRuleSoftwareClass			= {"NetWareIPDriver basic"}
	NetRuleSoftwareBindable		= {"NetWareIPDriver NetWareIPAdapter non exclusive 100"}
	
	;
	; Hardware
	;
	
	ProductHardwareName				= "NetWareIP"
	NetRuleHardwareType				= "NetWareIP NetWareIPAdapter"
	NetRuleHardwareBindForm			= " yes yes container"
	NetRuleHardwareClass				= {"NetWareIPAdapter basic"}
	
	;
	; Registry Key
	;
	
	ProductKeyName	= $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
	ParamKeyName	= $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"


[GeneralConstants]
	;
	; Program Flow control variables
	;
	
	from	= ""
	to		= ""
	
	
	;
	; Return Codes; Exit_Code is set to one of these
	;
	
	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

	;
	; Product Info
	;
	
	Manufacturer			= "Novell"
	ProductMajorVersion	= 4
	ProductMinorVersion	= 00
	ProductVersion			= $(ProductMajorVersion)"."$(ProductMinorVersion)
	


;------------------------------------------------------------------------------
; 1. Identify	To verify that this INF deals with the smae 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	To return the option list supported by this INF and
;			the localized text list representing the options.
; Input:	$($0):	Lang. 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 = {}

	;
	; Check if the language requested is supported
	;

	set LanguageList = ^(LanguagesSupported, 1)

	Ifcontains(i) $($0) in $(LanguageList)
		goto returnoptions
	else
		set Status = STATUS_NOLANGUAGE
		goto finish_ReturnOptions
	endif

	;
	; form a list of all the options and another of the text representing
	;

returnoptions = +
	set OptionList			= ^(Options, 1)
	set OptionTextList	= ^(OptionsText$($0), 1)
	set Status				= STATUS_SUCCESSFUL

finish_ReturnOptions = +
	Return $(Status) $(OptionList) $(OptionTextList)



;------------------------------------------------------------------------------
; 2. InstallOption	This section is shelled to by main installation processing
;
; Function:	To copy files representing Options
;		To configure the installed option
;		To update the Registry for the installed option
;
; Input:	$($0):	Lang. 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		|
;				STATUS_NOTSUPPORTED
;
;------------------------------------------------------------------------------

[InstallOption]

	;
	; Set default values for
	;

	set Status	= STATUS_FAILED

	;
	; extract parameters
	;

	set Option	= $($1)
	set !SrcDir	= $($2)
	set !AddCopy	= $($3)
	set !DoCopy	= $($4)
	set !DoConfig = $($5)

	;
	; Check if the language requested is supported
	;

	set LanguageList = ^(LanguagesSupported, 1)
	Ifcontains(i) $($0) in $(LanguageList)
		goto installoption
	else
		set Status = STATUS_NOLANGUAGE
		goto finish_InstallOption
	endif

installoption = +

	;
	; Call the CommonSection
	;

	shell "" CommonSection $(Option)
	set Status = $($R0)
	ifstr(i) $($R1) != ""
		set DriverToLoad = { $($R1) }
	else
		set DriverToLoad = ""
	endif
	Return $(Status) $(DriverToLoad)


[CommonSection]
	StartWait
	set Option = $($0)

	read-syms GeneralConstants

	;
	; Find what NLS directory is being used
	;

	set NovellParameters = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\Parameters"
	Debug-OutPut "NovellParameters is "$(NovellParameters)
	OpenRegKey $(!REG_H_LOCAL) "" $(NovellParameters) $(MAXIMUM_ALLOWED) KeyNovellParameters
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		GetRegValue $(KeyNovellParameters) "NWLanguage" LanguageList
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set NLSDirName = *($(LanguageList), 4)
		else
			goto fatalregistry
		endif
		CloseRegKey $(KeyNovellParameters)
	else
		goto fatalregistry
	Endif

	;
	; Get NT version
	;

	set CurrentVersion = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion"
	OpenRegKey $(!REG_H_LOCAL) "" $(CurrentVersion) $(MAXIMUM_ALLOWED) CurrentVersionKey
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		GetRegValue $(CurrentVersionKey) "CurrentVersion" VersionList
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set VersionListData = *($(VersionList), 4)
			Split-string $(VersionListData) "." SplitVersionList
			Set NTMajorVersion = *($(SplitVersionList), 1)
			Set NTMinorVersion = *($(SplitVersionList), 3)

			Debug-OutPut "OEMNSVIP.INF: Windows NT current version is "$(VersionListData)
			Debug-OutPut "OEMNSVIP.INF: Windows NT Major version is "$(NTMajorVersion)
			Debug-OutPut "OEMNSVIP.INF: Windows NT Minor version is "$(NTMinorVersion)
		else
			Debug-Output "OEMNSVIP.INF:  Error getting NT version"
		endif
		CloseRegKey $(CurrentVersionKey)
	else
		Debug-Output "OEMNSVIP.INF:  Error opening "$(CurrentVersion)
	endif

	set-subst LF = "\n"
	read-syms FileConstants
	read-syms FileConstants$(!STF_LANGUAGE)
	read-syms InstallOption$(!STF_LANGUAGE)
	detect date
	set-title	$(FunctionTitle)
	set to	= Begin
	set from = Begin
	set CommonStatus = STATUS_SUCCESSFUL
	EndWait

	set CurrentVersion = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion"
	OpenRegKey $(!REG_H_LOCAL) "" $(CurrentVersion) $(MAXIMUM_ALLOWED) CurrentVersionKey
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		GetRegValue $(CurrentVersionKey) "CurrentVersion" VersionList
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set VersionListData = *($(VersionList), 4)
			Split-string $(VersionListData) "." SplitVersionList
			Set NTMajorVersion = *($(SplitVersionList), 1)
			Set NTMinorVersion = *($(SplitVersionList), 3)

			Debug-OutPut "Windows NT current version is "$(VersionListData)
			Debug-OutPut "Windows NT Major version is "$(NTMajorVersion)
			Debug-OutPut "Windows NT Minor version is "$(NTMinorVersion)

		else
			Debug-Output "OEMNPRNW.INF:  Error getting NT version"
		endif
		CloseRegKey $(CurrentVersionKey)
	else
		Debug-Output "OEMNPRNW.INF:  Error opening "$(CurrentVersion)
	endif

Begin = +
	Set !G:DebugOutputControl = 0
	Debug-Output "OEMNSVIP.INF: Begin Install Mode = "$(!NTN_InstallMode)
	Ifstr(i) $(!NTN_InstallMode) == deinstall
		set StartLabel = removeadapter
	else-Ifstr(i) $(!NTN_InstallMode) == Update
		set StartLabel = updateadapter
	else-Ifstr(i) $(!NTN_InstallMode) == bind
		set StartLabel = bindadapter
	else-Ifstr(i) $(!NTN_InstallMode) == configure
		set StartLabel = configureadapter

		Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
			Debug-Output "OEMNSVIP.INF:  Can't configure the Novell NetWareIP driver software."
			Shell $(UtilityInf), RegistryErrorString, CANNOT_CONFIGURE_SOFTWARE
			ifint $($ShellCode) != $(!SHELL_CODE_OK)
				Debug-Output "OEMNSVIP.INF:  ShellCode error:  can't get an error string."
				goto ShellCodeError
			endif
			set Error = $($R0)
			set from = end
			set to = end
			goto Warning
		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 = +
	Debug-Output "OEMNSVIP.INF:  Installing NetWareIP adapter"

	;
	;	Check whether the same version of the software exists
	;

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NetWareIP" $(MAXIMUM_ALLOWED) KeyProduct
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)

		;
		; Same version already existed in the local machine
		;

		CloseRegKey $(KeyProduct)

		Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(NetWareIPInstalledMessage)

		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
		endif

		set CommonStatus = STATUS_USERCANCEL
		goto end
	endif

;	OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
;	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
;		CloseRegKey $(KeyProduct)
;		ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
;			Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle), $(ProductVersion)
;			ifint $($ShellCode) != $(!SHELL_CODE_OK)
;				Debug-Output $(!STF_ONTEXTINFNAME)":  ShellCode error:  can't get an error string."
;				goto ShellCodeError
;			endif
;			goto end
;		else
;			Shell $(UtilityInf), CardExistedDlg
;			ifint $($ShellCode) != $(!SHELL_CODE_OK)
;				Debug-Output "OEMNSVIP.INF:  ShellCode error:  can't get an error string."
;				goto ShellCodeError
;			endif
;			ifstr(i) $($R1) != "OK"
;				goto end
;			endif
;			set OldVersionExisted = $(TRUE)
;		endif
;	endif

	;
	; Is this an Advanced Server
	;

	Debug-Output "OEMNSVIP.INF:  Checking to see if advanced server"
	set CanInstall = "NO"
	Set TempKeyName = "SYSTEM\CurrentControlSet\Control\ProductOptions"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		Set ValueName = "ProductType"
		GetRegValue $(TempKey) $(ValueName) ValueList
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set ValueListData = *($(ValueList), 4)
			ifstr(i) $(ValueListData) == "WinNT"
				set CanInstall = "YES"
				Debug-Output "OEMNSVIP.INF:  Can install is "$(CanInstall)
			endif
		else
			Debug-Output "OEMNSVIP.INF:  Failed to get ProductType"
		endif
		CloseRegKey $(TempKey)
	else
		Debug-Output "OEMNSVIP.INF:  Failed to open ProductOptions key"
	endif
	
;	ifstr(i) $(CanInstall) == "NO"
;		set DlgType			= "MessageBox"
;		set STF_MB_TITLE	= $(NetWareIPOnASMessageTitle)
;		set STF_MB_TEXT	= $(NetWareIPOnASMessageText)
;		set STF_MB_TYPE	= 1
;		set STF_MB_ICON	= 3
;		set STF_MB_DEF		= 1
;		ui start "NetWareIPOnAS"
;
;		set CommonStatus = STATUS_USERCANCEL
;		goto end
;	endif

	;
	; Install TCPIP if not already installed.  NetWareIP depends on TCPIP.
	;

	Debug-Output "OEMNSVIP.INF:  Checking if TCPIP is installed"
	shell "" Install-TCPIP
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "OEMNSVIP.INF:  Install-TCPIP ShellCode error "$($ShellCode)
		goto ShellCodeError
	else-ifstr(i) $($R0) != STATUS_SUCCESSFUL
		Debug-Output "OEMNSVIP.INF:  Install-TCPIP returned error"
		goto fatal
	endif

	;
	; Start the adapter install stuff
	;

	;
	; Add the software component
	;

	ifint $(NTMajorVersion) == "4"
		set GroupToJoin = "NDIS"
	else
		set GroupToJoin = ""
	endif


	ifint $(OldVersionExisted) == $(FALSE)
		Debug-Output "OEMNSVIP.INF: First Time Install"
		Shell $(UtilityInf), AddSoftwareComponent +
			$(Manufacturer), +
			$(ProductSoftwareName), +
			$(ProductSoftwareName), +
			$(ProductSoftwareTitle), +
			$(STF_CONTEXTINFNAME), +
			$(ProductSoftwareImagePath), +
			"kernelautostart", +
			$(GroupToJoin), +
			"", +
			"", +
			$(NetEventDLL)

		Set OEM_ABANDON_SOFTWARE = TRUE
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Debug-Output "OEMNSVIP.INF: AddSoftwareComponent ShellCode error "$($ShellCode)
			goto ShellCodeError
		endif
		set RegistryErrorIndex = $($R0)
		set KeyProduct		= $($R1)
		Set SoftNetRulesKey = $($R2)
		CloseRegKey $($R3)
		CloseRegKey $($R4)
		CloseRegKey $($R5)
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
			EndWait
			Debug-Output "OEMNSVIP.INF: AddSoftwareComponent Registry error "$(RegistryErrorIndex)
			CloseRegKey $(KeyProduct)
			CloseRegKey $(SoftNetRulesKey)
			goto fatalregistry
		endif
		set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
					{Hidden,$(NoTitle),$(!REG_VT_DWORD),1},+
					{MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
					{MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
					{Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
					{Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
					{Review,$(NoTitle),$(!REG_VT_DWORD),1},+
					{PathName,$(NoTitle),$(!REG_VT_SZ),$(!STF_CWDDIR)},+
					{ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
					{InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
		Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Debug-Output "OEMNSVIP.INF:  AddValueList ShellCode error "$($ShellCode)
			goto ShellCodeError
		endif
		set RegistryErrorIndex = $($R0)
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
			EndWait
			Debug-Output "OEMNSVIP.INF: AddValueList Registry error "$(RegistryErrorIndex)
			CloseRegKey $(KeyProduct)
			CloseRegKey $(SoftNetRulesKey)
			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)}, +
					{Infname ,$(NoTitle),$(!REG_VT_SZ),$(STF_CONTEXTINFNAME)} }
		Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Debug-Output "OEMNSVIP.INF: AddValueList ShellCode error "$($ShellCode)
			goto ShellCodeError
		endif
		set RegistryErrorIndex = $($R0)
		CloseRegKey $(KeyProduct)
		CloseRegKey $(SoftNetRulesKey)
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
			EndWait
			Debug-Output "OEMNSVIP.INF: AddValueList Registry error "$(RegistryErrorIndex)
			goto fatalregistry
		endif
	endif

	;
	; Add the hardware component at board two or later
	;

	;
	; If on NT 4.00 machine, add the board five times
	; Otherwise, add it once
	;

	set Count = 0
	ifint $(NTMajorVersion) == "4"
		set endCount = 5
	else
		set endCount = 1
	endif

StartHardwareInstallation = +

	ifint $(Count) < $(endCount)
		ifint $(Count) > 0
			set HideIt = 1
		else
			set HideIt = 0
		endif

		Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName),"","","2"
		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 "OEMNSVIP.INF: AddHardwareComponent Shell error "$($ShellCode)
			goto ShellCodeError
		endif

		set RegistryErrorIndex = $($R0)
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
			EndWait
			Debug-Output "OEMNSVIP.INF: AddHardwareComponent Registry error "$(RegistryErrorIndex)
			CloseRegKey $($R1)
			CloseRegKey $($R2)
			CloseRegKey $($R3)
			goto fatalregistry
		endif
		set KeyParameters = $($R3)
		set KeyAdapterRules = $($R2)
		set AdapterNumber = $($R4)
		set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
					{Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
					{Hidden,$(NoTitle),$(!REG_VT_DWORD),$(HideIt)},+
					{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, $($R1), $(NewValueList)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Debug-Output "OEMNSVIP.INF: AddValueList ShellCode error "$($ShellCode)
			goto ShellCodeError
		endif
		CloseRegKey $($R1)
		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)}, +
				{Infname ,$(NoTitle),$(!REG_VT_SZ),$(STF_CONTEXTINFNAME)}}

		Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Debug-Output "OEMNSVIP.INF: AddValueList ShellCode error "$($ShellCode)
			goto ShellCodeError
		endif
		set RegistryErrorIndex = $($R0)
		Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
			EndWait
			Debug-Output "OEMNSVIP.INF: AddValueList Registry error "$(RegistryErrorIndex)
			CloseRegKey $(KeyParameters)
			CloseRegKey $(KeyAdapterRules)
			goto fatalregistry
		endif
	
		CloseRegKey $(KeyAdapterRules)

		set-add Count = $(Count), 1
		goto StartHardwareInstallation

	endif

	Ifstr(i) $(CalledFromUpdate) == "YES"
		goto ReturnToUpdate
	endif

	;
	; By default depend on TCPIP
	;

	set DependOnList = {"Tcpip"}

	;
	; If NT 3.51 Machine, check to see if DHCP is installed.  If it is
	; depend on it.
	;

	ifint $(NTMajorVersion) == "3"
		Debug-Output "OEMNSVIP.INF:  Check to see if DHCP is installed"
	
		OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\DHCP" $(MAXIMUM_ALLOWED) KeyDHCP
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
	
			;
			; Check to see if the service is set to start
			;
	
			GetRegValue $(KeyDHCP) "Start" StartList
			Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
				Set StartValue = *($(StartList), 4)
				Ifint $(StartValue) < 3
	
					;
					; Make NetWareIP depend on the service DHCP
					;
	
					Debug-Output "OEMNSVIP.INF:  Make NetWareIP depend on DHCP service"
					set DependOnList = {"DHCP"}
				Endif
			Endif
	
			CloseRegKey $(KeyDHCP)
		Endif
	endif

	set TempKeyName = $(!NTN_ServiceBase)"\NetWareIP\Linkage"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		SetRegValue $(TempKey) {"OtherDependencies", $(NoTitle), $(!REG_VT_MULTI_SZ), $(DependOnList)}
		Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNSVIP.INF:  Can't set NetWareIP linkage key"
			goto fatalregistry
		endif
		FlushRegKey $(TempKey)
		CloseRegKey $(TempKey)
	else
		Debug-Output "OEMNSVIP.INF:  Can't open NetWareIP linkage key"
		goto fatalregistry
	endif


	;
	; Add 62 and 63 key for NetWareIP
	;

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\DHCP\Parameters\Options" $(MAXIMUM_ALLOWED) KeyDHCPOptions
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		CreateRegKey $(KeyDHCPOptions) {"62", $(NoTitle), GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOption62
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			SetRegValue $(KeyOption62) {"KeyType", $(NoTitle), $(!REG_VT_DWORD), "1"}
			SetRegValue $(KeyOption62) {"RegLocation", $(NoTitle),$(!REG_VT_SZ), "System\CurrentControlSet\Services\NetWareIP\Parameters\rawdname"}
			CloseRegKey $(KeyOption62)
		Else
			Debug-Output "Error creating DHCP options key 62"
		Endif
		CreateRegKey $(KeyDHCPOptions) {"63", $(NoTitle), GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOption63
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			SetRegValue $(KeyOption63) {"KeyType", $(NoTitle), $(!REG_VT_DWORD), "1"}
			SetRegValue $(KeyOption63) {"RegLocation", $(NoTitle), $(!REG_VT_SZ), "System\CurrentControlSet\Services\NetWareIP\Parameters\rawinfo"}
			CloseRegKey $(KeyOption63)
		Else
			Debug-Output "Error creating DHCP options key 63"
		Endif
		CloseRegKey $(KeyDHCPOptions)
	Else
		Debug-Output "OEMNSVIP.INF:  DHCP Not Installed"
	Endif


	;
	; Disable OdiSourceRouting if enabled
	;

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\OdiSourceRouting" $(MAXIMUM_ALLOWED) KeyProduct
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		Set KeyValueList = {"Start", $(NoTitle), $(!REG_VT_DWORD), 4}
		SetRegValue $(KeyProduct) $(KeyValueList)
		CloseRegKey $(KeyProduct)
	Endif

	;
	; Add NwlnkIpx binding for NetWareIPDriver.
	; Remove binding for ndisDriver
	;

	Shell "" Install-Bindings
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "OEMNSVIP.INF:  Install-Bindings ShellCode error "$($ShellCode)
		goto ShellCodeError
	else
		Ifstr(i) $($R0) != STATUS_SUCCESSFUL
			Debug-Output "OEMNSVIP.INF:  Install-Bindings returned error"
			goto fatalregistry
		endif
	endif

	;
	; Configure the NetWareIP Adapter if needed.
	;

	ifstr(i) $(!Remote_Config) == "ON"
		set !HaveNetWareIPParameters = "YES"
	else
		ifstr(i) $(!Preferred_DSS) != ""
			set !HaveNetWareIPParameters = "YES"
		else-ifstr(i) $(!NWIP_Domain_Name) != ""
			set !HaveNetWareIPParameters = "YES"
		endif
	endif

	ifstr(i) $(!HaveNetWareIPParameters) != "YES"
		StartWait
		LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\nwsetup.dll" NwLibHandle
		SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\"$(NLSDirName)"\nt4setup.hlp" $(!MinimumID) $(!MaximumID)
		ifint $(NTMajorVersion) < "4"
			SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\"$(NLSDirName)"\nt3setup.hlp" $(!MinimumID) $(!MaximumID)
		endif

		set HelpContext = $(IDH_NETWAREWRKSTATIONPARMS)
		LibraryProcedure LibResult $(NwLibHandle) NWIPDialog
	
		Debug-Output "LibResult = "$(LibResult)
	
		ifstr(i) $(LibResult) == "CONTINUE"
			Debug-Output "OEMNSVIP.INF:  OK hit"
		else
	
			;
			; Remove NetWareIP.  Cancel button was hit.
			;
	
			Set OldInstallMode = $(!NTN_InstallMode)
			Set !NTN_InstallMode = deinstall
			goto removeadapter
	
		endif
	
		FreeLibrary $(NwLibHandle)
	endif

	goto end


configureadapter = +
	Debug-Output "OEMNSVIP.INF:  Configuring NetWareIP adapter"
	
	;
	; Configure the NetWareIP Adapter.
	;
	
	StartWait
	LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\nwsetup.dll" NwLibHandle
	SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\"$(NLSDirName)"\nt4setup.hlp" $(!MinimumID) $(!MaximumID)
	ifint $(NTMajorVersion) < "4"
		SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\"$(NLSDirName)"\nt3setup.hlp" $(!MinimumID) $(!MaximumID)
	endif
	set HelpContext = $(IDH_NETWAREWRKSTATIONPARMS)
	LibraryProcedure LibResult $(NwLibHandle) NWIPDialog
	
	Debug-Output "OEMNPRNW.INF:  NWIPDialog returned "$(LibResult)
	ifstr(i) $(LibResult) != "CONTINUE"
		set CommonStatus = STATUS_USERCANCEL
	endif
	
	FreeLibrary $(NwLibHandle)
	goto end



bindadapter =+
	Debug-Output "OEMNSVIP.INF:  Binding NetWareIP adapter"

	;
	; First make sure tcpip was not removed out from under us.
	; If it was, pop message warning user.
	;

	set NoTCPIP = 0
	set TempKeyName = $(!NTN_ServiceBase)"\tcpip"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		GetRegValue $(TempKey) "DeleteFlag" ValueData
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set NoTCPIP = 1
		endif
	else
		set NoTCPIP = 1
		Debug-Output "OEMNSVIP.INF:  Failed to open key "$(TempKeyName)
	endif

	ifint $(NoTCPIP) == 1

		;
		; Pop up message warning user that TCPIP is not installed and
		; that NetWareIP will not function correctly.
		;

		set DlgType 		= "MessageBox"
		set STF_MB_TITLE	= $(ErrorMessageTitle)
		set STF_MB_TEXT	= $(NoTcpipMessageText)
		set STF_MB_TYPE	= 1
		set STF_MB_ICON	= 3
		set STF_MB_DEF		= 1
		ui start "NoTcpipError"

	endif

	;
	; By default depend on TCPIP
	;

	set DependOnList = {"Tcpip"}

	;
	; If NT 3.51 Machine, check to see if DHCP is installed.  If it is
	; depend on it.
	;

	ifint $(NTMajorVersion) == "3"
		Debug-Output "OEMNSVIP.INF:  Check to see if DHCP is installed"
	
		OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\DHCP" $(MAXIMUM_ALLOWED) KeyDHCP
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
	
			;
			; Check to see if the service is set to start
			;
	
			GetRegValue $(KeyDHCP) "Start" StartList
			Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
				Set StartValue = *($(StartList), 4)
				Ifint $(StartValue) < 3
	
					;
					; Make NetWareIP depend on the service DHCP
					;
	
					Debug-Output "OEMNSVIP.INF:  Make NetWareIP depend on DHCP service"
					set DependOnList = {"DHCP"}
				Endif
			Endif
	
			CloseRegKey $(KeyDHCP)
		Endif
	endif

	set TempKeyName = $(!NTN_ServiceBase)"\NetWareIP"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		SetRegValue $(TempKey) {"DependOnService", $(NoTitle), $(!REG_VT_MULTI_SZ), $(DependOnList)}
		Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNSVIP.INF:  Can't set NetWareIP linkage key"
			goto fatalregistry
		endif
		FlushRegKey $(TempKey)
		CloseRegKey $(TempKey)
	else
		Debug-Output "OEMNSVIP.INF:  Can't open NetWareIP linkage key"
		goto fatalregistry
	endif

	set TempKeyName = $(!NTN_ServiceBase)"\NetWareIP\Linkage"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		SetRegValue $(TempKey) {"OtherDependencies", $(NoTitle), $(!REG_VT_MULTI_SZ), $(DependOnList)}
		Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNSVIP.INF:  Can't set NetWareIP linkage key"
			goto fatalregistry
		endif
		FlushRegKey $(TempKey)
		CloseRegKey $(TempKey)
	else
		Debug-Output "OEMNSVIP.INF:  Can't open NetWareIP linkage key"
		goto fatalregistry
	endif

	;
	; Disable OdiSourceRouting if enabled
	;

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\OdiSourceRouting" $(MAXIMUM_ALLOWED) KeyProduct
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		Set KeyValueList = {"Start", $(NoTitle), $(!REG_VT_DWORD), 4}
		SetRegValue $(KeyProduct) $(KeyValueList)
		CloseRegKey $(KeyProduct)
	Endif

	goto end



removeadapter = +
	Debug-Output "OEMNSVIP.INF:  Removing NetWareIP adapter"

	;
	; Remove adapter
	;

	;
	; Find the NetWareIP adapters
	;

	Shell $(NwSubsInf) GetTotalAdapterList

	Set OdiProductNameList			= $($R0)
	Set OdiTitleList					= $($R1)
	Set OdiCardList					= $($R2)
	Set NumberOdiAdapters			= $($R3)
	Set NdisProductNameList			= $($R4)
	Set NdisTitleList					= $($R5)
	Set NdisCardList					= $($R6)
	Set NumberNdisAdapters			= $($R7)
	Set ODINSUPCardNumber			= $($R8)
	Set NetWareIPCardNumList		= $($R9)
	Set NumberNetWareIPAdapters	= $($R10)

	Debug-Output "OEMNSVIP.INF:  NetWareIPCardNumList is "$(NetWareIPCardNumList)

	ForListDo $(NetWareIPCardNumList)
		set !NTN_RegBase = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($)
		Debug-Output "OEMNSVIP.INF:  !NTN_RegBase is "$(!NTN_RegBase)

		Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
			Debug-Output "OEMNSVIP.INF:  RemoveSoftwareComponent"
			Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), $(ProductSoftwareName)
			ifint $($ShellCode) != $(!SHELL_CODE_OK)
				Debug-Output "OEMNSVIP.INF:  RemoveSoftwareComponent ShellCode error "$($ShellCode)
				goto ShellCodeError
			endif
			set RegistryErrorIndex = $($R0)
			Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
				goto fatalregistry
			endif
		else
			Debug-Output "OEMNSVIP.INF:  RemoveHardwareComponent"
			Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), $(ProductSoftwareName), $(!NTN_RegBase)
			ifint $($ShellCode) != $(!SHELL_CODE_OK)
				Debug-Output "OEMNSVIP.INF:  RemoveHardwareComponent ShellCode error "$($ShellCode)
				goto ShellCodeError
			endif
			set RegistryErrorIndex = $($R0)
			Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
				goto fatalregistry
			endif
		endif
	EndForListDo

	;
	; Remove DHCP Options 62 & 63 from DHCP
	;
	
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\DHCP\Parameters\Options" $(MAXIMUM_ALLOWED) KeyDHCPOptions
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		DeleteRegTree $(KeyDHCPOptions) "62"
		DeleteRegTree $(KeyDHCPOptions) "63"
		CloseRegKey $(KeyDHCPOptions)
	Else
		Debug-Output "Debug-Output DHCP Not Installed"
	Endif

	;
	; Remove NwlnkIpx binding to NetWareIPDriver.
	; Add back binding to ndisDriver
	;

	Shell "" Remove-Bindings
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "OEMNSVIP.INF:  Remove-Bindings ShellCode error "$($ShellCode)
		goto ShellCodeError
	else
		Ifstr(i) $($R0) != STATUS_SUCCESSFUL
			Debug-Output "OEMNSVIP.INF:  Remove-Bindings returned error"
			goto fatalregistry
		endif
	endif

	goto end


updateadapter = +
	Debug-Output "OEMNSVIP.INF:  Updating NetWareIP adapter"

	;
	; Remove the old NetWareIP way of preventing NwlnkIpx from binding
	; to anything but NetWareIP.  Go straight to the disabled key and
	; remove the stuff that the old NetWareIP install put there.
	;

	Shell "" Remove-Oldstyle-Bindings
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "OEMNSVIP.INF:  Remove-Oldstyle-Bindings ShellCode error "$($ShellCode)
		goto ShellCodeError
	else
		Ifstr(i) $($R0) != STATUS_SUCCESSFUL
			Debug-Output "OEMNSVIP.INF:  Remove-Oldstyle-Bindings returned error"
			goto fatalregistry
		endif
	endif

	;
	; Install the new bindings method by changing one of NwlnkIpx's bindable
	; rules so that NwlnkIpx will only bind to NetWareIP
	;

	Shell "" Install-Bindings
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "OEMNSVIP.INF:  Install-Bindings ShellCode error "$($ShellCode)
		goto ShellCodeError
	else
		Ifstr(i) $($R0) != STATUS_SUCCESSFUL
			Debug-Output "OEMNSVIP.INF:  Install-Bindings returned error"
			goto fatalregistry
		endif
	endif

	;
	; Hide the software driver for NetWareIP
	;

	Set TempKeyName = $(!NTN_SoftwareBase)"\Novell\NetWareIP\CurrentVersion"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		Debug-Output "OEMNPRNW.INF:  Hiding the NetWareIP software driver"

		SetRegValue $(TempKey) {"Hidden", $(NoTitle), $(!REG_VT_DWORD), 1}
		Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNPRNW.INF: Cant update Winsock Transports value"
		Endif

		CloseRegKey $(TempKey)
	else
		Debug-Output "OEMNPRNW.INF:  Failed to update the Hidden value for "$(TempKeyName)
	endif

	;
	; Get a count of NetWareIP adapters.  Add up to 5 adapters for NT 4.00
	;

	Shell $(NwSubsInf) GetTotalAdapterList

	Set OdiProductNameList			= $($R0)
	Set OdiTitleList					= $($R1)
	Set OdiCardList					= $($R2)
	Set NumberOdiAdapters			= $($R3)
	Set NdisProductNameList			= $($R4)
	Set NdisTitleList					= $($R5)
	Set NdisCardList					= $($R6)
	Set NumberNdisAdapters			= $($R7)
	Set ODINSUPCardNumber			= $($R8)
	Set NetWareIPCardNumList		= $($R9)
	Set NumberNetWareIPAdapters	= $($R10)

	ifint $(NTMajorVersion) == "4"
		set Count = $(NumberNetWareIPAdapters)
		set endCount = 5
	else
		set Count = 1
		set endCount = 1
	endif

	set CalledFromUpdate = "YES"
	goto StartHardwareInstallation

ReturnToUpdate = +
	goto end


abandon = +
	Debug-Output "OEMNSVIP.INF: abandon"
	ForListDo $(OEM_ABANDON_OPTIONS)
		Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), $(ProductSoftwareName), $($)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Debug-Output "OEMNSVIP.INF: RemoveHardwareComponent ShellCode error "$($ShellCode)
			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 "OEMNSVIP.INF: RemoveSoftwareComponent ShellCode error "$($ShellCode)
			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


nonfatal = +
	Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(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) $(DriverToLoad)


[Install-Option]
	set STF_VITAL = ""
	ifstr(i) $(!AddCopy) == "YES"
		AddSectionFilesToCopyList Files-$(Option) $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)\drivers
	endif
	ifstr(i) $(!DoCopy) == "YES"
		CopyFilesInCopyList
	endif
	ifstr(i) $(!DoConfig) == "YES"
	endif
	Exit


[Install-Update]
	Debug-Output "OEMNSVIP.INF: Install-Update"
	set STF_VITAL 	= ""
	set STF_OVERWRITE	= "VERIFYSOURCEOLDER"
	AddSectionFilesToCopyList Files-$(Option) $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)\drivers
	AddSectionFilesToCopyList Files-Inf $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)
	CopyFilesInCopyList
	exit



;*************************************************************************
;
;		SECTION:		Install-TCPIP
;
;		PURPOSE:		Called at install time and update time to install the
;						TCPIP transport.
;
;		ARGUMENTS:	None
;
;		RETURNS:		None
;
;		REFERENCES:	None
;
;		MODIFIES:	None
;
;*************************************************************************
[Install-TCPIP]
	read-syms GeneralConstants
	read-syms InstallOption$(!STF_LANGUAGE)

	;
	; Assume all is well until we find out otherwise
	;

	set CommonStatus = STATUS_SUCCESSFUL

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Tcpip" $(MAXIMUM_ALLOWED) KeyTCPIP
	ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		Debug-Output "OEMNSVIP.INF:  Installing TCPIP"

		;
		; Ask the user if they want to install TCPIP
		;

		set DlgType 		= "MessageBox"
		set STF_MB_TITLE	= $(InstallTcpipMessageTitle)
		set STF_MB_TEXT	= $(InstallTcpipMessageText)
		set STF_MB_TYPE	= 3
		set STF_MB_ICON	= 4
		set STF_MB_DEF		= 1
		ui start "InstallTCPIP"

		Ifstr(i) $(DLGEVENT) == "NO"
			Debug-Output  "OEMNSVIP.INF:  Don't install TCPIP"
			set CommonStatus = STATUS_USERCANCEL
			goto terminate
		Endif

		Debug-Output "OEMNSVIP.INF:  Install TCPIP"
		Set OldInstallMode = $(!NTN_InstallMode)
		Set !NTN_InstallMode = install
		Set OldSTF_SRCDIR_OVERRIDE = $(!STF_SRCDIR_OVERRIDE)
		Set !STF_SRCDIR_OVERRIDE = ""
		Shell "oemnxptc.inf" InstallOption $(!STF_LANGUAGE) "TC" "" YES YES YES
		Set !STF_SRCDIR_OVERRIDE = $(OldSTF_SRCDIR_OVERRIDE)
		Set !NTN_InstallMode = $(OldInstallMode)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			set CommonStatus = STATUS_FAILED
			goto terminate
		Endif
		set CommonStatus = $($R0)
		Ifstr(i) $(CommonStatus) != STATUS_SUCCESSFUL
			Debug-Output "OEMNSVIP.INF:  Install of TCPIP returned "$(CommonStatus)
			goto terminate
		Endif
	Else
		CloseRegKey $(KeyTCPIP)
	Endif

terminate = +
	Return $(CommonStatus)


;*************************************************************************
;
;		SECTION:		Install-Bindings
;
;		PURPOSE:		Called at install time and update time to install the
;						NwlnkIpx bindings.
;
;		ARGUMENTS:	None
;
;		RETURNS:		None
;
;		REFERENCES:	None
;
;		MODIFIES:	None
;
;*************************************************************************
[Install-Bindings]
	StartWait
	Read-syms GeneralConstants
	Set status = STATUS_SUCCESSFUL

	;
	; Open NwlnkIpx keys
	;

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\NwlnkIpx\CurrentVersion\NetRules" $(MAXIMUM_ALLOWED) RulesKey
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		Debug-Output "OEMNSVIP.INF:  Can't open NwlnkIpx NetRules key"
		set status = STATUS_FAILED
		Goto IB_Return
	Endif

	;
	; Set up bindings for NwlnkIpx
	;

	Set ValueName = "Bindable"
	GetRegValue $(RulesKey) $(ValueName) ValueList
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		CloseRegKey $(RulesKey)
		Debug-Output "OEMNSVIP.INF:  Can't get bindable value for NwlnkIpx"
		set status = STATUS_FAILED
		Goto IB_Return
	endif

	Set OldList = *($(ValueList), 4)
	Set NewList = {}

	Debug-Output "OEMNSVIP.INF:  OldList for NwlnkIpx bind is "$(OldList)

	ForListDo $(OldList)
		Set Item = $($)
		Ifstr(i) $(Item) != "ipxTransport ndisDriver non non 100"
			Set NewList = >($(NewList), $(Item))
		else
			Set NewList = >($(NewList), "ipxTransport NetWareIPDriver non non 100")
		endif
	EndForListDo

	Debug-Output "OEMNSVIP.INF:  NewList for NwlnkIpx bind is "$(NewList)

	SetRegValue $(RulesKey) {$(ValueName), $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewList)}
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		Debug-Ouput "OEMNSVIP.INF:  Can't update Bindable value for NwlnkIpx"
		set status = STATUS_FAILED
		goto IB_Return
	Endif

	;
	; Close keys
	;

	CloseRegKey $(RulesKey)

IB_Return = +
	Return $(status)


;*************************************************************************
;
;		SECTION:		Remove-Bindings
;
;		PURPOSE:		Called at remove time to remove the	NwlnkIpx bindings.
;
;		ARGUMENTS:	None
;
;		RETURNS:		None
;
;		REFERENCES:	None
;
;		MODIFIES:	None
;
;*************************************************************************
[Remove-bindings]
	StartWait
	Read-syms GeneralConstants
	Set status = STATUS_SUCCESSFUL

	;
	; Open NwlnkIpx keys
	;

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\NwlnkIpx\CurrentVersion\NetRules" $(MAXIMUM_ALLOWED) RulesKey
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		Debug-Output "OEMNSVIP.INF:  Can't open NwlnkIpx NetRules key"
		set status = STATUS_FAILED
		Goto RB_Return
	Endif

	;
	; Restore bindings for NwlnkIpx
	;

	Set ValueName = "Bindable"
	GetRegValue $(RulesKey) $(ValueName) ValueList
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		CloseRegKey $(RulesKey)
		Debug-Output "OEMNSVIP.INF:  Can't get bindable value for NwlnkIpx"
		set status = STATUS_FAILED
		Goto RB_Return
	endif

	Set OldList = *($(ValueList), 4)
	Set NewList = {}

	Debug-Output "OEMNSVIP.INF:  OldList for NwlnkIpx bind is "$(OldList)

	ForListDo $(OldList)
		Set Item = $($)
		Ifstr(i) $(Item) != "ipxTransport NetWareIPDriver non non 100"
			Set NewList = >($(NewList), $(Item))
		else
			Set NewList = >($(NewList), "ipxTransport ndisDriver non non 100")
		endif
	EndForListDo

	Debug-Output "OEMNSVIP.INF:  NewList for NwlnkIpx bind is "$(NewList)

	SetRegValue $(RulesKey) {$(ValueName), $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewList)}
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		Debug-Ouput "OEMNSVIP.INF:  Can't update Bindable value for NwlnkIpx"
		set status = STATUS_FAILED
		goto RB_Return
	Endif

	;
	; Close keys
	;

	CloseRegKey $(RulesKey)

RB_Return = +
	Return $(status)


[Remove-Oldstyle-bindings]
	StartWait
	Read-syms GeneralConstants
	Set Status = STATUS_SUCCESSFUL

	;
	; Open NwlnkIpx key and remove disabled bindings
	;

	set TempKeyName = $(!NTN_ServiceBase)"\NwlnkIpx\Linkage\Disabled"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) DisabledKey
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		SetRegValue $(DisabledKey) {"Bind", $(NoTitle), $(!REG_VT_MULTI_SZ), {}}
		Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNSVIP.INF:  Can't update bind value for NwlnkIpx Disabled key"
			CloseRegKey $(DisabledKey)
			set Status = STATUS_FAILED
			Goto ROB_Return
		endif
		SetRegValue $(DisabledKey) {"Export", $(NoTitle), $(!REG_VT_MULTI_SZ), {}}
		Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNSVIP.INF:  Can't update export value for NwlnkIpx Disabled key"
			CloseRegKey $(DisabledKey)
			set Status = STATUS_FAILED
			Goto ROB_Return
		endif
		SetRegValue $(DisabledKey) {"Route", $(NoTitle), $(!REG_VT_MULTI_SZ), {}}
		Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNSVIP.INF:  Can't update route value for NwlnkIpx Disabled key"
			CloseRegKey $(DisabledKey)
			set Status = STATUS_FAILED
			Goto ROB_Return
		endif
		CloseRegKey $(DisabledKey)
	else
		Debug-Output "OEMNSVIP.INF:  Can't open NwlnkIpx Disabled key"
		set Status = STATUS_FAILED
		Goto ROB_Return
	endif

	;
	; Open NetWareIP keys to remove one of the bindable rules that was set
	; by previous installs of NetWareIP.  The bindable rule was set under
	; NetWareIP and now I want it to replace a rule under NwlnkIpx
	;

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Novell\NetWareIP\CurrentVersion\NetRules" $(MAXIMUM_ALLOWED) RulesKey
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		Debug-Output "OEMNSVIP.INF:  Can't open NetWareIP NetRules key"
		set status = STATUS_FAILED
		Goto ROB_Return
	Endif

	;
	; Set up bindings for NetWareIP
	;

	Set ValueName = "Bindable"
	GetRegValue $(RulesKey) $(ValueName) ValueList
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		CloseRegKey $(RulesKey)
		Debug-Output "OEMNSVIP.INF:  Can't get bindable value for NetWareIP"
		set status = STATUS_FAILED
		Goto ROB_Return
	endif

	Set OldList = *($(ValueList), 4)
	Set NewList = {}

	Debug-Output "OEMNSVIP.INF:  OldList for NetWareIP bind is "$(OldList)

	ForListDo $(OldList)
		Set Item = $($)
		Ifstr(i) $(Item) != "ipxTransport NetWareIPDriver non non 100"
			Set NewList = >($(NewList), $(Item))
		endif
	EndForListDo

	Debug-Output "OEMNSVIP.INF:  NewList for NetWareIP bind is "$(NewList)

	SetRegValue $(RulesKey) {$(ValueName), $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewList)}
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		Debug-Ouput "OEMNSVIP.INF:  Can't update Bindable value for NetWareIP"
		set status = STATUS_FAILED
		goto ROB_Return
	Endif

	;
	; Close keys
	;

	CloseRegKey $(RulesKey)

ROB_Return = +
	Return $(Status)


;-----------------------------------------------------------------------
; LANGUAGES SUPPORTED
; -------------------
;
; The languages supported by the OEM INF, For every language supported
; we need to have a separate text section for every displayable text
; section.
;
;-----------------------------------------------------------------------

[LanguagesSupported]
	ENG, ENGLISH

[OptionsTextENG]
	NetWareIP	= "Novell NetWare/IP Support (NWIP)"

[FileConstantsENG]
	ProCaption		= "Windows NT Setup"
	ProCancel		= "Cance&l"
	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:"

	;
	; Producer Info
	;
	
	FunctionTitle								= "Novell NetWare/IP Setup"

	;
	; Software
	;
		
	ProductSoftwareTitle			= "Novell NetWare/IP Adapter Driver"
	ProductSoftwareDescription				= "Novell NetWare/IP Adapter Driver"
	
	;
	; Hardware
	;
	
	ProductHardwareNetWareIPTitle	= "Novell NetWare/IP Adapter"
	ProductHardwareNetWareIPDescription	= "Novell NetWare/IP Adapter"


[InstallOptionENG]
	ErrorMessageTitle = "NetWareIP Error"

	NoTcpipMessageText = "TCPIP Protocol is NOT installed.  NetWareIP will "+
		"not function correctly unless the TCPIP Protocol is reinstalled."

	NotConfiguredMessageText = "NetWareIP has not been configured and "+
		"will not function properly.  Please reconfigure NetWareIP Adapter"

	InstallTcpipMessageTitle = "Install TCPIP Protocol"

	InstallTcpipMessageText = "TCPIP Protocol is NOT installed.  NetWareIP "+
		"will not function correctly unless the TCPIP Protocol is installed.  "+
		"Install it now?"

	NetWareIPOnASMessageTitle = "NetWareIP Installation Error"

	NetWareIPOnASMessageText = "Novell NetWareIP is only supported with the "+
		"workstation versions of Microsoft Windows NT.  It is NOT supported "+
		"with the Advanced Server versions."

	NetWareIPInstalledMessage = "Novell NetWare/IP is already installed.  "+
		"Please remove it and then reboot before reinstalling."

	ShellCodeErrorTitle = "Error:  Novell NetWare/IP Adapter"

	ShellCodeErrorText = "Shell Code Error"

	LoadDisk3Text = "Please load the Novell NetWare Client for Windows NT "+
		"disk 3 into drive "


[Source Media Descriptions]
	1	= "Windows NT Setup Disk #1",				TAGFILE = disk1
	2	= "Windows NT Setup CD-ROM Disk",		TAGFILE = disk2
	3	= "NetWare for Windows NT Setup Disk",	TAGFILE = NWIP.SYS


[Files-Inf]
	3,	oemnsvip.inf,	SIZE=50000,	DECOMPRESS


[Files-NetWareIP]
	3,	nwip.sys,		SIZE=50000,	DECOMPRESS
