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: "File di backup che verranno sostituiti da IntranetWare Support Pack v4.0 ."
	Name:  SPACK_BACKUP
	Class: OPTIONAL
	Help:  "L'opzione Backup del file effettuerà il backup dei file prima di sovrascriverli. Questi file verranno copiati nel percorso SYS:\\SYSTEM\\!BACKUP.SP4"

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

@EndFileSet


@FileSet
	Description:  "Installa IntranetWare Support Pack v4.0. "
	Name: IntranetWare
	CLASS: OPTIONAL
	Help:  "Installa il file di IntranetWare Support Pack 4.0 nel server."

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


	GotoIfEqual %{itemSelected}, %{true}, MENU_SELECTED
		Display 0, "ERRORE: non è stata selezionata una voce di menu."
		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, "Questa versione di IntranetWare Support Pack funziona solamente con IntranetWare o 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, "La versione %{ID} di IntranetWare Support Pack è già installata.\n\nL'installazione verrà interrotta."
		SetVar done, %{true}
Label INSTALLPACK


	GotoIfEqual %{done}, %{true}, NO_MESSAGE
		Display 1, "Installazione di IntranetWare Support Pack 4.0\n\nQuesta installazione 
					rileverà automaticamente i servizi ed installerà gli aggiornamenti 
					a IntranetWare, a NetWare 4.11 e ai servizi rilevati.\n\n
					Se si è selezionata l'opzione per il backup, il backup di questi file 
					verrà effettuato nella directory SYS:\\SYSTEM\\!BACKUP.SP4.\n\nPremer <ESC> per annullare."
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----- Inizio installazione di Support Pack %{SupportPackVersion} -----'
	PI_EditNCF_Addline '  '
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode

	GotoIfEqual %{cCode}, 0, LOG_OK
		Display 0, "Impossibile scrivere nel file di log: %{LogFile}."
Label LOG_OK

Label NO_MENU_SELECTED



; --------------------------------------------------------------------------
;       Backup Fileset
; --------------------------------------------------------------------------
@FileSet
	Description: "File di backup che verranno sostituiti da IntranetWare Support Pack v4.0."
	Name: BACKUP
	Help:  "L'opzione Backup dei file effettuerà il backup dei file prima di sovrascriverli. Questi file verranno copiati nel percorso SYS:\\SYSTEM\\!BACKUP.SP4"

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



; --------------------------------------------------------------------------
;       IntranetWare Support Pack Fileset
; --------------------------------------------------------------------------
@FileSet
	Description:  "Installa IntranetWare Support Pack v4.0."
	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, "Impossibile modificare NWCSTART.NCF"
		;----- Add entry to Log file -----
		PI_EditNCF_Addline ''
		PI_EditNCF_Addline '\tImpossibile modificare NWCSTART.NCF. Codice di errore:%{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}, 8, 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}, 8, COMMON

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

	;----- Copy to the SYS: Volume for files not localized.
	Display 2, "Copia dei file di sistema specifici della lingua..."
	CopyFile 1, 1, 0, 1, 0, NotLocalizedSYS, '', '', '', DestSYS, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tFile di sistema specifici alla lingua per il sistema operativo.'
	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, "Copia dei file di MPR 3.1..."
    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 '\tAggiornamento di Multiprotocol Router 3.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, "Copia dei file di MPR 3.0..." 
    CopyFile 1,1,1,1,0,MPRCommon,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tAggiornamento di Multiprotocol Router 3.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, "Copia dei file NetWare/IP..."
    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 aggiornato dalla versione %{ID} alla 2.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 non aggiornato. Prodotto non trovato.'
	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, "Copia dei file dei servizi di stampa Unix..."
    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 '\tServizi di stampa Unix (PRTS) aggiornati dalla versione %{ID} alla 2.12c'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto UXP_DONE

Label NOUXP
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tServizi di stampa Unix (PRTS) non aggiornati. Prodotto non trovato.'
	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, "Copia dei file DHCP..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tDHCP aggiornato dalla versione %{ID} alla 2.5.'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto DHCP_DONE

Label NODHCP
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tDHCP non aggiornato. Prodotto non trovato.'
	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, "Copia dei file di NetWare per Macintosh..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tAggiornamento dei file di stampa di NetWare per Macintosh (versione 4.11)'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto MAC_DONE

