Metropoli BBS
VIEWER: 411spack.ips MODE: TEXT (CP437)
@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: "Dateien, die durch v4.0 IntranetWare-Support Pack ersetzt werden, sichern."
	Name:  SPACK_BACKUP
	Class: OPTIONAL
	Help:  "Die Option 'Datei sichern' wird Dateien vor der Überschreibung sichern. Diese Dateien werden in SYS:\\SYSTEM\\!BACKUP.SP4 kopiert."

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

@EndFileSet


@FileSet
	Description:  "v4.0 IntranetWare-Support Pack installieren."
	Name: IntranetWare
	CLASS: OPTIONAL
	Help:  "v4.0 IntranetWare-Support Pack-Datei auf Ihrem Server installieren."

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


	GotoIfEqual %{itemSelected}, %{true}, MENU_SELECTED
		Display 0, "FEHLER:  Kein Menüeintrag ausgewählt."
		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, "Diese Version von IntranetWare-Support Pack ist nur mit IntranetWare oder NetWare 4.11 kompatibel."
		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} von IntranetWare-Support Pack bereits installiert.\n\nInstallation wird abgebrochen."
		SetVar done, %{true}
Label INSTALLPACK


	GotoIfEqual %{done}, %{true}, NO_MESSAGE
		Display 1, "IntranetWare-Support Pack 4.0-Installation\n\nDiese Installation wird die Services automatisch
			    ermitteln und die Aktualisierungen von IntranetWare,NetWare 4.11 und diese 
			    Services installieren. \n\n
			    Wenn die Backup-Option ausgewählt ist, werden diese Dateien im Verzeichnis
			    SYS:\\SYSTEM\\!BACKUP.SP4 gesichert.\n\n Abbrechen mit <ESC>."
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, "Schreiben in Protokolldatei nicht möglich:  %{LogFile}."
Label LOG_OK

Label NO_MENU_SELECTED



; --------------------------------------------------------------------------
;       Backup Fileset
; --------------------------------------------------------------------------
@FileSet
	Description: "Dateien, die durch v4.0 IntranetWare-Support Pack ersetzt werden, sichern."
	Name: BACKUP
	Help:  "Die Option 'Datei sichern' wird Dateien vor der Überschreibung sichern. Diese Dateien werden in SYS:\\SYSTEM\\!BACKUP.SP4 kopiert."

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



; --------------------------------------------------------------------------
;       IntranetWare Support Pack Fileset
; --------------------------------------------------------------------------
@FileSet
	Description:  "v4.0 IntranetWare-Support Pack installieren."
	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, "Bearbeiten von NWCSTART.NCF nicht möglich"
		;----- Add entry to Log file -----
		PI_EditNCF_Addline ''
		PI_EditNCF_Addline '\tBearbeiten von NWCSTART.NCF nicht möglich.  Fehlercode:%{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}, 7, 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}, 7, COMMON

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

	;----- Copy to the SYS: Volume for files not localized.
	Display 2, "Sprachspezifische Systemdateien werden kopiert..."
	CopyFile 1, 1, 0, 1, 0, NotLocalizedSYS, '', '', '', DestSYS, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tSprachspezifische Systemdateien für das Betriebssystem.'
	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, "MPR 3.1-Dateien werden kopiert..."
    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 '\tAktualisierung des Multiprotokoll-Router V3.1 (MPR)'
	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, "MPR 3.0-Dateien werden kopiert..." 
    CopyFile 1,1,1,1,0,MPRCommon,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tAktualisierung des Multiprotokoll-Router V3.0 (MPR)'
	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, "NetWare/IP-Dateien werden kopiert..."
    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 von %{ID} auf v2.2d aktualisiert.'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto NWIP_DONE

Label NONWIP
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tNetware IP nicht aktualisiert.  Produkt nicht gefunden.'
	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, "Unix-Druck-Services-Dateien werden kopiert..."
    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-Druck-Services (PRTS) von %{ID} auf v2.12c aktualisiert'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto UXP_DONE

Label NOUXP
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tUnix-Druck-Services (PRTS) nicht aktualisiert.  Produkt nicht gefunden.'
	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, "WEB-Server-Dateien werden kopiert..."
;    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, "DHCP-Dateien werden kopiert..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3

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

Label NODHCP
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tDHCP nicht aktualisiert.  Produkt nicht gefunden.'
	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, "NetWare für Machintosh-Dateien werden kopiert..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tAktualisierung der NetWare für Macintosh-Druckfunktion (v4.11)'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto MAC_DONE

