;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;
;
; OEMNXPGW.INF
;
;               Novell IP Gateway INF file.
;
;
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;
; The following is the version info for Novell
;

;VeRsIoN=v4.70 Novell IP Gateway Install for Windows NT (971023)
;CoPyRiGhT=copyright 1998, by Novell, INC. All rights reserved.

[Identification]
	OptionType = NetTransport

[Options]
	CPROXY

[FileConstants]
	;
	;  File names, etc.
	;
	
	UtilityInf              = "UTILITY.INF"
	subroutineinf   = "SUBROUTN.INF"
	NwSubsInf               = "NWSUBS.INF"
	NwLangIdDll             = "NWLANGID.DLL"
	NwSetupDll              = "nwsetup.dll"
	SoftwareType    = "transport"
	Exit_Code               = 0
	
	;
	; Product Info
	;
	
	Manufacturer                    = "Novell"
	UserModeRoot                    = "%SystemRoot%"
	System32Root                    = $(UserModeRoot)"\System32"
	SoftwareBinHome                 = $(System32Root)"\NetWare\"
	DriverBinHome                   = $(System32Root)"\Drivers\"
	NetWareEventFile                = $(System32Root)"\nls\"$(NLSDirName)"\nwevents.dll"
	
	;
	; Services
	;
	
	;
	; CPROXY: IP Gateway Client
	;
	
	ProductCPROXYControl                    = component
	ProductCPROXYHidden                             = 0
	ProductCPROXYReviewBindings             = 1
	ProductCPROXYInstrumentation    = TRUE
	ProductCPROXYName                       = "CPROXY"
	ProductCPROXYImagePath                  = $(SoftwareBinHome)cproxynt.sys
	ProductCPROXYSvcType                    = "systemauto"
	ProductCPROXYSoftType                   = "transport"
	ProductCPROXYGroup                      = "NetWare IP Gateway"
	ProductCPROXYDependList                 = {"GCFWMAP"}
	ProductCPROXYEventFile                  = $(NetWareEventFile)
	ProductCPROXYKeySoftware                = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductCPROXYName)"\CurrentVersion"
	
	;
	; CFWNTSYS: IP Gateway Component
	;
	
	ProductCFWNTSYSControl                  = component
	ProductCFWNTSYSHidden                   = 1
	ProductCFWNTSYSInstrumentation  = TRUE
	ProductCFWNTSYSName                     = "CFWNTSYS"
	ProductCFWNTSYSImagePath                = $(SoftwareBinHome)cfwntsys.sys
	ProductCFWNTSYSSvcType                  = "systemauto"
	ProductCFWNTSYSGroup                    = "NetWare Services"
	ProductCFWNTSYSDependList               = {"ResMgr"}
	ProductCFWNTSYSEventFile                = $(NetWareEventFile)

	;
	; GCFWMAP: IP Gateway TDI Mapper
	;
	
	ProductGCFWMAPControl                   = component
	ProductGCFWMAPHidden                    = 1
	ProductGCFWMAPInstrumentation   = TRUE
	ProductGCFWMAPName                      = "GCFWMAP"
	ProductGCFWMAPImagePath                 = $(SoftwareBinHome)gcfwmap.sys
	ProductGCFWMAPSvcType                   = "systemauto"
	ProductGCFWMAPGroup                     = "NetWare IP Gateway"
	ProductGCFWMAPDependList                = {"Tcpip", "Nwtcp"}
	ProductGCFWMAPEventFile                 = $(NetWareEventFile)

	;
	; NWTcp: TCP/IPX Driver
	;
	
	ProductNWTCPControl                     = component
	ProductNWTCPHidden                      = 1
	ProductNWTCPInstrumentation             = TRUE
	ProductNWTCPName                        = "NWTcp"
	ProductNWTCPImagePath                   = $(SoftwareBinHome)nwtcp.sys
	ProductNWTCPSvcType                     = "kernelautostart"
	ProductNWTCPGroup                       = "NetWare IP Gateway"
	ProductNWTCPDependList                  = {"NwlnkIpx", "+NetWare Services", "+TDI"}
	ProductNWTCPEventFile                   = $(NetWareEventFile)
	
	;
	; Registry key names
	;
	
	ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductCPROXYName)"\CurrentVersion"
	ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductCPROXYName)"\Parameters"
	
	ServiceNameList                         = ^(ServiceNames, 1)
	UpdateServiceNameList           = ^(UpdateServiceNames, 1)
	ServiceNameListIPX                      = ^(ServiceNamesIPX, 1)


[ServiceNames]
	;
	; referenced by ServiceNameList
	;
	SVC_1           = "CPROXY"
	SVC_2           = "CFWNTSYS"
	SVC_3           = "GCFWMAP"
	SVC_4           = "NWTCP"

[ServiceNamesIPX]
	;
	; referenced by ServiceNameListIPX
	;
	SVC_1           = "NWTCP"

[UpdateServiceNames]
	;
	; referenced by UpdateRoutine
	;
	SVC_1           = "CPROXY"
	SVC_2           = "CFWNTSYS"
	SVC_3           = "GCFWMAP"
	SVC_4           = "NWTCP"



