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

;
; The following is the version info for Novell
;

;VeRsIoN=v4.70 Novell Client Install for Windows NT (980409)
;CoPyRiGhT=copyright 1992-1998, by Novell, INC. All rights reserved.

[Identification]
	OptionType = NetService

[Options]
	NetWareIP

[FileConstants]
	UtilityInf		= "UTILITY.INF"
	InfName      	= "OEMNSVIP.INF"
	subroutineinf	= "SUBROUTN.INF"
	NwSubsInf		= "NWSUBS.INF"
	NwSetupDll	= "nwsetup.dll"
	SoftwareType	= "driver"
	Exit_Code		= 0
	DriverToLoad	= ""

	;
	; EventLog Message File
	;
	
	NetEventDLL	= "%SystemRoot%\System32\nls\"$(NLSDirName)"\nwevents.dll"
	IoLogMsgDLL	= "%SystemRoot%\System32\IoLogMsg.dll"
	
	;
	; Software
	;
	
	ProductNetWareIPName			= "NetWareIP"
	ProductNetWareIPImagePath	= "\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"
	ProductHardwareNetWareIPTitle	= "Novell NetWare/IP Adapter"
	NetRuleHardwareType				= "NetWareIP NetWareIPAdapter"
	NetRuleHardwareBindForm			= " yes yes container"
	NetRuleHardwareClass				= {"NetWareIPAdapter basic"}
	
	;
	; Registry Key
	;
	
	ProductKeyName	= $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductNetWareIPName)"\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	= 70
	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 = +

	;
	; This call checks the STF_ variables and sets the NWU variables.
	;

	Shell "" UnattendedInstallOption

	;
	; Get the data from the Unattended file.
	;

	ifstr(i) $(!NWUnattendedFile) != ""
		ifstr(i) $(!NWUnattendedSection) != ""
			Shell $(!NWUnattendedFile) ReadDefaultData, $(!NWUnattendedSection)
			ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
				Debug-Output "Shell to read the NW Parameter values from an Unattend.txt file Failed."

				Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "Warning", $(UnattendFileReadFailed)

				ifstr(i) $($R1) == "CANCEL"
					set CommonStatus = STATUS_USERCANCEL
					goto end
				endif
			endif
		endif
	endif

	ifstr(i) $(!NWUnattendedFile) != ""
		ifstr(i) $(!NWWizard) != YES
			Debug-OutPut "OEMNSVIP.INF: !DoRemove = "$(!DoRemove)
			ifstr(i) $(!DoRemove) == YES
				set !NTN_InstallMode = deinstall
			else-Ifstr(i) $(!DoInstall) == NO
				Debug-OutPut "OEMNSVIP.INF: !DoInstall = "$(!DoInstall)
				set CommonStatus = STATUS_SUCCESSFUL
				goto end
			endif
		endif		
	endif

	;
	; Call the CommonSection
	;

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

end = +
	goto term

