Metropoli BBS
VIEWER: 411spack.ips MODE: TEXT (ASCII)
@SyntaxVersion 1.03
@Version 4.00
;  	------------------------------------------------------------------------------
;
; This script has been developed to install "IntranetWare Support Pack".
; Date: 03/20/97
;
;	NOTE:  Products that are not localized are placed in the directory named 4 (ENGLISH).
;			The script checks for a directory named %{NWLANG} (This is the language the server
;			is set to.  If these files are localized, the directory needs to be changed
;			to reflect the language.  The FILE named 4 also needs to be changed to 
;			the language number.
;
;			For example, if the file in directory 4 are localized to German, then the
;			4 directory needs to be renamed to 7 and the file 4 needs to be renamed
;			to 7.
;
; ------------------------------------------------------------------------------
; "CoPyRiGhT=(c) 1997 Novell, Inc.  All Rights Reserved."
; VeRsIoN=4.00

CopyToServer SYSTEM\NWUPDATE, ICMD.NLM, '', ''
Command NWUPDATE\ICMD

; --------------------------------------------------------------------------
;   Setup Global Variables
; --------------------------------------------------------------------------
	SetVar SupportPackVersion, 	"4.0"
	GetPath TempInstallDir, 1, 'SYS:\\SYSTEM\\NWUPDATE', ''

; --------------------------------------------------------------------------
;   NOTE:  Need a way to exit out of backup and install.  Since you cannot
;			GOTO from one FileSet to another, the global variable DONE
;			is used to indicate exit.  If DONE = 1 (TRUE) then goto EXIT
;			else continue on.
; --------------------------------------------------------------------------
	SetVar true, 1
	SetVar false, 0
	SetVar done, %{false}
	SetVar backup, %{false}
	SetVar itemSelected, %{false}
	SetVar installSelected, %{false}
	SetVar LogFile, 'SPACKLOG.TXT'


; --------------------------------------------------------------------------
; SetupPaths
; --------------------------------------------------------------------------
	GetPath startupDir, 3, '%{NWBOOT}', '', NWBOOT
	GetPath autoexecDir, 3, 'SYS:SYSTEM', ''
	GetPath PatchSrc,  3, '%{NWSRC}\\COMMON\\PK411', '', NWSRC
	GetPath PatchDest, 3, '%{NWBOOT}', '', NWBOOT
	GetPath NotLocalized, 3, '%{NWSRC}\\%{NWLANG}', '', NWSRC
	GetPath SourceCommonSYS,  3, '%{NWSRC}\\COMMON\\SYS', '', NWSRC
	GetPath NotLocalizedSYS, 3, '%{NWSRC}\\%{NWLANG}\\SYS', '', NWSRC
	GetPath SourceCommonProducts,  3, '%{NWSRC}\\COMMON\\PRODUCTS', '', NWSRC
	GetPath NotLocalizedProducts,  3, '%{NWSRC}\\%{NWLANG}\\PRODUCTS', '', NWSRC
	SetVar  DestSYS, "SYS:"

; --------------------------------------------------------------------------
; End Setup Section
; --------------------------------------------------------------------------


@FileSet
	Description: "Backup files that will be replaced by v4.0 IntranetWare Support Pack."
	Name:  SPACK_BACKUP
	Class: OPTIONAL
	Help:  "The Backup Files option will backup files before overwriting.  These files are copied to the path SYS:\\SYSTEM\\!BACKUP.SP4"

	SetVar backup, %{true}
	SetVar itemSelected, %{true}

@EndFileSet


@FileSet
	Description:  "Install v4.0 IntranetWare Support Pack."
	Name: IntranetWare
	CLASS: OPTIONAL
	Help:  "Install v4.0 IntranetWare Support Pack file to your server."

	SetVar itemSelected, %{true}
	SetVar installSelected, %{true}
@EndFileSet


	GotoIfEqual %{itemSelected}, %{true}, MENU_SELECTED
		Display 0, "ERROR:  A menu item was not selected."
		setVar done, %{true}
		Goto NO_MENU_SELECTED
Label MENU_SELECTED


	;----- Check that the OS is 4.11 -----
	GotoIfNEqual %{PI_OSMajorVersion}, 4, WRONG_OS
	GotoIfNEqual %{PI_OSMinorVersion}, 11, WRONG_OS
	GotoIfNEqual %{PI_OSRevision}, 0, WRONG_OS
		Goto RIGHT_OS


Label WRONG_OS
    	Display 0, "This version of the IntranetWare Support Pack only works for IntranetWare or NetWare 4.11."
		SetVar done, %{true}

Label RIGHT_OS


	;----- Do not overwrite newer support pack -----
	ReadProductRecord SPACK, 0, ID, cCode
	GotoIfNEqual %{cCode}, 0, INSTALLPACK
	SGotoIfLsEqual %{ID}, %{SupportPackVersion}, INSTALLPACK
		Display 1, "Version %{ID} of the IntranetWare Support Pack is already installed.\n\nInstallation will be aborted."
		SetVar done, %{true}
Label INSTALLPACK


	GotoIfEqual %{done}, %{true}, NO_MESSAGE
		Display 1, "IntranetWare Support Pack 4.0 Installation\n\nThis install will auto-detect the
					services and will install updates to IntranetWare, NetWare 4.11 
					and these services. \n\n
					If the backup option was selected, these files will be backed up to the directory 
					SYS:\\SYSTEM\\!BACKUP.SP4.\n\n Press <ESC> to cancel."
Label NO_MESSAGE


	;----- Setup Log file -----
	CheckFile autoexecDir, %{LogFile}, '', ''
	GotoIfEqual '%{NWSTATUS}', 0, LOG_FOUND
		;----- If log file not found then copy one to SYS:SYSTEM
		CopyFile 0, 0, 0, 1, 0, NWSRC,  %{LogFile}, '', '', DestSYS, 'SYSTEM', '', '', 3
Label LOG_FOUND

	;----- Write 1st entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\t----- Begin install of Support Pack %{SupportPackVersion} -----'
	PI_EditNCF_Addline '  '
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

	GotoIfEqual %{cCode}, 0, LOG_OK
		Display 0, "Could not write to log file:  %{LogFile}."
Label LOG_OK

Label NO_MENU_SELECTED



; --------------------------------------------------------------------------
;	Backup Fileset
; --------------------------------------------------------------------------
@FileSet
	Description: "Backup files that will be replaced by v4.0 IntranetWare Support Pack."
	Name: BACKUP
	Help:  "The Backup Files option will backup files before overwriting.  These files are copied to the path SYS:\\SYSTEM\\!BACKUP.SP4"

@EndFileSet
@IncludeFile
	File: Backup\Backup.IPS
@EndIncludeFile



; --------------------------------------------------------------------------
;	IntranetWare Support Pack Fileset
; --------------------------------------------------------------------------
@FileSet
	Description:  "Install v4.0 IntranetWare Support Pack."
	Name:  SPACK
	CLASS: MANDATORY


	;----- If Done = true then exit -----
	GotoIfEqual %{done}, %{true},EXIT

	;----- If installSelected = false then exit -----
	GotoIfEqual %{installSelected}, %{false},EXIT


 
; -------------------------------------------------------------------------------------------------
;                                    MISCELLANEOUS FIXES SECTION
; -------------------------------------------------------------------------------------------------

	;-----------------------------------------------------------------------------
 	;----- Load the LSPUPD.NLM for increasing LSP packet size for NLSP (IPX) -----
	;-----------------------------------------------------------------------------
	CopyToServer SYSTEM\NWUPDATE, LSPUPD.NLM, '', ''
	NLMExec2 1, NWUPDATE\LSPUPD, ccode

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tLoaded LSPUPD.NLM.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

	;----------------------------------------------------------------------------------
	;----- NetWare Connect fix.  Need to comment out IPXNLP.NLM from NWCSTART.NCF -----
	;----------------------------------------------------------------------------------
    ;----- Check for the existence of NetWare Connect
    ReadProductRecord CONNECT, 0, ID, cCode
    GotoIfNEqual %{cCode}, 0, CONNECT_DONE

		;----- The new IPXRTR.NLM removes the need for the ipxnlp.nlm with NetWare Connect
		;----- This is commented out of the .ncf file so the user does not get an error message
		PI_EditNCF_Addline ''
	    PI_EditNCF_KEYSTRINGS 'load ipxnlp',''   ; Last entry MUST be null string (indicates end of list)
	    PI_EditNCF autoexecDir, 'NWCSTART.NCF', '.PT', ccode
		GotoIfNEqual %{ccode}, 0, NWCSTART_ERR

		;----- Add entry to Log file -----
		PI_EditNCF_Addline ''
		PI_EditNCF_Addline '\tCommented out IPXNLP.NLM from NWCSTART.NCF'
		PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
		Goto CONNECT_DONE

		Label NWCSTART_ERR
		Display 2, "Could not modify NWCSTART.NCF"
		;----- Add entry to Log file -----
		PI_EditNCF_Addline ''
		PI_EditNCF_Addline '\tCould not modify NWCSTART.NCF.  Error code:%{ccode}.'
		PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
	Label CONNECT_DONE

	;-----------------------------------------------------------------------------
	;----- These two files are very large and need to be copied to an additional
	;	   location.
	;	   Do this for English only.
	;-----------------------------------------------------------------------------
	GotoIfNEqual %{NWLANG}, 4, SKIP_LARGE_FILES
		CopyFile 0, 0, 0, 1, 0, NotLocalizedSYS, '\PUBLIC\\NLS\\ENGLISH\\NWEC.CNT', '', '', DestSYS, '\PUBLIC\\WIN95\\NLS\\ENGLISH', '', '', 3
		CopyFile 0, 0, 0, 1, 0, NotLocalizedSYS, '\PUBLIC\\NLS\\ENGLISH\\NWEC.HLP', '', '', DestSYS, '\PUBLIC\\WIN95\\NLS\\ENGLISH', '', '', 3
	Label SKIP_LARGE_FILES
 
; -------------------------------------------------------------------------------------------------
;                                    PRODUCTS SECTION
; -------------------------------------------------------------------------------------------------

CheckFile NotLocalized, %{NWLANG}, '', ''
GotoIfNEqual '%{NWSTATUS}', 0, COMMON

;GotoIfNEqual %{NWLANG}, 4, COMMON

;--------------------------------------------------------------------------
;    These products are NOT Localized
;--------------------------------------------------------------------------

	;----- Copy to the SYS: Volume for files not localized.
	Display 2, "Copying Language specific System files..."
	CopyFile 1, 1, 0, 1, 0, NotLocalizedSYS, '', '', '', DestSYS, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tLanguage specific System files for the operating system.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

											 
;--------------------------------------------------------------------------
;----- MULTIPROTOCOL ROUTER (MPR) -----
;--------------------------------------------------------------------------
	;----- Set command MPR30 and MPR31 path ------
	GetPath MPRCommon,1, '%{NotLocalizedProducts}\\MPR3031', '', NWSRC

    ;----- Check for the existence of MPR 3.1
    ReadProductRecord MPR, 0, ID, cCode
    GotoIfNEqual %{cCode}, 0, MPR30
    SGotoIfNEqual %{ID}, "V3.1", MPR30

    ;----- MPR 3.1 -----
	GetPath SourceDrive,1, '%{NotLocalizedProducts}\\MPR31', '', NWSRC
	
	Display 2, "Copying MPR 3.1 files..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3
    CopyFile 1,1,1,1,0,MPRCommon,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tMultiprotocol Router V3.1 (MPR) update'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

    Goto MPR_DONE

Label MPR30	  
    ;----- Check for the existence of NIAS 4.1
;    ReadProductRecord NIAS, 0, ID, cCode
;    GotoIfEqual %{cCode}, 0, MPR_DONE

    ;----- MPR 3.0
	Display 2, "Copying MPR 3.0 files..." 
    CopyFile 1,1,1,1,0,MPRCommon,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tMultiprotocol Router V3.0 (MPR) update'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

Label MPR_DONE


;--------------------------------------------------------------------------
;----- NETWARE IP (NWIP) -----
;--------------------------------------------------------------------------

	;----- Set up path common to both NWIP and UXP
	GetPath NWIP_UPX_COMMON,1, '%{NotLocalizedProducts}\\NWIPUXP', '', NWSRC

    ;----- Check for the existence of NWIP

    ;----- NWIP has the language appended to the product record 
    SetVar PRecord, 'NWIP%{NWLANG}'
    ReadProductRecord %{PRecord}, 0, ID, cCode
    GotoIfNEqual %{cCode}, 0, NONWIP

    ;----- A revision is appended to the end of the version (ie.  2.2a, 2.2b).
    ;----- Must be 2.2 <= NWIP < 2.2D
    SGotoIfLess %{ID}, "2.2", NONWIP
    SGotoIfGreater %{ID}, "2.2D", NONWIP

    ;----- Get the source - It is SAME as normal input path
    GetPath SourceDrive, 1, '%{NotLocalizedProducts}\\NWIP', '', NWSRC

	Display 2, "Copying NetWare/IP files..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3
    CopyFile 1,1,1,1,0,NWIP_UPX_COMMON,'','','',DestSYS,'','','',3


	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tNetware IP updated from %{ID} to v2.2d.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto NWIP_DONE

Label NONWIP
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tNetware IP not updated.  Product not found.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

Label NWIP_DONE


;--------------------------------------------------------------------------
;----- UNIX PRINT SERVICES  -----
;--------------------------------------------------------------------------
    ;----- To install UXP update, UXP must already installed- but not NFS.
    ;----- Check for the existence of NFS.  If it exists then don't install UXP
    ReadProductRecord NFS, 0, ID, cCode
    GotoIfEqual %{cCode}, 0, NOUXP

    ;----- Check for the existence of UXP
    ReadProductRecord PRTS, 0, ID, cCode
    GotoIfNEqual %{cCode}, 0, NOUXP
    ;----- Install only if less than 2.11 or greater than 2.12 don't install.
    SGotoIfLess %{ID}, "2.11", NOUXP
	SGotoIfGreater %{ID}, "2.12", NOUXP

    GetPath SourceDrive,1, '%{NotLocalizedProducts}\\UXP', '', NWSRC

	Display 2, "Copying Unix Print Services files..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3
    CopyFile 1,1,1,1,0,NWIP_UPX_COMMON,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tUnix Print Services (PRTS) updated from %{ID} to v2.12c'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto UXP_DONE

Label NOUXP
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tUnix Print Services (PRTS) not updated.  Product not found.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

Label UXP_DONE


;--------------------------------------------------------------------------
;----- WEB SERVER -----
;--------------------------------------------------------------------------
;    ;----- Check for the existence of Web Server
;    ReadProductRecord WEB, 0, ID, cCode
;    GotoIfNEqual %{cCode}, 0, NOWEB
;    SGotoIfNEqual %{ID}, "3.1", NOWEB
;
;    GetPath SourceDrive,1, '%{NotLocalizedProducts}\\WEB', '', NWSRC
;
;	Display 2, "Copying WEB Server files..."
;    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3
;
;	;----- Add entry to Log file -----
;	PI_EditNCF_Addline ''
;	PI_EditNCF_Addline '\tWeb Server update v3.1'
;	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
;	Goto WEB_DONE
;
;Label NOWEB
;	;----- Add entry to Log file -----
;	PI_EditNCF_Addline ''
;	PI_EditNCF_Addline '\tWeb Server not updated.  Product not found.'
;	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
;
;Label WEB_DONE

;--------------------------------------------------------------------------
;----- DHCP -----
;--------------------------------------------------------------------------

    ;----- Check for the existence of DHCP
    ReadProductRecord DHCPSRVR, 0, ID, cCode
    GotoIfNEqual %{cCode}, 0, NODHCP
    SGotoIfNEqual %{ID}, "V2.0", NODHCP

    GetPath SourceDrive,1, '%{NotLocalizedProducts}\\DHCP', '', NWSRC

	Display 2, "Copying DHCP files..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tDHCP updated from %{ID} to v2.5.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto DHCP_DONE

Label NODHCP
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tDHCP not updated.  Product not found.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

Label DHCP_DONE



;--------------------------------------------------------------------------
;    COMMON- These products get installed for all servers regardless of language
;--------------------------------------------------------------------------
Label COMMON




;--------------------------------------------------------------------------
;----- NetWare for Macintosh -----
;--------------------------------------------------------------------------

    ;----- Check for the existence of NW_MAC
    ReadProductRecord "NW-MAC", 0, ID, cCode
    GotoIfNEqual %{cCode}, 0, NOMAC
    SGotoIfLess %{ID}, "v4.11", NOMAC 

    GetPath SourceDrive,1, '%{SourceCommonProducts}\\NWMAC', '', NWSRC

	Display 2, "Copying NetWare for Machintosh files..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tNetWare for Macintosh printing (v4.11) update'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto MAC_DONE

Label NOMAC
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tNetWare for Macintosh printing not updated.  Product not found.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

Label MAC_DONE



; -------------------------------------------------------------------------------------------------
;                                    END OTHER PRODUCTS SECTION
; -------------------------------------------------------------------------------------------------







; -------------------------------------------------------------------------------------------------
;                                OPERATING SYSTEM UPDATES AND PATCHES 
; -------------------------------------------------------------------------------------------------


    ; --------------------------------------------------------------------------
    ;
    ; List of old patches (NetWare 4.10) that may be in the NCF files.  This list
    ; is used later to remove the entries.
    ;
    ; --------------------------------------------------------------------------
    PI_EditNCF_KEYSTRINGS

     'adtrstfx','alequefx','alldirfx','alwritfx','auddirfx','audnspfx',
     'autodump','brdcstfx','chklanfx','clrdirfx','clsscrfx','comabrfx',
     'comcopfx','comredfx','comsdsfx','comstpfx','comupdfx','credirfx',
     'crtdirfx','diag410 ','dsprcsfx','duplicfx','eadflgfx','eapurgfx',
     'eavlmtfx','eofredfx','evntrpfx','exvmgtfx','fndsymfx','getdirfx',
     'getvinfx','getvolfx','ipxhanfx','ipxstafx','lckstnfx','lsllckfx',
     'lsltimfx','macreqfx','mapconfx','maxpckfx','memcolfx','migfrefx',
     'miginifx','migkeyfx','migstrfx','mmdismfx','mmmirrfx','mmremmfx',
     'msinpqfx','msshim  ','mssmemfx','msvolmfx','nsmodffx','nswildfx',
     'opnclbfx','pboutwfx','prgdelfx','prgfilfx','protidfx','pubrecfx',
     'readflfx','regopnfx','relquefx','rendirfx','respolfx','ripfix  ',
     'rpcerrfx','rtconnfx','serperfx','shrramfx','shrresfx','srsyncfx',
     'srvprsfx','srvstpfx','stdrchfx','stpsrvfx','sublckfx','subspcfx',
     'synmemfx','synmsgfx','synthrfx','timresfx','totblkfx','unkspcfx',
     'vgenfufx','watdogfx','worktdfx','swtintfx',
     'PM410'   ,'PMLOAD  ','Activate Server',
     ''   ; Last entry MUST be null string (indicates end of list)

    ;----- Note that SMPSHMFX is not in the list because the SMP install
    ;-----   handles that patch explicitely on its own.

    ;----- Copy updated NLMS to the SYS: Volume
	Display 2, "Copying updated NLMs to SYS:SYSTEM..."
    CopyFile 1, 1, 0, 1, 0, SourceCommonSYS, '', '', '', DestSYS, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tUpdated operating system files in SYS:SYSTEM.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


    ;----- Determine which OS
    GotoIfEqual 0, '%{PI_OSType}', InstallPatches_NonSFT3
    GotoIfEqual 1, '%{PI_OSType}', InstallPatches_NonSFT3
    GotoIfEqual 2, '%{PI_OSType}', InstallPatches_SFT3

    Display 0, 'Unknown OS Type %{PI_OSType}'
    Goto EXIT


; --------------------------------------------------------------------------
;
; Native and NetWare OS2 Section
;
; --------------------------------------------------------------------------
Label InstallPatches_NonSFT3
    ;----- Synchronize SPACK source with NWBOOT
    CopyFile 0, 1, 0, 2, 0, SourceCommonSYS, 'SYSTEM', '', '', NWBOOT, '', '', '', 9

	CheckFile NotLocalized, %{NWLANG}, '', ''
	GotoIfNEqual '%{NWSTATUS}', 0, Boot_Not_Localized      
	;----- Synchronize SPACK source with NWBOOT for Language Specific files
    CopyFile 0, 1, 0, 2, 0, NotLocalizedSYS, 'SYSTEM', '', '', NWBOOT, '', '', '', 9

label Boot_Not_Localized

    ;----- Edit the NCF FILES
    Display 2, "Modifying STARTUP.NCF, comments added to highlight changes, original file renamed STARTUP.PT"

    GetPath startupDir, 3, '%{NWBOOT}', '', NWBOOT
    GetPath autoexecDir, 3, 'SYS:SYSTEM', ''

    ;--- Edit AUTOEXEC.NCF
    ; Clear the list of lines
    PI_EditNCF_ADDLINE ''        ; (not adding anything)
    PI_EditNCF autoexecDir, 'AUTOEXEC.NCF', '.PT', ccode

    ;----- Copy Patches to Boot directory
	Display 2, "Copying OS patches to %{NWBOOT}..."
    CopyFile 1, 1, 1, 2, 0, PatchSrc, '', '', '',PatchDest, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tUpdated operating system files on the DOS Partition.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


    ;----- Swap the loader
    Display 2, "Updating SERVER.EXE with a new version of LOADER.EXE. Old file renamed SERVER.OLD"
    NLMExec2 1, '%{NWBOOT}\\LSWAP %{NWBOOT}\\LOADER.EXE %{NWBOOT}\\SERVER.EXE', cCode
	GotoIfEqual %{cCode}, 0, NO_ERROR_LSWAP
		Display 1, "LSWAP failed to swap loader in server.exe."

Label NO_ERROR_LSWAP

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tUpdated SERVER.EXE'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


    ;----- Load PK411 and the patches
    Display 2, "Loading PK411"
    NLMExec2 0, '%{PatchDest}\\PK411.NLM', ccode

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tLoaded PK411.NLM.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


    ;----- Edit STARTUP.NCF
    ;-----  Add PK411 (Patch loader to the top of STARTUP.NCF)
    PI_EditNCF_ADDLINE ''        ; (not adding anything)
    PI_EditNCF_ADDLINE '; The following lines were moved or added by the IntranetWare Support Pack'
    PI_EditNCF_ADDLINE 'LOAD %{PatchDest}\\PK411.NLM'
    PI_EditNCF_ADDLINE '; End of modifications made by IntranetWare Support Pack installation'
    PI_EditNCF_ADDLINE ' '  ;Add blank Line
    PI_EditNCF startupDir, 'STARTUP.NCF', '.PT', ccode

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tAdded PK411.NLM to STARTUP.NCF'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


    goto COMMON_FINISH_UP

; --------------------------------------------------------------------------
;
; End of Native and NetWare OS2 Section
;
; --------------------------------------------------------------------------



    

; --------------------------------------------------------------------------
;
; SFT3 Section
;
; --------------------------------------------------------------------------

Label InstallPatches_SFT3
    ;-----  Stuff that happens once

    ;----- Note that PI_ICMD.NLM assumes that PI_IOCON.NLM and PI_IOMKD.NLM are located in SYS:SYSTEM.
    ;CopyToServer SYSTEM, PI_IOCON.NLM, '', ''
    ;CopyToServer SYSTEM, PI_IOMKD.NLM, '', ''

label GetOldEngineNum
    GetDOSServer saveEngineNum
    ValueSet engineNum, '-1'
    goto SFT3_CopyIOEngine

Label SFT3_CopyIOEngine
    ;----- Loop until engineNum = 2
    ValueAdd engineNum, 1
    GotoIfEqual 2, '%{engineNum}', SFT3_Done

    ;-----  Stuff that happens for each engine
    SetDOSServer %{engineNum}, ccode
    GotoIfEqual 0, %{ccode}, SFT3_IOEnginePresent
    display 0, 'IOEngine[%{engineNum}] not present (will be skipped)'
    Goto SFT3_CopyIOEngine

    Label SFT3_IOEnginePresent
    GetPath startupDir, 3, '%{NWBOOT}', '', NWBOOT
    GetPath PatchDest, 3, '%{NWBOOT}', '', NWBOOT
    GetPath DestBootDrive, 3, '%{NWBOOT}', '', NWBOOT

    ;----- Copy Patches
    Display 2, "Copying OS patches to %{NWBOOT}"
    CopyFile 1, 1, 1, 2, 0, PatchSrc, '', '', '',PatchDest, '', '', '', 0

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tUpdated operating system files on the DOS partition for engine %{engineNum}.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


    ;----- Synchronize SPACK Source with NWBOOT
    CopyFile 0, 1, 0, 2, 0, SourceCommonSYS, 'SYSTEM', '', '', NWBOOT, '', '', '', 9


	CheckFile NotLocalized, %{NWLANG}, '', ''
	GotoIfNEqual '%{NWSTATUS}', 0, SFT_Boot_Not_Localized      
 ;	GotoIfNEqual %{NWLANG}, 4, NOENG_SFTIII
	;----- Synchronize SPACK source with NWBOOT for Language Specific files
    CopyFile 0, 1, 0, 2, 0, NotLocalizedSYS, 'SYSTEM', '', '', NWBOOT, '', '', '', 9
label SFT_Boot_Not_Localized


;----- Edit the NCF FILES

;----- Edit IOSTART.NCF
    Display 2, "Modifying IOSTART.NCF- comments added to highlight changes.  Old file named IOSTART.PT"
    ;----- Clear the list of lines
    PI_EditNCF_ADDLINE ''
    ;------ Define the list of lines to be added at the top of the NCF file
    PI_EditNCF_ADDLINE '; The following lines were moved and/or added by the IntranetWare Support Pack installation'
    ;----- Search for a "SET NEW START ADDRESS FOR UNCLAIMED..." command in IOSTART.NCF.
    PI_SrchNCF startupDir, 'IOSTART.NCF', 'New Start Address For Unclaimed Memory Block', NewStartReturnedLine, ccode
    GotoIfNEqual  0, '%{ccode}', SkipNewStartAddline
          PI_EditNCF_ADDLINE '%{NewStartReturnedLine}'

Label SkipNewStartAddline
    ;----- Search for a "SET NEW END ADDRESS FOR UNCLAIMED..." command in IOSTART.NCF.
    PI_SrchNCF startupDir, 'IOSTART.NCF', 'New End Address For Unclaimed Memory Block', NewEndReturnedLine, ccode
    GotoIfNEqual 0, '%{ccode}', SkipNewEndAddline
          PI_EditNCF_ADDLINE '%{NewEndReturnedLine}'
    goto SkipNewEndAddline

Label SkipNewEndAddline
    PI_EditNCF_ADDLINE 'LOAD %{PatchDest}\\PK411.NLM'
    PI_EditNCF_ADDLINE '; End of modifications made by IntranetWare Support Pack installation'
    PI_EditNCF_ADDLINE ' ' ;Add blank Line
    ;----- Now actually edit the NCF file...
    PI_EditNCF startupDir, 'IOSTART.NCF', '.PT', ccode

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tAdded PK411.NLM to IOSTART.NCF'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


;----- Edit IOAUTO.NCF
    ;----- Clear the list of lines
    PI_EditNCF_ADDLINE ''        ; (not adding anything)
    PI_EditNCF startupDir, 'IOAUTO.NCF', '.PT', ccode

;----- Edit MSSTART.NCF
    Display 2, "Modifying MSSTART.NCF-comments added to highlight changes.  Old file named MSSTART.PT"
    ;----- Clear the list of lines
    PI_EditNCF_ADDLINE ''        ; (not adding anything)
    ;----- Define the list of lines to be added at the top of the NCF file
    PI_EditNCF_ADDLINE '; The following two lines were added by the IntranetWare Support Pack installation'
    PI_EditNCF_ADDLINE 'LOAD %{PatchDest}\\PK411.NLM'
    PI_EditNCF_ADDLINE ' ' ;Add blank Line
    PI_EditNCF startupDir, 'MSSTART.NCF', '.PT', ccode

;----- Edit MSAUTO.NCF
    ;----- Clear the list of lines
    PI_EditNCF_ADDLINE ''        ; (not adding anything)
    PI_EditNCF autoexecDir, 'MSAUTO.NCF', '.PT', ccode

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tAdded PK411.NLM to MSSTART.NCF'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


;----- Swap the loader
    Display 2, "Updating MSERVER.EXE with latest version of LOADER.EXE, old file named MSERVER.OLD"
    NLMExec2 1, '%{NWBOOT}\\LSWAP %{NWBOOT}\\LOADER.EXE %{NWBOOT}\\MSERVER.EXE', ccode
	GotoIfEqual %{cCode}, 0, SFTIII_NO_ERROR_LSWAP
		Display 1, "LSWAP failed to swap loader in server.exe."
Label SFTIII_NO_ERROR_LSWAP

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tUpdated MSERVER.EXE.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode



;----- Load PK411 and patches in IOEngine
    Display 2, "Loading PK411 in IOEngine"
    NLMExec2_IO 0, '%{PatchDest}\\PK411.NLM', ccode
    goto SFT3_CopyIOEngine

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tLoaded PK411.NLM in IOEngine.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


Label SFT3_Done
    ;----- Set DOS server back to original engine number
    SetDOSServer %{saveEngineNum}, ccode

    ;----- Load PK411 and patches in MSEngine
    Display 2, "Loading PK411.NLM in MSEngine"
    NLMExec2 0, '%{PatchDest}\\PK411.NLM', ccode

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tLoaded PK411.NLM in MSEngine.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


    Goto COMMON_FINISH_UP


;-------------------------------------------------------------------------------
;
; End of SFT3 Section
;
;-------------------------------------------------------------------------------



;-------------------------------------------------------------------------------
;
; Cleanup Section
;
;-------------------------------------------------------------------------------

Label COMMON_FINISH_UP
    ;----- Remove old records (we now just use OS_PATCHES)
    Display 2, "Removing old records from PRODUCT.DAT file"
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL 410PT3', ccode
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL 410PT4', ccode
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL 410IT6'  ccode
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL 410PT6'  ccode
;   NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL NWUPD'  ccode
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL PRTS_UPD'  ccode
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL WEB_UPD'  ccode
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL DHCP_UPD'  ccode 
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL NWMACUPD'  ccode
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL MPR_UPD'  ccode
    NLMExec2 1, 'SYS:\\SYSTEM\\UINSTALL MPR30_PTF'  ccode


	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tRemoved old entries from Products.dat.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode



    ;----- Update OS_PATCHES record in PRODUCTS.DAT
    ;----- We have a problem using %{SupportPackVersion} variable as part of the ProductRecord description.
    ;----- NetWare for OS/2 will page fault for some customers adding the ProductRecord.
    ;    GotoIfEqual 1, '%{PI_OSType}', SkipProductRecord_ForNWOS2
    ;    ProductRecord PATCHKIT, 1, "NetWare v4.11 Support Pack 411SP(Rel_Ver. B)"
    ;    Label SkipProductRecord_ForNWOS2

    ProductRecord SPACK, 1, "V4.0 Support Pack for NetWare 4.11 (9/97)"
    ProductRecord SPACK, 0, "4.0"
	ProductRecord SPACK, 3, "SYS:SYSTEM\\SPACKLOG.TXT"

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tAdded SPACK entry to Products.dat.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


    ;----- Setup closing screens dependent on the version of OS.
    GotoIfEqual 2, '%{PI_OSType}', CloseScreen_SFT3

    Display 0, "IntranetWare Support Pack installation is complete!\n\n Thank you for installing the IntranetWare Support Pack.
        Please review the NCF files for accuracy.  Please notify users, then DOWN the server and RESTART SERVER to
complete the installation."
    Goto EXIT


Label CloseScreen_SFT3
    Display 0,     "IntranetWare Support Pack installation is complete!\n\n Thank you for installing the IntranetWare Support Pack.
       ISSUE:\n\n

      NetWare SFT III parses the IOSTART.NCF by scanning the file twice.\n
      First pass to scan for all SET parameters, except for the following:\n\n

       Set New Start Address For Unclaimed Memory Block\n
       Set New End Address For Unclaimed Memory Block\n\n

      Second pass to scan for LOAD commands and the two SET parameters listed above.
      The LOAD command and SET parameters are executed in the order that they appear
      in the NCF file..\n\n

      This IntranetWare Support Pack installation makes an attempt to move the two SET parameters above
      the LOAD statement for the IntranetWare Support Pack."

    Display 0,    "Novell recommends that all SFT III configurations have ALL SET parameters before
      ALL LOAD commands\n\n

      Novell also recommends that all SFT III installations have a minimum of 12 Meg of memory for
      each IO Engine adding the following to the IOSTART.NCF:\n\n

       Set New Start Address For Unclaimed Memory Block=12000000\n\n

      This eliminates the following ABEND:\n
      ABEND: SERVER-4.10-385: Insufficient memory available to allocate enough receive buffers
      is a result of having insufficient IOEngine memory and also loading the patches before
      the SET parameters.\n\n

      Please review the NCF files for accuracy then DOWN the server and RESTART SERVER to complete the IntranetWare
	  Support Pack installation."
    Goto EXIT

Label EXIT

@EndFileSet

	;----- Clean up temporary direcotry -----
    EraseFile 0, TempInstallDir, '','',''

	;----- Add last entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\t----- End install of Support Pack %{SupportPackVersion} -----'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

[ RETURN TO DIRECTORY ]