[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"
	
	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 !G:DebugOutputControl = 0

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

	set OriginalAddCopy             = $($3)
	set OriginalDoCopy              = $($4)
	set OriginalDoConfig    = $($5)

	Debug-OutPut "OEMNXPGW.INF: Option = "$($Option)
	Debug-OutPut "OEMNXPGW.INF: SrcDir = "$($SrcDir)
	Debug-OutPut "OEMNXPGW.INF: AddCopy = "$($AddCopy)
	Debug-OutPut "OEMNXPGW.INF: DoCopy = "$($DoCopy)
	Debug-OutPut "OEMNXPGW.INF: DoConfig = "$($DoConfig)

	set-subst LF = "\n"
	read-syms GeneralConstants
	read-syms FileConstants
	read-syms FileConstants$(!STF_LANGUAGE)
	read-syms InstallOption$(!STF_LANGUAGE)
	detect date

	;
	; Check if the language requested is supported
	;

	set LanguageList = ^(LanguagesSupported, 1)
	Ifcontains(i) $($0) in $(LanguageList)
		goto installoption
	else
		Debug-OutPut "OEMNXPGW.INF: Language not supported"
		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 "OEMNXPGW.INF: !DoRemove = "$(!DoRemove)
			ifstr(i) $(!DoRemove) == YES
				set !NTN_InstallMode = deinstall
			else-Ifstr(i) $(!DoInstall) == NO
				Debug-OutPut "OEMNXPGW.INF: !DoInstall = "$(!DoInstall)
				set CommonStatus = STATUS_SUCCESSFUL
				goto end
			endif
		endif		
	endif

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

	;
	; Find what NLS directory is being used
	;

	set NovellParameters = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\Parameters"
	Debug-OutPut "OEMNXPGW.INF: 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 "OEMNXPGW.INF: Windows NT current version is "$(VersionListData)
			Debug-OutPut "OEMNXPGW.INF: Windows NT Major version is "$(NTMajorVersion)
			Debug-OutPut "OEMNXPGW.INF: Windows NT Minor version is "$(NTMinorVersion)
		else
			Debug-Output "OEMNXPGW.INF:  Error getting NT version"
		endif
		CloseRegKey $(CurrentVersionKey)
	else
		Debug-Output "OEMNXPGW.INF:  Error opening "$(CurrentVersion)
	endif

	;
	; Is this an Advanced Server
	;

	Debug-Output "OEMNXPGW.INF:  Checking to see if advanced server"
	set AdvancedServer = "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)
			set AdvancedServer = "YES"
			ifstr(i) $(ValueListData) == "WinNT"
				set AdvancedServer = "NO"
				Debug-Output "OEMNXPGW.INF:  AdvancedServer is "$(AdvancedServer)
			endif
		else
			Debug-Output "OEMNXPGW.INF:  Failed to get ProductType"
		endif
		CloseRegKey $(TempKey)
	else
		Debug-Output "OEMNXPGW.INF:  Failed to open ProductOptions key"
	endif

	set ProtocolsListData = ""
	set TempKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\Parameters"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		GetRegValue $(TempKey) "Protocols" ProtocolsList
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set ProtocolsListData = *($(ProtocolsList), 4)
		endif
	CloseRegKey $(TempKey)
	endif

	set DO_NWLINK = YES
	set DO_TCPIP  = YES
	Debug-Output "OEMNXPGW.INF:  ProtocolsListData = "$(ProtocolsListData)
	ifstr(i) $(ProtocolsListData) != ""
		ifstr(i) $(ProtocolsListData) == "IPNOCM"
			set DO_NWLINK = NO
		else-ifstr(i) $(ProtocolsListData) == "IPX"
			set DO_TCPIP = NO
		endif
	endif

	ifstr(i) $(DO_NWLINK) != "YES"
;               IP-only
		set	ProductGCFWMAPDependList = {"Tcpip"}
	else-ifstr(i) $(DO_TCPIP) == "NO"
;               IPX-only
		set	ProductGCFWMAPDependList = {"NWTcp"}
	endif

	set-title       $(FunctionTitle)
	set to  = Begin
	set from = Begin
	set CommonStatus = STATUS_SUCCESSFUL
	EndWait

Begin = +
	Debug-Output "OEMNXPGW.INF: Begin Install Mode = "$(!NTN_InstallMode)
	Ifstr(i) $(!NTN_InstallMode) == deinstall
		set StartLabel = removegateway
	else-Ifstr(i) $(!NTN_InstallMode) == Update
		set StartLabel = updategateway
	else-Ifstr(i) $(!NTN_InstallMode) == bind
		set StartLabel = bindgateway
	else-Ifstr(i) $(!NTN_InstallMode) == configure
		set StartLabel = configuregateway

;               Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
;                       Debug-Output "OEMNXPGW.INF:  Can't configure the Novell IP Gateway software."
;                       Shell $(UtilityInf), RegistryErrorString, CANNOT_CONFIGURE_SOFTWARE
;                       ifint $($ShellCode) != $(!SHELL_CODE_OK)
;                               Debug-Output "OEMNXPGW.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 = installgateway
		set OEM_ABANDON_OPTIONS = {}
		set OEM_ABANDON_SOFTWARE = FALSE
		set OEM_ABANDON_ON = TRUE

		;
		;  Turn on all the options.
		;

		ForListDo $(ServiceNameList)
			Set Do$($) = TRUE
		EndForListDo
	endif
	set from = $(fatal)
	set to = $(fatal)
	goto $(StartLabel)


;******************************************
;
;       Install the IP Gateway
;
;******************************************
installgateway = +

	set TempKeyName = $(!NTN_ServiceBase)"\CPROXY"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
               GetRegValue $(TempKey) "DeleteFlag" ValueData
	       Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
	               Set DeleteFlagVal = *($(ValueData), 4)
	               Ifint $(DeleteFlagVal) == 1
				Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(MustRebootMessage)

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

				set CommonStatus = STATUS_USERCANCEL
				goto end
			Endif
		Endif

		CloseRegKey $(TempKey)
	Endif

	Debug-Output "OEMNXPGW.INF:  Installing IP Gateway"

	set AddCopy     = "YES"
	set DoCopy      = "YES"

	Ifstr(i) $(DoCopy) == "YES"

AskSourceAgain = +
		;
		;  Get source location
		;

		Shell "", DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
	
		Ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Goto ShellCodeError
		Else-Ifstr(i) $($R0) == STATUS_FAILED
			Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
			ifint $($ShellCode) != $(!SHELL_CODE_OK)
				goto ShellCodeError
			endif
			set Error = $($R0)
			Goto fatal
		Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
			Goto end
		Endif
	
		Set SrcDir = $($R1)
	
		LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcDir)
	
		ifstr(i) $(STATUS) != "ERROR"
			set SrcDir = $(STATUS)
		Endif

		LibraryProcedure Status1, $(!LIBHANDLE), CheckFileExistance, $(SrcDir)nls\$(NLSDirName)"\oemnxpgw.inf"
		ifstr(i) $(Status1) != "YES"
			goto AskSourceAgain
		endif
	Endif


	set OEM_ABANDON_ON  = TRUE

	StartWait

	;
	; Create file directories
	;

	install "Install-Dirs"

	;
	; Copy all files to destination
	;

	install "Install-Files"
	ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
		Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
		endif
		set Error = $($R0)
		goto fatal
	endif

	set AddCopy = $(OriginalAddCopy)
	set DoCopy = $(OriginalDoCopy)

	StartWait

	;
	;  Install all enabled services mentioned in the ServiceNameList
	;