term = +
	Return $(CommonStatus) $(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 "OEMNSVIP.INF:  Error getting NT version"
		endif
		CloseRegKey $(CurrentVersionKey)
	else
		Debug-Output "OEMNSVIP.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"

    ;
    ;   Must have the client installed first
    ;
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NetWareWorkStation" $(MAXIMUM_ALLOWED) KeyProduct
	ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)

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

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

		set CommonStatus = STATUS_USERCANCEL
		goto end
	endif

	CloseRegKey $(KeyProduct)

	;
	;	Check whether Compatibility Mode is installed
	;
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NWCMD" $(MAXIMUM_ALLOWED) KeyProduct
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)

		;
		; Cannot install NWIP while NWCMD is installed.
		;

		CloseRegKey $(KeyProduct)

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

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

		set CommonStatus = STATUS_USERCANCEL
		goto end
	endif

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\NwlnkIpx\CurrentVersion\NetRules" $(MAXIMUM_ALLOWED) RulesKey
	Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		;
		; Cannot install NWIP while no IPX is installed.
		;
		Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(NOIPXInstalledMessage)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
		endif
		set CommonStatus = STATUS_USERCANCEL
		goto end
	else
		CloseRegKey $(RulesKey)
	Endif

	;
	;	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, $(ProductNetWareIPDisplayName), $(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), +
			$(ProductNetWareIPName), +
			$(ProductNetWareIPName), +
			$(ProductNetWareIPDisplayName), +
			$(STF_CONTEXTINFNAME), +
			$(ProductNetWareIPImagePath), +
			"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),$(ProductNetWareIPDisplayName)},+
					{Description,$(NoTitle),$(!REG_VT_SZ),$(ProductNetWareIPDescription)},+
					{Review,$(NoTitle),$(!REG_VT_DWORD),1},+
					{PathName,$(NoTitle),$(!REG_VT_SZ),$(!STF_CWDDIR)},+
					{ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductNetWareIPName)},+
					{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),$(InfName)} }
		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),$(InfName)}}

		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"
		Debug-Output "OEMNSVIP.INF: Prompting user for parameters"
		StartWait
		LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\nwsetup.dll" NwLibHandle
		SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\"$(NLSDirName)"\setupnw.hlp" $(!MinimumID) $(!MaximumID)

		set HelpContext = $(IDH_NETWAREWRKSTATIONPARMS)

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

	;
	;       Install various registry parameters
	;
	Debug-Output "OEMNSVIP.INF:  Install-Parameters"
	Install Install-Parameters      

	;
	; Write out the unattended variables to registry
	;
	
	shell "" Write-Unattended-Variables

	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
	else-ifstr(i) $($R0) != STATUS_SUCCESSFUL
		Debug-Output "OEMNSVWM:  User Canceled due to a error processing the Unattended Variables."
		set CommonStatus = STATUS_USERCANCEL
		goto setfailed
	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)"\setupnw.hlp" $(!MinimumID) $(!MaximumID)
	set HelpContext = $(IDH_NETWAREWRKSTATIONPARMS)
	LibraryProcedure LibResult $(NwLibHandle) NWConfigure $(Option)
;	LibraryProcedure LibResult $(NwLibHandle) NWIPDialog
	
	Debug-Output "OEMNSVIP.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), $(ProductNetWareIPName)
			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), $(ProductNetWareIPName), $(!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 = +

	;
	;Check whether NWIP is installed
	;
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NetWareIP" $(MAXIMUM_ALLOWED) KeyProduct
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		Set DeleteFlagVal = 0
		GetRegValue $(KeyProduct) "DeleteFlag" ValueData
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			Set DeleteFlagVal = *($(ValueData), 4)
		endif
		CloseRegKey $(KeyProduct)

		Ifint $(DeleteFlagVal) == 1
			Debug-Output "OEMNSVIP.INF:  Updating, but NWIP will be deleted."
			goto end
		endif				
	else
		Debug-Output "OEMNSVIP.INF:  Updating, but NWIP is not installed."
		goto end
	endif

	Debug-Output "OEMNSVIP.INF:  Updating NetWareIP adapter"

	;
	; Check the current version.  Allow upgrade if current version is equal
	; to or greater than installed version.
	;
	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductNetWareIPName)"\CurrentVersion" $(MAXIMUM_ALLOWED) NWIPCurrVer
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		GetRegValue $(NWIPCurrVer) "MajorVersion" MajorVersionList
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set NWIPMajorVersion = *($(MajorVersionList), 4)
		endif
		GetRegValue $(CurrVer) "MinorVersion" MinorVersionList
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set NWIPMinorVersion = *($(MinorVersionList), 4)
		endif

		Debug-OutPut "Installed NWIP Major version is "$(NWIPMajorVersion)
		Debug-OutPut "Installed NWIP Minor version is "$(NWIPMinorVersion)

		ifint $(ProductMajorVersion) == $(NWIPMajorVersion)
			ifint $(ProductMinorVersion) >= $(NWIPMinorVersion)
				set CanUpgrade = "YES"
			endif
		else
			ifint $(ProductMajorVersion) > $(NWIPMajorVersion)
				set CanUpgrade = "YES"
			endif
		endif
		CloseRegKey $(NWIPCurrVer)
	Endif

	;
	; Check the upgrade flag to see if upgrade allowed.
	;

	ifstr(i) $(CanUpgrade) == "NO"
		Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(UpgradeButtonMessage)

		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
		endif
		set CommonStatus = STATUS_USERCANCEL
		goto end
	endif

	;
	; 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 = +

	;
	;       Install various registry parameters
	;

	Install Install-Parameters      

	;
	; Write out the unattended variables to registry
	;
	
	shell "" Write-Unattended-Variables

	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
	else-ifstr(i) $($R0) != STATUS_SUCCESSFUL
		Debug-Output "OEMNSVWM:  User Canceled due to a error processing the Unattended Variables."
		set CommonStatus = STATUS_USERCANCEL
		goto setfailed
	endif

	goto end