Label NOMAC
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tNetWare für Macintosh-Druckfunktion nicht aktualisiert.  Produkt nicht gefunden.'
	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, "Aktualisierte NLMs werden in SYS:SYSTEM kopiert..."
    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, "STARTUP.NCF wird bearbeitet. Änderungen werden durch Kommentare angegeben. Ursprüngliche Datei in STARTUP.PT umbenannt."

    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, "OS-Patches werden in %{NWBOOT} kopiert..."
    CopyFile 1, 1, 1, 2, 0, PatchSrc, '', '', '',PatchDest, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tBetriebssystemdateien auf der DOS-Partition aktualisiert.'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode


    ;----- Swap the loader
    Display 2, "SERVER.EXE wird mit neuer Version von LOADER.EXE aktualisiert. Alte Datei in SERVER.OLD umbenannt."
    NLMExec2 1, '%{NWBOOT}\\LSWAP %{NWBOOT}\\LOADER.EXE %{NWBOOT}\\SERVER.EXE', cCode
	GotoIfEqual %{cCode}, 0, NO_ERROR_LSWAP
		Display 1, "LSWAP hat Loader in SERVER.EXE nicht ausgewechselt."

Label NO_ERROR_LSWAP

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


    ;----- Load PK411 and the patches
    Display 2, "PK411 wird geladen"
    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 '\tPK411.NLM zur STARTUP.NCF hinzugefügt'
	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, "OS-Patches werden in %{NWBOOT} kopiert"
    CopyFile 1, 1, 1, 2, 0, PatchSrc, '', '', '',PatchDest, '', '', '', 0

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tBetriebssystemdateien auf der DOS-Partition für Engine %{engineNum} aktualisiert.'
	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}, 7, 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, "IOSTART.NCF wird bearbeitet. Änderungen werden durch Kommentare angegeben.  Alte Datei in IOSTART.PT umbenannt."
    ;----- 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 ';Ende der von der IntranetWare-Support Pack-Installation durchgeführten Änderungen'
    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, "MSSTART.NCF wird bearbeitet. Änderungen werden durch Kommentare angegeben. Alte Datei in MSSTART.PT umbenannt."
    ;----- 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 '\tPK411.NLM zur MSSTART.NCF hinzugefügt'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode


;----- Swap the loader
    Display 2, "MSERVER.EXE wird mit neuester Version von LOADER.EXE aktualisiert. Alte Datei in MSERVER.OLD umbenannt."
    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 '\tMSERVER.EXE aktualisiert.'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode



;----- Load PK411 and patches in IOEngine
    Display 2, "PK411 wird in IOEngine geladen"
    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, "PK411.NLM wird in MSEngine geladen"
    NLMExec2 0, '%{PatchDest}\\PK411.NLM', ccode

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tPK411.NLM in MSEngine geladen.'
	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, "Alte Datensätze werden aus der Datei PRODUCT.DAT entfernt."
    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 '\tAlte Einträge aus Products.dat entfernt.'
	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 für 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 '\tSPACK-Eintrag zur Products.dat hinzugefügt.'
	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 abgeschlossen!\n\n Vielen Dank für das in IntranetWare-Support Pack gesetzte Vertrauen.
	Bitte die NCF-Dateien überprüfen.  Die Benutzer benachrichtigen und zum Abschließen der Installation den Server herunterfahren
und dann neu starten."
    Goto EXIT


Label CloseScreen_SFT3
    Display 0,     "IntranetWare-Support Pack-Installation abgeschlossen!\n\n Vielen Dank für das in NetWare-Client 32 gesetzte Vertrauen.
       THEMA:\n\n

      NetWare SFT III analysiert die Datei IOSTART.NCF zweimal.\n
      Bei der ersten Analyse werden alle SET-Parameter durchsucht, außer:\n\n

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

      Bei der zweiten Analyse werden der LOAD-Befehl und die beiden obigen SET-Parameter durchsucht.
      Die LOAD-Befehle und SET-Parameter werden in der aufgelisteten Reihenfolge
      ausgeführt..\n\n

      Die IntranetWare-Support Pack-Installation versucht, die beiden obigen SET-Parameter und
      die Anweisung zum Laden von IntranetWare-Support Pack zu verschieben."

    Display 0,    "Es ist ratsam, daß in allen SFT III-Konfigurationen alle SET-Parameter
      vor allen LOAD-Parametern aufgelistet werden.

      Darüber hinaus ist es ratsam, daß für alle SFT-III-Installationen mindestens 12 Meg
      Speicher für jede IO Engine zur Verfügung stehen. Die folgende Zeile wird IOSTART.NCF
      hinzugefügt:\n\n

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

      Dadurch wird der folgende Abbruch vermieden:\n
      ABBRUCH: SERVER-4.10-385: Nicht genug Speicher für Empfangspuffer. Ursache: Nicht
      genug IOEngine-Speicher und Patches werden vor den SET-Parametern geladen.\n\n 

      Die NCF-Dateien überprüfen. Zum Abschluß der IntranetWare-Support Pack-Installation den
      Server herunterfahren und dann neu starten."
    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----- Installation von Support Pack %{SupportPackVersion} abschließen -----'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode

[ RETURN TO DIRECTORY ]