InstallEnabledServices = +

	ForListDo  $(ServiceNameList)
		Set SvcOpt = $($)
		;
		; Check to see if the product to be installed is already installed
		;

		Set TempProductKeyName = $(!NTN_ServiceBase)"\"$(Product$(SvcOpt)Name)
		OpenRegKey $(!REG_H_LOCAL) "" $(TempProductKeyName) $(MAXIMUM_ALLOWED) TempKey
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNXPGW.INF:  "$(SvcOpt)" is already installed"
			Set Do$(SvcOpt) = FALSE
		Endif

		ifstr(i) $(DO_NWLINK) != "YES"
			Ifcontains(i) $(SvcOpt) in $(ServiceNameListIPX)
				goto skipservice
			endif
		endif
	
		Ifstr(i) $(Do$(SvcOpt)) == TRUE
			Ifstr(i) $(Product$(SvcOpt)Control) == component
				Debug-Output "OEMNXPGW.INF: install component: "$(SvcOpt)
				Shell $(UtilityInf), AddSoftwareComponent +
					$(Manufacturer), +
					$(Product$(SvcOpt)Name), +
					$(Product$(SvcOpt)Name), +
					$(Product$(SvcOpt)DisplayName), +
					"oemnxpgw.inf", +
					$(Product$(SvcOpt)ImagePath), +
					$(Product$(SvcOpt)SvcType), +
					$(Product$(SvcOpt)Group), +
					$(Product$(SvcOpt)DependList), "" +
					$(Product$(SvcOpt)EventFile), "", "", 1
	
				Ifint $($ShellCode) != $(!SHELL_CODE_OK)
					Debug-Output "OEMNXPGW.INF: AddSoftwareComponent ShellCode error "$($ShellCode)" installing "$(SvcOpt)
					EndWait
					goto ShellCodeError
				Endif
				StartWait
	
				Set RegistryErrorIndex = $($R0)
	
				Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
					EndWait
					CloseRegKey $($R1)
					CloseRegKey $($R2)
					CloseRegKey $($R3)
					Debug-Output "OEMNXPGW.INF: Registry error "$(RegistryErrorIndex)" installing "$(SvcOpt)
					EndWait
					goto fatalregistry
				Endif
	
				Set SvcVersion          = $($R1)
				Set SvcNetRules = $($R2)
				Set SvcSvcKey           = $($R3)
				Set SvcParamKey = $($R4)
				Set SvcLinkKey          = $($R5)

				ifint $(Product$(SvcOpt)ReviewBindings) == 1
					Set ReviewBindingsValue = 1
				else
					Set ReviewBindingsValue = 0
				Endif

				Set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(Product$(SvcOpt)SoftType)},+
						{Hidden,$(NoTitle),$(!REG_VT_DWORD),$(Product$(SvcOpt)Hidden)},+
						{Review,$(NoTitle),$(!REG_VT_DWORD),$(ReviewBindingsValue)},+
						{MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
						{MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
						{Title,$(NoTitle),$(!REG_VT_SZ),$(Product$(SvcOpt)DisplayName)},+
						{Description,$(NoTitle),$(!REG_VT_SZ),$(Product$(SvcOpt)DisplayName)},+
						{ServiceName,$(NoTitle),$(!REG_VT_SZ),$(Product$(SvcOpt)Name)},+
						{InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
		
				Shell  $(UtilityInf), AddValueList, $(SvcVersion), $(NewValueList)
				StartWait
				Ifint $($ShellCode) != $(!SHELL_CODE_OK)
					Debug-Output "OEMNXPGW.INF: ShellCode error: AddValueList for version info for "$(SvcOpt)
					EndWait
					goto ShellCodeError
				Endif
	
				;
				;  Add the NetRules info
				;

				Set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(SvcOpt)SoftwareType)},+
						{class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRule$(SvcOpt)SoftwareClass)}, +
						{bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRule$(SvcOpt)SoftwareBindable)}, +
						{use,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(SvcOpt)SoftwareUse)}, +
						{bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRule$(SvcOpt)SoftwareBindForm)}, +
						{InfOption,$(NoTitle),$(!REG_VT_SZ),$(SvcOpt)}}
		
				Shell  $(UtilityInf), AddValueList, $(SvcNetRules), $(NewValueList)
				StartWait
				Ifint $($ShellCode) != $(!SHELL_CODE_OK)
					Debug-Output "OEMNXPGW.INF: AddValueList ShellCode error = "$($ShellCode)
					EndWait
					Goto ShellCodeError
				Endif
				Set RegistryErrorIndex = $($R0)
		
				Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
					CloseRegKey $(SvcSvcKey)
					CloseRegKey $(SvcParamKey)
					CloseRegKey $(SvcLinkKey)
					CloseRegKey $(SvcVersion)
					CloseRegKey $(SvcNetRules)
					Debug-Output "OEMNXPGW.INF: Registry error adding NetRules to "$(SvcOpt)
					EndWait
					goto fatalregistry
				Endif
	
			Else
				Debug-Output "OEMNXPGW.INF: install service: "$(SvcOpt)
	
				Shell $(UtilityInf), CreateService, +
					$(Product$(SvcOpt)Name), +
					$(Product$(SvcOpt)DisplayName), +
					$(Product$(SvcOpt)ImagePath), +
					$(Product$(SvcOpt)SvcType), +
					$(Product$(SvcOpt)Group), +
					$(Product$(SvcOpt)DependList), "" +
					$(Product$(SvcOpt)EventFile), "", "", 1
		
				StartWait
				Ifint $($ShellCode) != $(!SHELL_CODE_OK)
					Debug-Output "OEMNXPGW.INF: ShellCode error installing "$(SvcOpt)
					EndWait
					goto ShellCodeError
				Endif
	
				Set RegistryErrorIndex = $($R0)
		
				Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
					CloseRegKey $($R1)
					CloseRegKey $($R2)
					CloseRegKey $($R3)
					Debug-Output "OEMNXPGW.INF: Registry error installing "$(SvcOpt)
					EndWait
					goto fatalregistry
				Endif
		
				Set SvcVersion          = ""
				Set SvcNetRules = ""
				Set SvcSvcKey           = $($R1)
				Set SvcParamKey = $($R2)
				Set SvcLinkKey          = $($R3)
			Endif

			;
			; Add the NetWare Instrumentation Level.
			;
	
			Ifstr(i) $(Product$(SvcOpt)Instrumentation) == TRUE
				SetRegValue $(SvcParamKey) {"Instrumentation Level",$(NoTitle),$(!REG_VT_SZ),"NONE"}
			Endif

			;
			;  Call the service-specific installation section
			;

			Shell "" FinishInstalling-$(SvcOpt) +
				$(SvcSvcKey) $(SvcParamKey) $(SvcLinkKey) +
				$(SvcVersion) $(SvcNetRules) $(TransportSelected)
	
			StartWait
	
			Ifstr(i) $(SvcVersion) != ""
				CloseRegKey $(SvcVersion)
			Endif
			Ifstr(i) $(SvcNetRules) != ""
				CloseRegKey $(SvcNetRules)
			Endif
	
			CloseRegKey $(SvcSvcKey)
			CloseRegKey $(SvcParamKey)
			CloseRegKey $(SvcLinkKey)

			;
			;  Add this service to the list of "undoable" things in case of failure
			;

			Set OEM_ABANDON_SERVICES = >($(OEM_ABANDON_SERVICES), $(Product$(SvcOpt)Name))
		Endif
skipservice = +
	EndForListDo

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

	;
	;       Install Winsock parameters
	;

	Shell "" Install-Winsock
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
	endif

	;
	;       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 "OEMNXPGW:  User Canceled due to a error processing the Unattended Variables."
		set CommonStatus = STATUS_USERCANCEL
		goto setfailed
	endif

	goto end