abandon = +
	Debug-Output "OEMNSVIP.INF: abandon"
	ForListDo $(OEM_ABANDON_OPTIONS)
		Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), $(ProductNetWareIPName), $($)
		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), $(ProductNetWareIPName), 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)

	;
	; Check to see if Remote Access is installed.  Remove its bindings to IPX in there.
	;
	Debug-Output "OEMNSVIP.INF:  Check to see if Remote Access is installed"

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\RemoteAccess\Linkage" $(MAXIMUM_ALLOWED) KeyRAS
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)

		GetRegValue $(KeyRAS) "Bind" ValueData
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			Set ValueList = *($(ValueData), 4)
			Set NewList = {}
			Set FindValue = "\Device\NwlnkIpx"

			Ifcontains(i) $(FindValue) in $(ValueList)
				ForListDo $(ValueList)
					Ifstr(i) $($) != $(FindValue)
						Set NewList = >($(NewList), $($))
					Endif
				EndForListDo
			
				SetRegValue $(KeyRAS) {"Bind", $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewList)}
				Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
					Debug-Output "OEMNSVIP.INF: Cant update Bind value for RAS"
				Endif
			Endif
		Endif

		GetRegValue $(KeyRAS) "Export" ValueData
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			Set ValueList = *($(ValueData), 4)
			Set NewList = {}
			Set FindValue = "\Device\RasServer\NwlnkIpx"

			Ifcontains(i) $(FindValue) in $(ValueList)
				ForListDo $(ValueList)
					Ifstr(i) $($) != $(FindValue)
						Set NewList = >($(NewList), $($))
					Endif
				EndForListDo
			
				SetRegValue $(KeyRAS) {"Export", $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewList)}
				Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
					Debug-Output "OEMNSVIP.INF: Cant update Export value for RAS"
				Endif
			Endif
		Endif

		GetRegValue $(KeyRAS) "Route" ValueData
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			Set ValueList = *($(ValueData), 4)
			Set NewList = {}
			Set FindValue = ""NwlnkIpx" "NdisWan6""

			Ifcontains(i) $(FindValue) in $(ValueList)
				ForListDo $(ValueList)
					Ifstr(i) $($) != $(FindValue)
						Set NewList = >($(NewList), $($))
					Endif
				EndForListDo
			
				SetRegValue $(KeyRAS) {"Route", $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewList)}
				Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
					Debug-Output "OEMNSVIP.INF: Cant update Route value for RAS"
				Endif
			Endif
		Endif

		CloseRegKey $(KeyRAS)
	Endif

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\RemoteAccess\CurrentVersion\NetRules" $(MAXIMUM_ALLOWED) KeyRAS
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)

		GetRegValue $(KeyRAS) "Bindable" ValueData
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			Set ValueList = *($(ValueData), 4)
			Set NewList = {}
			Set FindValue = "classRasServer ipxTransport non non 100"

			Ifcontains(i) $(FindValue) in $(ValueList)
				ForListDo $(ValueList)
					Ifstr(i) $($) != $(FindValue)
						Set NewList = >($(NewList), $($))
					Endif
				EndForListDo
			
				SetRegValue $(KeyRAS) {"Bindable", $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewList)}
				Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
					Debug-Output "OEMNSVIP.INF: Cant update Bindable value for RAS"
				Endif
			Endif
		Endif

		CloseRegKey $(KeyRAS)
	Endif

	OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards" $(MAXIMUM_ALLOWED) KeyNetcards
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		EnumRegKey $(KeyNetcards) NetcardsList
		Debug-Output "OEMNSVIP.INF: Netcards before RAS remove: "$(NetcardsList)
		ForListDo $(NetcardsList)
			set KeyName = *($($),1)
			OpenRegKey $(KeyNetcards) "" $(KeyName) $(MAXIMUM_ALLOWED) Card
			Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
				GetRegValue $(Card), "ProductName" ProductNameInfo
				set CardProductName = *($(ProductNameInfo), 4)
				Debug-Output "OEMNSVIP.INF: checking net card: "$(CardProductName)
				ifstr(i) $(CardProductName) == "NdisWanDialinoutIpx"
					Debug-Output "OEMNSVIP.INF: NdisWanDialinoutIpx Netcard found"
					GetRegValue $(Card), "ServiceName" ServiceNameInfo
					Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
						set CardServiceName = *($(ServiceNameInfo), 4)
						Debug-Output "OEMNSVIP.INF: Found Netcard service: "$(CardServiceName)
						OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase) $(MAXIMUM_ALLOWED) ServiceKey
						Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
							DeleteRegTree $(ServiceKey) $(CardServiceName)
							Debug-Output "OEMNSVIP.INF: Deleted Netcard service: "$(CardServiceName)
							CloseRegKey $(ServiceKey)
						endif
					endif
			 
					CloseRegKey $(Card)
				
					DeleteRegTree $(KeyNetcards) $(KeyName)
					Debug-Output "OEMNSVIP.INF: Deleted Netcard : "$(KeyName)
				else
					CloseRegKey $(Card)
				endif
			else
				Debug-Output "OEMNSVIP.INF: Error opening Netcard: "$(KeyName)
			endif
		EndForListDo

		CloseRegKey $(KeyNetcards)
	Endif

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)