Label NOMAC
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tFile di stampa di NetWare per Macintosh non aggiorntai. Prodotto non trovato.'
	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, "Copia degli NLM aggiornati in 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, 'Tipo di OS sconosciuto %{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, "Modifica del file STARTUP.NCF. Aggiunti commenti per evidenziare i cambiamenti. File originale rinominato 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, "Copia dei patch dell'OS in %{NWBOOT}..."
    CopyFile 1, 1, 1, 2, 0, PatchSrc, '', '', '',PatchDest, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tFile del sistema operativo aggiornati sulla partizione DOS.'
	PI_EditNCF      autoexecDir, '%{LogFile}', '.BAK', cCode


    ;----- Swap the loader
    Display 2, "Aggiornamento di SERVER.EXE con una nuova versione di LOADER.EXE. Vecchio file rinominato SERVER.OLD"
    NLMExec2 1, '%{NWBOOT}\\LSWAP %{NWBOOT}\\LOADER.EXE %{NWBOOT}\\SERVER.EXE', cCode
	GotoIfEqual %{cCode}, 0, NO_ERROR_LSWAP
		Display 1, "LSWAP non è riuiscito a scambiare il caricatore 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, "Caricamento di 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}] non presente (verrà ignorato)'
    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, "Copia dei patch all'OS in %{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}, 8, 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, "Modifica di IOSTART.NCF. Aggiunti commenti per evidenziare i cambiamenti. File vecchio rinominato 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 '; Fine delle modifiche eseguite dall'installazione di IntranetWare Support Pack '
    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, "Modifica di MSSTART.NCF. Aggiunti commenti per evidenziare i cambiamenti. File vecchio rinominato 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, "Aggiornamento di MSERVER.EXE con la versione pi∙ recente di LOADER.EXE. Vecchio file rinominato MSERVER.OLD"
    NLMExec2 1, '%{NWBOOT}\\LSWAP %{NWBOOT}\\LOADER.EXE %{NWBOOT}\\MSERVER.EXE', ccode
	GotoIfEqual %{cCode}, 0, SFTIII_NO_ERROR_LSWAP
		Display 1, "LSWAP non è riuscito a scambiare il caricatore 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, "Caricamento di PK411 in IOEngine"
    NLMExec2_IO 0, '%{PatchDest}\\PK411.NLM', ccode
    goto SFT3_CopyIOEngine

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\t\tPK411.NLM aggiornato 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, "Caricamento di PK411.NLM in MSEngine"
    NLMExec2 0, '%{PatchDest}\\PK411.NLM', ccode

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tPK411.NLM aggiornato 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, "Rimozione dei vecchi record dal file PRODUCT.DAT"
    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 '\tVoci obsolete rimosse da 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, "Support Pack 4.0 per 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 '\tAggiunta voce SPACK a 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, "Installazione di IntranetWare Support Pack completata.\n\nGrazie di aver installato IntranetWare Support Pack. 
	Visualizzare i file NCF per controllarne l'accuratezza. Avvisare gli utenti, scollegare il server col comando DOWN e riavviarlo col comando RESTART SERVER per 
completare l'installazione."
    Goto EXIT


Label CloseScreen_SFT3
    Display 0,     "Installazione di IntranetWare Support Pack completata.\n\nGrazie di aver installato IntranetWare Support Pack.
       NOTA:\n\n

      NetWare SFT III analizza il file IOSTART.NCF effettuandone due volte la scansione.\n
      La prima volta per fare la scansione di tutti i parametri SET, tranne i seguenti:\n\n

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

      La seconda volta per fare la scansione dei comandi LOAD e dei due parametri SET elencati sopra.
      Il comando LOAD e i parametri SET vengono eseguiti nell'ordine in cui appaiono 
      nel file NCF.\n\n

      Questa installazione di IntranetWare Support Pack effettua un tentativo di spostare i due parametri SET al di sopra 
      dell'istruzione LOAD relativa a IntranetWare Support Pack."

    Display 0,    "Novell raccomanda che in tutte le configurazioni SFT III TUTTI i parametri SET vengano inseriti prima di 
      TUTTI i comandi LOAD.\n\n

      Novell raccomanda inoltre che tutte le installazioni SFT III abbiano un minimo di 12 MB di memoria per ciascun IO Engine. Per impostare questo 
      valore, aggiungere quanto segue al file IOSTART.NCF:\n\n

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

      Ciò previene la seguente ABEND:\n
      ABEND: SERVER-4.10-385: L'insufficienza di memoria disponibile per allocare un numero sufficiente di buffer di ricezione è causata 
      dall'insufficienza di memoria IOEngine e dal caricamento dei patch prima 
      dei parametri SET.\n\n

      Visualizzare i file NCF per verificarne l'accuratezza, quindi scollegare il server col comando DOWN e riavviarlo col comando RESTART SERVER per completare l'installazione di 
	  IntranetWare Support Pack."
    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 ]