;******************************************
;
;       Configure the IP Gateway
;
;******************************************
configuregateway = +
	Debug-Output "OEMNXPGW.INF:  Configuring IP Gateway"
	set CommonStatus = STATUS_USERCANCEL

	set OldEnabled = 0
	set NewEnabled = 0

	set CProxyParameters = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\CProxy"
	Debug-OutPut "OEMNXPGW.INF: CProxyParameters is "$(NovellParameters)
	OpenRegKey $(!REG_H_LOCAL) "" $(CProxyParameters) $(MAXIMUM_ALLOWED) KeyCProxyParameters
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		GetRegValue $(KeyCProxyParameters) "Enabled" EnabledList
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set OldEnabled = *($(EnabledList), 4)
			Debug-OutPut "OEMNXPGW.INF: OldEnabled = "$(OldEnabled)
		endif
		CloseRegKey $(KeyCProxyParameters)
	Endif

	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)
	
	Debug-Output "OEMNXPGW.INF:  dialog returned "$(LibResult)

	set CProxyParameters = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\CProxy"
	Debug-OutPut "OEMNXPGW.INF: CProxyParameters is "$(NovellParameters)
	OpenRegKey $(!REG_H_LOCAL) "" $(CProxyParameters) $(MAXIMUM_ALLOWED) KeyCProxyParameters
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		GetRegValue $(KeyCProxyParameters) "Enabled" EnabledList
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set NewEnabled = *($(EnabledList), 4)
			Debug-OutPut "OEMNXPGW.INF: NewEnabled = "$(NewEnabled)
		endif
		CloseRegKey $(KeyCProxyParameters)
	Endif

	;
	;       Register/Unregister Winsock based on the enabled flag
	;
	ifint $(OldEnabled) != $(NewEnabled)
		ifint $(NewEnabled) == 1
			Debug-OutPut "OEMNXPGW.INF: Installing Winsock due to change in configuration"
			Shell "" Install-Winsock
			ifint $($ShellCode) != $(!SHELL_CODE_OK)
				goto ShellCodeError
			endif
		else
			Debug-OutPut "OEMNXPGW.INF: Removing Winsock due to change in configuration"
			Shell "" Remove-Winsock
			ifint $($ShellCode) != $(!SHELL_CODE_OK)
				goto ShellCodeError
			endif
		endif                   
	endif
	
	FreeLibrary $(NwLibHandle)
	goto end
	

;******************************************
;
;       Review bindings for the IP Gateway
;
;******************************************
bindgateway = +
	Debug-Output "OEMNXPGW.INF:  Binding IP Gateway"

	goto end


;******************************************
;
;       Remove the IP Gateway
;
;******************************************
removegateway = +
	Debug-Output "OEMNXPGW.INF:  Removing IP Gateway"

	set OldEnabled = 0

	set CProxyParameters = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\CProxy"
	Debug-OutPut "OEMNXPGW.INF: CProxyParameters is "$(NovellParameters)
	OpenRegKey $(!REG_H_LOCAL) "" $(CProxyParameters) $(MAXIMUM_ALLOWED) KeyCProxyParameters
	ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		GetRegValue $(KeyCProxyParameters) "Enabled" EnabledList
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			set OldEnabled = *($(EnabledList), 4)
			Debug-OutPut "OEMNXPGW.INF: OldEnabled = "$(OldEnabled)
		endif
		CloseRegKey $(KeyCProxyParameters)
	Endif

	ForListDo  $(ServiceNameList)
		Set SvcOpt = $($)
		Ifstr(i) $(Product$(SvcOpt)Control) == component
			Debug-Output "OEMNXPGW.INF: remove component: "$(SvcOpt)

		    Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer),  $(Product$(SvcOpt)Name)

			Ifint $($ShellCode) != $(!SHELL_CODE_OK)
				Debug-Output "OEMNXPGW.INF: RemoveSoftwareComponent ShellCode error "$($ShellCode)" removing "$(SvcOpt)
				EndWait
				goto ShellCodeError
			Endif
		Else
			Debug-Output "OEMNXPGW.INF: remove service: "$(SvcOpt)

			Shell $(UtilityInf), RemoveService, $(Product$(SvcOpt)Name), YES

			Ifint $($ShellCode) != $(!SHELL_CODE_OK)
				Debug-Output "OEMNXPGW.INF: ShellCode error removing "$(SvcOpt)
				EndWait
				goto ShellCodeError
			Endif

		Endif

	EndForListDo


	LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\"$(NwSetupDll) NwLibHandle

	Debug-Output "OEMNXPGW.INF:  Deleting all our IP Gateway files"

	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\winping.exe"
	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\cfwntdll.dll"

	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\netware\cfwntsys.sys"
	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\netware\gcfwmap.sys"
	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\netware\cproxynt.sys"
	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\netware\nwtcp.sys"
	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\netware\gwspdll.dll"
	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\netware\gwclient.exe"
	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\netware\nwws2gw.dll"
	LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\netware\winping.exe"

	FreeLibrary $(NwLibHandle)

	ifint $(OldEnabled) == 1
		;
		;       Remove Winsock parameters
		;
		Shell "" Remove-Winsock
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
		endif
	endif

	Install Remove-Icons

	goto end

;******************************************
;
;       Update the IP Gateway
;
;******************************************
updategateway = +
	Debug-Output "OEMNXPGW.INF:  Updating IP Gateway"

	set AddCopy     = "YES"
	set DoCopy      = "YES"

	Ifstr(i) $(DoCopy) == "YES"

AskSourceAgain2 = +
		;
		;  Get source location
		;

		set OldSTF_SRCDIR_OVERRIDE = $(!STF_SRCDIR_OVERRIDE)
		set !STF_SRCDIR_OVERRIDE = $(SrcDir)

		Shell "", DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
	
		Ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Goto ShellCodeError
		Else-Ifstr(i) $($R0) == STATUS_FAILED
			Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
			ifint $($ShellCode) != $(!SHELL_CODE_OK)
				goto ShellCodeError
			endif
			set Error = $($R0)
			Goto fatal
		Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
			Goto end
		Endif
	
		Set SrcDir = $($R1)
	
		LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcDir)
	
		ifstr(i) $(STATUS) != "ERROR"
			set SrcDir = $(STATUS)
		Endif

		LibraryProcedure Status1, $(!LIBHANDLE), CheckFileExistance, $(SrcDir)nls\$(NLSDirName)"\oemnxpgw.inf"
		ifstr(i) $(Status1) != "YES"
			goto AskSourceAgain2
		endif
	Endif

	;
	; Create destination directories
	;

	install "Install-Dirs"

	;
	; Copy all files to destination
	;

	Install "Install-Files"
	ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
		Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			goto ShellCodeError
		endif
		set Error = $($R0)
		goto fatal
	endif

	ForListDo $(UpdateServiceNameList)
		Set UpdateSvcOpt = $($)

		;
		; Check to see if the product to be fixed is there
		;

		Set ProductKeyName = $(!NTN_ServiceBase)"\"$(Product$(UpdateSvcOpt)Name)
		OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) ProductKey
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNXPGW.INF:  "$(UpdateSvcOpt)" is installed, fix it up"

			;
			; Update the product software information
			;

			Set TempKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(Product$(UpdateSvcOpt)Name)"\CurrentVersion"
			OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
			ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)

				;
				; Set the new major version number
				;

				SetRegValue $(TempKey) {"MajorVersion", $(NoTitle), $(!REG_VT_DWORD), $(ProductMajorVersion)}
				ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
					Debug-Output "OEMNXPGW.INF:  Failed to set new major version info for "$(UpdateSvcOpt)
				endif

				;
				; Set the new minor version number
				;

				SetRegValue $(TempKey) {"MinorVersion", $(NoTitle), $(!REG_VT_DWORD), $(ProductMinorVersion)}
				ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
					Debug-Output "OEMNXPGW.INF:  Failed to set new minor version info for "$(UpdateSvcOpt)
				endif

				;
				; Set the new description and title
				;

				SetRegValue $(TempKey) {"Description", $(NoTitle), $(!REG_VT_SZ), $(Product$(UpdateSvcOpt)DisplayName)}
				ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
					Debug-Output "OEMNXPGW.INF:  Failed to update Description for "$(UpdateSvcOpt)
				endif

				SetRegValue $(TempKey) {"Title", $(NoTitle), $(!REG_VT_SZ), $(Product$(UpdateSvcOpt)DisplayName)}
				ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
					Debug-Output "OEMNXPGW.INF:  Failed to update Title for "$(UpdateSvcOpt)
				endif

				;
				; Close the key
				;

				CloseRegKey $(TempKey)
			else
				Debug-Output "OEMNXPGW.INF:  Failed to open key "$(TempKeyName)
			endif

			;
			; Fix the display name
			;

			SetRegValue $(ProductKey) {"DisplayName", $(NoTitle), $(!REG_VT_SZ), $(Product$(UpdateSvcOpt)DisplayName)}
			ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
				Debug-Output "OEMNXPGW.INF:  Failed to update DisplayName for "$(UpdateSvcOpt)
			endif

			;
			; Close the first key
			;

			CloseRegKey $(ProductKey)

		endif

	EndForListDo

	;
	; Set up to install any services that were not part of a previous client.
	;

	ForListDo $(ServiceNameList)
		Set Do$($) = TRUE
	EndForListDo

	set CalledFromUpdate = "YES"
	goto InstallEnabledServices