;-----------------------------------------------------------------------
;
;               SECTION:        Install-Parameters
;
;               PURPOSE:        Called at install or update to add
;                                       various parameters to the registry
;
;               ARGUMENTS:      None
;                                       
;               RETURNS:        None
;
;               REFERENCES:     None
;
;               MODIFIES:       None
;
;-----------------------------------------------------------------------
[Install-Parameters]

	;
	; HKEY_LOCAL_MACHINE\Software\Novell\NetWareIP\CurrentVersion
	;

	set TempKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\NetWareIP\CurrentVersion"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		;
		;	Set internal versions
		;
		set HaveInternalVersion = YES
		ifint $(!MajorInternalVersion) == 0
			ifint $(!MinorInternalVersion) == 0
				set HaveInternalVersion = NO
			endif
		endif
			
		ifstr(i) $(HaveInternalVersion) == NO
			DeleteRegValue $(TempKey) "MajorInternalVersion"
			DeleteRegValue $(TempKey) "MinorInternalVersion"
		else
			SetRegValue $(TempKey) {"MajorInternalVersion", $(NoTitle), $(!REG_VT_DWORD), $(!MajorInternalVersion)}
			Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
				Debug-Output "OEMNSVIP.INF:  Unable to update MajorInternalVersion value in "$(TempKeyName)
			endif

			SetRegValue $(TempKey) {"MinorInternalVersion", $(NoTitle), $(!REG_VT_DWORD), $(!MinorInternalVersion)}
			Ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
				Debug-Output "OEMNSVIP.INF:  Unable to update MinorInternalVersion value in "$(TempKeyName)
			endif
		endif

        CloseRegKey $(TempKey)
	endif

	Exit