ReturnToUpdate = +

;	LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\"$(NwSetupDll) NwLibHandle
;	LibraryProcedure GUIResult $(NwLibHandle) NWStopService "CPROXY"
;	LibraryProcedure GUIResult $(NwLibHandle) NWStopService "GCFWMAP"
;	LibraryProcedure GUIResult $(NwLibHandle) NWStopService "CFWNTSYS"
;	LibraryProcedure GUIResult $(NwLibHandle) NWStopService "NWTCP"
;	FreeLibrary $(NwLibHandle)	

;	Fix up dependencies in case older INF,
;           which had different dependencies, was used previously.
        Shell "" RemoveServiceDependency "CFWNTSYS" "NWTcp"
        Shell "" AddServiceDependency "CFWNTSYS" "ResMgr"

        Shell "" RemoveServiceDependency "GCFWMAP" "CFWNTSYS"

	ifstr(i) $(DO_NWLINK) != "YES"
;               IP-only, remove NWTCP component
		Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer),  $(ProductNWTCPName)
		Ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Debug-Output "OEMNXPGW.INF: RemoveSoftwareComponent ShellCode error "$($ShellCode)" installing "$(ProductNWTCPName)
			goto ShellCodeError
		Endif

;		Remove gcfwmap dependency on NWTcp and remove file nwtcp.sys
	        Shell "" AddServiceDependency "GCFWMAP" "Tcpip"
	        Shell "" RemoveServiceDependency "GCFWMAP" "NWTcp"
		LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\"$(NwSetupDll) NwLibHandle
		LibraryProcedure GUIResult $(NwLibHandle) NWDeleteFile $(!STF_WINDOWSSYSPATH)"\netware\nwtcp.sys"
		FreeLibrary $(NwLibHandle)
	else
	        Shell "" AddServiceDependency "NWTCP" "NwlnkIpx"
	        Shell "" AddServiceDependency "NWTCP" "+NetWare Services"
	        Shell "" AddServiceDependency "NWTCP" "+TDI"
	        Shell "" RemoveServiceDependency "NWTCP" "ResMgr"

		set TempKeyName = $(!NTN_ServiceBase)"\NWTCP"
		OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
		Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			SetRegValue $(TempKey) {"Group", $(NoTitle), $(!REG_VT_SZ), "NetWare IP Gateway"}
			ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
				Debug-Output "OEMNXPGW.INF:  Failed to update Group for CPROXY"
			endif
			CloseRegKey $(TempKey)
		Endif
	Endif

	ifstr(i) $(DO_TCPIP) != "YES"
;               IPX-only; remove gcfwmap dependency on Tcpip
	        Shell "" AddServiceDependency "GCFWMAP" "NWTcp"
	        Shell "" RemoveServiceDependency "GCFWMAP" "Tcpip"
	Endif

	ifstr(i) $(DO_TCPIP) == "YES"
		ifstr(i) $(DO_NWLINK) == "YES"
;	               IPX-only; remove gcfwmap dependency on Tcpip
		       Shell "" AddServiceDependency "GCFWMAP" "NWTcp"
		       Shell "" AddServiceDependency "GCFWMAP" "Tcpip"
		endif
	Endif


	set TempKeyName = $(!NTN_ServiceBase)"\CPROXY"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		SetRegValue $(TempKey) {"Group", $(NoTitle), $(!REG_VT_SZ), "NetWare IP Gateway"}
		ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNXPGW.INF:  Failed to update Group for CPROXY"
		endif
		CloseRegKey $(TempKey)
	Endif

	set TempKeyName = $(!NTN_ServiceBase)"\GCFWMAP"
	OpenRegKey $(!REG_H_LOCAL) "" $(TempKeyName) $(MAXIMUM_ALLOWED) TempKey
	Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
		SetRegValue $(TempKey) {"Group", $(NoTitle), $(!REG_VT_SZ), "NetWare IP Gateway"}
		ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			Debug-Output "OEMNXPGW.INF:  Failed to update Group for CPROXY"
		endif
		CloseRegKey $(TempKey)
	Endif

	;
	;       Remove Winsock parameters
	;

	Shell "" Remove-Winsock
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
	endif

	;
	;       Install Winsock parameters
	;

	Shell "" Install-Winsock
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		goto ShellCodeError
	endif

	;
	;       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 "OEMNXPGW.INF:  User Canceled due to a error processing the Unattended Variables."
		set CommonStatus = STATUS_USERCANCEL
		goto setfailed
	endif

	set !STF_SRCDIR_OVERRIDE = $(OldSTF_SRCDIR_OVERRIDE)

	goto end


;******************************************
;
;       Common exit section
;
;******************************************
abandon = +
	Debug-Output "OEMNXPGW.INF: abandon"
	ForListDo $(OEM_ABANDON_OPTIONS)
		Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), $(ProductSoftwareName), $($)
		ifint $($ShellCode) != $(!SHELL_CODE_OK)
			Debug-Output "OEMNXPGW.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 "OEMNXPGW.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)


;-----------------------------------------------------------------------
;
;
;       Additional installation and update processing for services
;
;
;-----------------------------------------------------------------------
[FinishInstalling-CPROXY]
	Return

[FinishInstalling-CFWNTSYS]
	Return

[FinishInstalling-GCFWMAP]
	Return

[FinishInstalling-NWTCP]
	Return


;-----------------------------------------------------------------------
;
;               SECTION:        Install-Files
;
;               PURPOSE:        Called at install or update to copy
;                                       files to the system
;
;               ARGUMENTS:      None
;
;               RETURNS:        None
;
;               REFERENCES:     None
;
;               MODIFIES:       None
;
;-----------------------------------------------------------------------
[Install-Dirs]
	Debug-Output "OEMNXPGW.INF:  Creating file directories"

	Exit