;-----------------------------------------------------------------------
;
;
;		SECTION:		UnattendedInstallOption:
;
;		PURPOSE:		This section is shelled to by the Install Option.  It looks at the three MS Unattended variables and then
;		sets the Novell specific variable for NWACU and the NWUnattended file.
;		Our install for both setup.exe /ACU and Unattended install from MS then uses NWACU and the NWUnattended variables.
;
;		ARGUMENTS:	None
;
;		RETURNS:		None
;
;		REFERENCES:	None
;
;		MODIFIES:	None
;
;-----------------------------------------------------------------------
[UnattendedInstallOption]

	read-syms GeneralConstants
	read-syms FileConstants

	ifstr(i) $(!STF_GUI_UNATTENDED) == "NO"
		ifstr(i) $(!STF_UNATTENDED) == "YES"
			set !NWACU = "YES"
		endif
	else-ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
		ifstr(i) $(!NWUnattendedFile) == ""
			set !NWACU = "YES"
			set !NWUnattendedFile = $(!STF_UNATTENDED)
			set !NWUnattendedSection = $(!STF_UNATTENDED_SECTION)
		else-ifstr(i) $(!STF_UNATTENDED_SECTION) != ""
			set !NWUnattendedSection = $(!STF_UNATTENDED_SECTION)
			Debug-OutPut "OEMNSVIP.INF: stf_gui in unattended = "$(!STF_GUI_UNATTENDED)
		endif
	endif

Return


;*************************************************************************
;----------Write-Unattended-Variables-----------------------------------
;
;
;		SECTION:		Write-Unattended-Variables:
;
;		PURPOSE:		This section writes the unattended variables to the
;						registry.
;
;		ARGUMENTS:	None
;
;		RETURNS:		None
;
;		REFERENCES:	Called at end of install section and the update section
;
;		MODIFIES:	None
;
;*************************************************************************
[Write-Unattended-Variables]
	read-syms GeneralConstants
	read-syms FileConstants
	read-syms InstallOption$(!STF_LANGUAGE)

	Debug-Output "OEMNSVIP.INF:  Write-Unattended-Variables"

	;	If the /U parameter is passed from Setupnw.exe then call this section to set the defaults.
	;	Add the values in the unattended file to the registry.
	set UnattendReturnStatus = STATUS_SUCCESSFUL

	ifstr(i) $(!NWUnattendedFile) != ""
		Debug-Output "OEMNSVIP.INF:  !NWUnattendedFile = "$(!NWUnattendedFile)
		LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\"$(NwSetupDll) NwLibHandle
		SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\"$(!P:NLSDirName)"\nt4setup.hlp" $(!MinimumID) $(!MaximumID)

		LibraryProcedure LibResult $(NwLibHandle) NWUnattendedInstall $(!NWUnattendedFile) $(!P:Option)

		FreeLibrary $(NwLibHandle)
	endif

Return $(UnattendReturnStatus)

;-----------------------------------------------------------------------
; 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
	;

	ProductNetWareIPDisplayName	=  "Novell NetWare/IP Adapter Driver"
	ProductNetWareIPDescription	=  "NetWare/IP routes Novell client traffic through the IP protocol."
	
	;
	; Hardware
	;
	
	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 "

	NWCMDInstalledMessage = "Cannot install NetWare/IP while Compatibility Mode is installed."

	NOIPXInstalledMessage = "This workstation is configured with IPX not installed.  To install NetWare/IP, "+
		"first install IPX."

	UpgradeButtonMessage = "The NetWare/IP version you are installing is older "+
		"than the one that is currently installed.  You must remove it "+
		"and then reboot before installing an older version."

	NetWareClientNotInstalledMessage = "You must install the Novell Client for Windows NT before this product can be installed."


[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