[Install-Files]
	Debug-Output "OEMNXPGW.INF:  Installing files"
	set STF_VITAL = ""

	Ifstr(i) $(AddCopy) == "YES"
		;
		; Add the files to the copy list
		;
		AddSectionFilesToCopyList Files-Inf                                $(SrcDir)nls\$(NLSDirName)   $(!STF_WINDOWSSYSPATH)
		AddSectionFilesToCopyList Files-System32                   $(SrcDir)redir                               $(!STF_WINDOWSSYSPATH)
		AddSectionFilesToCopyList Files-NetWare                    $(SrcDir)redir                               $(!STF_WINDOWSSYSPATH)\netware
		AddSectionFilesToCopyList Files-Res-Sys32-$(NLSDirName)  $(SrcDir)nls\$(NLSDirName)	$(!STF_WINDOWSSYSPATH)\nls\$(NLSDirName)
		Debug-Output "OEMNXPGW.INF:  Files added to list"
	Endif

	Ifstr(i) $(DoCopy) == "YES"
		;
		; Copy files in the copy list
		;
		set !STF_NCPA_FLUSH_COPYLIST = TRUE
		set !STF_NETCANCELOVERIDE = "YES"			 		; this line removes the cancel button
		CopyFilesInCopyList
		Debug-Output "OEMNXPGW.INF:  Files copied"
	Endif

	Exit

;******************************************
;
;       File copy information
;
;******************************************
[Source Media Descriptions]
	1       = "Novell Client for Windows NT Setup Disk 3",  TAGFILE = NWC_3


[Files-Inf]
	1,      oemnxpgw.inf,   SIZE=50000,     DECOMPRESS

[Files-Res-Sys32-English]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Chineset]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Chineses]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Deutsch]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Espanol]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Francais]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Italiano]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Korean]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Nihongo]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Portugue]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-Res-Sys32-Russki]
	1,	nwgwpngr.dll,	SIZE=50000,	DECOMPRESS

[Files-System32]
	1,      cfwntdll.dll,   SIZE=50000,     DECOMPRESS
	1,      winping.exe,    SIZE=50000,     DECOMPRESS

[Files-Netware]
	1,      cfwntsys.sys,   SIZE=50000,     DECOMPRESS
	1,      gcfwmap.sys,    SIZE=50000,     DECOMPRESS
	1,      cproxynt.sys,   SIZE=50000,     DECOMPRESS
	1,      nwtcp.sys,      SIZE=50000,     DECOMPRESS
	1,      gwspdll.dll,    SIZE=50000,     DECOMPRESS
	1,      nwws2gw.dll,    SIZE=50000,     DECOMPRESS


[AddServiceDependency]
    Debug-Output "AddServiceDependency: entry"
    set MAXIMUM_ALLOWED = 33554432
    set SERVICE_NO_CHANGE = 4294967295
    set Status   = STATUS_FAILED
    Set KeyNull  = ""
    set DependentService = $(!NTN_ServiceBase)\$($0)
    set DependentName = $($0)
    set DependOn = $($1)
    set ServiceKey = $(KeyNull)
    OpenRegKey $(!REG_H_LOCAL) "" $(DependentService)"\Linkage" $(MAXIMUM_ALLOWED) ServiceKey
    ifstr(i) $(ServiceKey) != $(KeyNull)
        GetRegValue $(ServiceKey) "OtherDependencies" ServicesList
        ifint $(RegLastError) != 0
           set ServiceValues = {}
        else
           set ServiceValues = *($(ServicesList),4)
        endif
        debug-output "AddServiceDependency: Old OtherDependencies: "$(ServiceValues)
        ifstr(i) $(ServiceValues) == {}
            Set ServiceValues = {$(DependOn)}
        else-ifstr(i) $(ServiceValues) == ""
            Set ServiceValues = {$(DependOn)}
        else-ifcontains(i) $(DependOn) in $(ServiceValues)
            return STATUS_SUCCESSFUL
        else
            Set ServiceValues = >($(ServiceValues), $(DependOn))
        endif
        debug-output "AddServiceDependency: New OtherDependencies: "$(ServiceValues)
        SetRegValue $(ServiceKey) {OtherDependencies, 0,+
                                   $(!REG_VT_MULTI_SZ), $(ServiceValues)}
        CloseRegKey $(ServiceKey)
        set Status = STATUS_SUCCESSFUL
    else
        Debug-Output "AddServiceDependency: error opening service "$(DependentService)"\Linkage"
        Debug-Output "AddServiceDependency: error was: "$(RegLastError)
    endif
    set KeyService = $(KeyNull)
    OpenRegKey $(!REG_H_LOCAL) "" $(DependentService) $(MAXIMUM_ALLOWED) KeyService
    ifstr $(KeyService) != $(KeyNull)
        set newDependList = {$(DependOn)}
        GetRegValue    $(KeyService) "DependOnService" ServiceList
        ifint $(RegLastError) == 0
            Debug-Output "AddServiceDependency: old DependOnService List "*($(ServiceList), 4)
            ForListDo *($(ServiceList),4)
                ifstr(i) $($) != $(DependOn)
                   set newDependList = >($(newDependList), $($))
                endif
            EndForListDo
        endif
        GetRegValue    $(KeyService) "DependOnGroup" GrpList
        ifint $(RegLastError) == 0
            Debug-Output "AddServiceDependency: old DependOnGroup List "*($(GrpList), 4)
            ForListDo *($(GrpList),4)
               set grp = "+"$($)
               set newDependList = >($(newDependList), $(grp))
            EndForListDo
        endif
        Debug-Output "OEMNSVRA.INF: AddServiceDependency: new Dependency List "$(newDependList)
        LibraryProcedure Result, $(!LIBHANDLE), SetupChangeServiceConfig, $(DependentName) $(SERVICE_NO_CHANGE), $(SERVICE_NO_CHANGE), $(SERVICE_NO_CHANGE), "", "", $(newDependList), "", "", ""
        CloseRegKey $(KeyService)
    else
        Debug-Output "AddServiceDependency: failed to open service linkage key"$(DependentService)
        Debug-Output "AddServiceDependency: error was: "$(RegLastError)
    endif
    Debug-Output "AddServiceDependency: exit"
    return $(Status)

[RemoveServiceDependency]
    Debug-Output "RemoveServiceDependency: entry"
    set MAXIMUM_ALLOWED = 33554432
    set SERVICE_NO_CHANGE = 4294967295
    set Status   = STATUS_FAILED
    Set KeyNull  = ""
    set DependentService = $(!NTN_ServiceBase)\$($0)
    set DependentName = $($0)
    set DependOn = $($1)
    OpenRegKey $(!REG_H_LOCAL) "" $(DependentService)"\Linkage" $(MAXIMUM_ALLOWED) ServiceKey
    ifstr(i) $(ServiceKey) != $(KeyNull)
        GetRegValue $(ServiceKey) "OtherDependencies" ServicesList
        ifint $(RegLastError) != 0
           set ServiceValues = {}
        else
           set ServiceValues = *($(ServicesList),4)
        endif
        debug-output "RemoveServiceDependency: old OtherDependencies list:"$(ServicesList)
        set ServiceValues = *($(ServicesList),4)
        debug-output "ServiceValues: "$(ServiceValues)
        ifcontains(i) $(DependOn) in $(ServiceValues)
            set NewServiceValues = {}
            ForListDo $(ServiceValues)
                ifstr(i) $($) != $(DependOn)
                    set NewServiceValues = >($(NewServiceValues), $($))
                endif
            EndForListDo
            debug-output "RemoveServiceDependency: new OtherDependencies list: "$(NewServiceValues)
            SetRegValue $(ServiceKey) {OtherDependencies, 0,+
                             $(!REG_VT_MULTI_SZ), $(NewServiceValues)}
        else
        endif
        CloseRegKey $(ServiceKey)
        set Status = STATUS_SUCCESSFUL
    else
        Debug-Output "RemoveServiceDependency: error opening service "$(DependentService)"\Linkage"
    endif
    set KeyService = $(KeyNull)
    OpenRegKey $(!REG_H_LOCAL) "" $(DependentService) $(MAXIMUM_ALLOWED) KeyService
    ifstr $(KeyService) != $(KeyNull)
        set newDependList = {}
        GetRegValue    $(KeyService) "DeleteFlag" DeleteFlagValue
        ifint $(RegLastError) != 0
            GetRegValue    $(KeyService) "DependOnService" ServiceList
            ifint $(RegLastError) == 0
                Debug-Output "RemoveServiceDependency: old DependOnService List "*($(ServiceList), 4)
                ifcontains(i) $(DependOn) in *($(ServiceList),4)
                    ForListDo *($(ServiceList),4)
                        ifstr(i) $($) != $(DependOn)
                           set newDependList = >($(newDependList), $($))
                        endif
                    EndForListDo
                    GetRegValue $(KeyService) "DependOnGroup" GrpList
                    ifint $(RegLastError) == 0
                        ForListDo *($(GrpList),4)
                           set grp = "+"$($)
                           set newDependList = >($(newDependList), $(grp))
                        EndForListDo
                    endif
                    Debug-Output "OEMNSVRA.INF:RemoveServiceDependency: new DependOnService List "$(newDependList)
                    LibraryProcedure Result, $(!LIBHANDLE), +
                       SetupChangeServiceConfig, $(DependentName)  +
                       $(SERVICE_NO_CHANGE), $(SERVICE_NO_CHANGE), +
                       $(SERVICE_NO_CHANGE), "", "",  +
                       $(newDependList), "", "", ""
                endif
            endif
        endif
        CloseRegKey $(KeyService)
    else
        Debug-Output "RemoveServiceDependency: failed to open service linkage key"$(DependentService)
    endif
    Debug-Output "RemoveServiceDependency: exit"
    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]

	set SoftwareNovell = $(!NTN_SoftwareBase)"\"$(Manufacturer)
	OpenRegKey $(!REG_H_LOCAL) "" $(SoftwareNovell) $(MAXIMUM_ALLOWED) KeySoftwareNovell
	ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
		Debug-Output "OEMNXPGW.INF: Error opening "$(SoftwareNovell)
	Else
		set NovellCProxy = "CProxy"
		OpenRegKey $(KeySoftwareNovell) "" $(NovellCProxy) $(MAXIMUM_ALLOWED) KeyNovellCProxy
		ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
			CreateRegKey $(KeySoftwareNovell) {$(NovellCProxy), $(NoTitle), GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyNovellCProxy
			ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
				Debug-Output "OEMNXPGW.INF: Error creating Software\Novell\CProxy"
			Endif
		Endif
	Endif

	Ifstr(i) $(KeyNovellCProxy) != ""

		SetRegValue $(KeyNovellCProxy) {"Enabled", $(NoTitle), $(!REG_VT_DWORD), 1}
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			Debug-OutPut "OEMNXPGW.INF: Gateway Enabled"
		endif

		CloseRegKey $(KeyNovellCProxy)
	Endif

	Ifstr(i) $(KeySoftwareNovell) != ""
		CloseRegKey $(KeySoftwareNovell)
	Endif

	;
	; HKEY_LOCAL_MACHINE\Software\Novell\CPROXY\CurrentVersion
	;

	set TempKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\CPROXY\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 "OEMNXPGW.INF:  Unable to update MajorInternalVersion value in "$(TempKeyName)
			endif

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

        CloseRegKey $(TempKey)
	endif

	RemoveCommonProgManItem $(NetWareGroup) $(PingIconText)
	CreateCommonProgManItem $(NetWareGroup), $(PingIconText) "winping.exe" "" 0

	Exit



[Remove-Icons]

	RemoveCommonProgManItem $(NetWareGroup) $(PingIconText)

	Exit


;-----------------------------------------------------------------------
;
;               SECTION:        Install-Winsock
;
;               PURPOSE:        Called at install or update to add
;                                       winsock parameters to the registry
;
;               ARGUMENTS:      None
;                                       
;               RETURNS:        None
;
;               REFERENCES:     None
;
;               MODIFIES:       None
;
;-----------------------------------------------------------------------
[Install-Winsock]
	read-syms GeneralConstants
	read-syms FileConstants
	read-syms FileConstants$(!STF_LANGUAGE)
	read-syms InstallOption$(!STF_LANGUAGE)

	Debug-Output "OEMNXPGW.INF:  Installing Winsock information"

	LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\"$(NwSetupDll) NwLibHandle

	LibraryProcedure LibResult $(NwLibHandle) NWInstallDNSNameSpace
	Debug-Output "OEMNXPGW.INF:  NWInstallDNSNameSpace: "$(LibResult)

	LibraryProcedure LibResult $(NwLibHandle) NWInstallGwProvider
	Debug-Output "OEMNXPGW.INF:  NWInstallGwProvider: "$(LibResult)

	FreeLibrary $(NwLibHandle)

	Return


;-----------------------------------------------------------------------
;
;               SECTION:        Remove-Winsock
;
;               PURPOSE:        Called at remove time to remove
;                                       winsock parameters and restore the old ones
;
;               ARGUMENTS:      None
;                                       
;               RETURNS:        None
;
;               REFERENCES:     None
;
;               MODIFIES:       None
;
;-----------------------------------------------------------------------
[Remove-Winsock]
	read-syms GeneralConstants
	read-syms FileConstants
	read-syms FileConstants$(!STF_LANGUAGE)
	read-syms InstallOption$(!STF_LANGUAGE)

	Debug-Output "OEMNXPGW.INF:  Uninstalling Winsock information"

	LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\"$(NwSetupDll) NwLibHandle

	Debug-Output "OEMNXPGW.INF:  Registering Winsock information"
		
	LibraryProcedure LibResult $(NwLibHandle) NWReinstallDNSNameSpace
	Debug-Output "OEMNXPGW.INF:  NWReinstallDNSNameSpace: "$(LibResult)

;	LibraryProcedure LibResult $(NwLibHandle) NWUninstallGwProvider
	LibraryProcedure LibResult $(NwLibHandle) NWReinstallSvcProvider
	Debug-Output "OEMNXPGW.INF:  NWReinstallSvcProvider: "$(LibResult)

	FreeLibrary $(NwLibHandle)

	Return

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

	;       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) != ""
		LoadLibrary $(LoadDisk3Text) $(!STF_WINDOWSSYSPATH)"\"$(NwSetupDll) NwLibHandle
		SetHelpFile $(!STF_WINDOWSSYSPATH)"\nls\"$(!P:NLSDirName)"\setupnw.hlp" $(!MinimumID) $(!MaximumID)

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

		FreeLibrary $(NwLibHandle)
	endif

Return $(UnattendReturnStatus)

;-----------------------------------------------------------------------
;
;               SECTION:        DoAskSource
;
;               PURPOSE:        Called at install and update time to 
;                               prompt for the source location
;
;               ARGUMENTS:      None
;                                       
;               RETURNS:        None
;
;               REFERENCES:     None
;
;               MODIFIES:       None
;
;-----------------------------------------------------------------------
[DoAskSource]
	read-syms GeneralConstants
	read-syms FileConstants
	read-syms FileConstants$(!STF_LANGUAGE)
	read-syms InstallOption$(!STF_LANGUAGE)
	read-syms DoAskSource$(!STF_LANGUAGE)

	Set DAS_CWDDIR		= $($0)
	Set DAS_SRCDIR		= $($1)
	Set DAS_BUILTIN	= $($2)
	Set DAS_Result		= STATUS_FAILED
	Ifstr(i) $(!STF_SRCDIR_OVERRIDE) != ""
		Set DAS_SRCDIR = $(!STF_SRCDIR_OVERRIDE)
		Set DAS_Result = STATUS_SUCCESSFUL
		Goto DAS_exit
	Endif
	Ifstr(i) $(DAS_BUILTIN) == YES
		Ifstr(i) $(!NTN_InstallPhase) == primary
			Ifstr(i) $(!STF_SRCDIR_WINNT) != ""
				Set DAS_SRCDIR = $(!STF_SRCDIR_WINNT)
			Endif
			Set DAS_Result = STATUS_SUCCESSFUL
			Goto DAS_exit
		Endif
	Else
		set SourcePathName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion"
		OpenRegKey $(!REG_H_LOCAL) "" $(SourcePathName) $(MAXIMUM_ALLOWED) SourcePathKey
		ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
			GetRegValue $(SourcePathKey) "SourcePath" SourcePathList
			ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
				set SourcePath = *($(SourcePathList), 4)
				ifstr(i) $(DAS_SRCDIR) == $(SourcePath)
					set NWSourcePathName = $(!NTN_SoftwareBase)"\Novell\NetWareWorkstation\CurrentVersion"
					OpenRegKey $(!REG_H_LOCAL) "" $(NWSourcePathName) $(MAXIMUM_ALLOWED) NWSourcePathKey
					ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
						GetRegValue $(NWSourcePathKey) "SourcePath" NWSourcePathList
						ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
							set NWSourcePath = *($(NWSourcePathList), 4)
							ifstr(i) $(NWSourcePath) != ""
								set DAS_SRCDIR = $(NWSourcePath)
							endif
						endif
				        CloseRegKey $(NWSourcePathKey)
					endif
				endif
			endif
	        CloseRegKey $(SourcePathKey)
		endif
	Endif
	Debug-Output "OEMNXPGW.INF: [DoAskSource] STF_CWDDIR = "$(DAS_CWDDIR)" STF_SRCDIR = "$(DAS_SRCDIR)
	Ifstr(i) $(DAS_SRCDIR) == ""
		Set DAS_SRCDIR = "A:\"
	Endif
	Ifstr(i) $(DAS_SRCDIR) == $(!STF_SRCDIR_USED)
		Set DAS_SRCDIR = $(!STF_SRCDIR_KEYED)
	Endif
	Shell "subroutn.inf" DoAskSourceEx $(DAS_SRCDIR) $(NetWareDlgText)
	ifint $($ShellCode) != $(!SHELL_CODE_OK)
		Debug-Output "OEMNXPGW.INF: shelling SUBROUTN.INF [DoAskSource] failed"
		goto DAS_exit
	endif
	Set DAS_Result = $($R0)
	Set DAS_SRCDIR = $($R1)
	Set !STF_SRCDIR_USED = $($R1)
	Set !STF_SRCDIR_KEYED = $($R3)
DAS_exit =+
	Read-syms ProgressCopy$(!STF_LANGUAGE)
	Return $(DAS_Result) $(DAS_SRCDIR)

	
;-----------------------------------------------------------------------
; 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]
	CPROXY                  = "Novell IP Gateway"

[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 IP Gateway"

	;
	; Service Info
	;       
	
	ProductCPROXYDisplayName                = "Novell IP Gateway"
	ProductCPROXYDescription                = "The Novell IP/IPX Gateway enables internet access on IPX or private IP networks when Novell IP/IPX Gateway servers are installed on the network."
	ProductCFWNTSYSDisplayName              = "Novell IP Gateway Framework"
	ProductGCFWMAPDisplayName               = "Novell IP Gateway Mapper"
	ProductNWTCPDisplayName                 = "Novell TCP/IPX Driver"
	;
	;  Variables to support thermometer gauge and error dialogs
	;
	
	ProCaption		= "Novell IP Gateway for Windows NT Setup"
	ProCancel		= "Cancel"
	ProCancelMsg	= "The Novell IP Gateway for Windows NT is not "+
		"correctly installed.  Are you sure you want to cancel "+
		"copying files?"
	ProCancelCap	= "Network Setup Message"
	ProText1			= "Copying:"
	ProText2			= "To:"
	
[ProgressCopyENG]
	!p:ProCaption		= "Novell IP Gateway for Windows NT Setup"
	!p:ProCancel		= "Cancel"
	!p:ProCancelMsg	= "The Novell IP Gateway for Windows NT is not "+
		"correctly installed.  Are you sure you want to cancel "+
		"copying files?"
	!p:ProCancelCap	= "Setup Message"
	!p:ProText1			= "Copying:"
	!p:ProText2			= "To:"
	!p:Error				= "Unable to determine proper source disk location; copy cannot be performed."


[InstallOptionENG]
	ErrorMessageTitle = "IP Gateway Install Error"

	ShellCodeErrorTitle = "Error:  Novell IP Gateway Install"

	ShellCodeErrorText = "Shell Code Error"

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

	NetWareGroup = "Novell"

	PingIconText = "Ping for IP Gateway"

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

	UnattendFileReadFailed = "Read File Error while trying to read and "+
		"initialize either the Novell ACU options and/or the Novell Client parameters "+
		"from the Unattended file.  The Novell Client parameters will not "+
		"be set in the registry, and any ACU installation options will not "+
		"install.  Press CANCEL to Abort the installation and correct the "+
		"syntax errors in the UNATTEND.TXT file.  Press OK to manually "+
		"complete the install of the Novell NT Client without setting the "+
		"Client parameters."

	MustRebootMessage = "This network component has recently been removed. Please restart your computer before installing it again."

[DoAskSourceENG]
	NetWareDlgText = "Please enter the full path to the Novell "+
		"Client for Windows NT distribution files.  Then choose Continue."
