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: "Fazer backup dos arquivos que serao substituídos pelo IntranetWare Support Pack v4.0."
	Name:  SPACK_BACKUP
	Class: OPTIONAL
	Help:  "A opçao Backup de arquivos fará arquivos de backup antes de sobregravar arquivos. Esses arquivos sao copiados para SYS:\\SYSTEM\\!BACKUP.SP4"

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

@EndFileSet


@FileSet
        Description:  "Instalar o IntranetWare Support Pack v4.0."
	Name: IntranetWare
	CLASS: OPTIONAL
	Help:  "Instala os arquivos do IntranetWare Support Pack v4.0 em seu servidor."

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


	GotoIfEqual %{itemSelected}, %{true}, MENU_SELECTED
		Display 0, "ERRO: Nao foi selecionado um item no 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, "Esta versao do IntranetWare Support Pack funciona apenas com o IntranetWare ou 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, "A versao %{ID} do IntranetWare Support Pack já está instalada.\n\nA instalaçao será abortada."
		SetVar done, %{true}
Label INSTALLPACK


	GotoIfEqual %{done}, %{true}, NO_MESSAGE
		Display 1, "Instalaçao do IntranetWare Support Pack 4.0\n\nEsta instalaçao autodetectará
					os serviços e instalará atualizaçoes do IntranetWare, NetWare 4.11 
					e esses serviços. \n\n
					Se a opçao de backup foi selecionada, o backup será feito no diretório SYS:\\SYSTEM\\!BACKUP.SP4.\n\n Pressione <ESC> para cancelar."
                       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----- Começar a instalar o Support Pack %{SupportPackVersion} -----'
	PI_EditNCF_Addline '  '
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

	GotoIfEqual %{cCode}, 0, LOG_OK
		Display 0, "Impossível gravar no arquivo de registro:  %{LogFile}."
Label LOG_OK

Label NO_MENU_SELECTED



; --------------------------------------------------------------------------
;	Backup Fileset
; --------------------------------------------------------------------------
@FileSet
        Description: "Fazer backup dos arquivos que serao substituídos pelo IntranetWare Support Pack v4.0."
	Name: BACKUP
	Help:  "A opçao de Arquivos de Backup fará o backup de arquivos antes de sobregravá-los. Esses arquivos sao copiados para SYS:\\SYSTEM\\!BACKUP.SP4"

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



; --------------------------------------------------------------------------
;	IntranetWare Support Pack Fileset
; --------------------------------------------------------------------------
@FileSet
        Description:  "Instalar o 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, "Nao foi possível modificar o NWCSTART.NCF"
		;----- Add entry to Log file -----
		PI_EditNCF_Addline ''
		PI_EditNCF_Addline '\tNao foi possível modificar o NWCSTART.NCF. Código de Erro:%{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}, 12, 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}, 12, COMMON

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

	;----- Copy to the SYS: Volume for files not localized.
	Display 2, "Copiando arquivos do Sistema específico do idioma..."
	CopyFile 1, 1, 0, 1, 0, NotLocalizedSYS, '', '', '', DestSYS, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
        PI_EditNCF_Addline '\tArquivos específicos do idioma para o sistema operacional.'
	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, "Copiando arquivos do 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 '\tAtualizaçao do MPR (Multiprotocol Router) V3.1'
	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, "Copiando arquivos do MPR 3.0..." 
    CopyFile 1,1,1,1,0,MPRCommon,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tAtualizaçao do MPR (Multiprotocol Router) V3.0'
	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, "Copiando arquivos 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 '\tAtualizaçao do NetWare IP da versao %{ID} para 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 nao atualizado. Produto nao encontrado.'
	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, "Copiando arquivos Unix Print Services..."
    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 '\tPRTS (Unix Print Services) atualizado da versao %{ID} para 2.12c'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto UXP_DONE

Label NOUXP
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tPRTS (Unix Print Services) nao atualizado. Produto nao encontrado.'
	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, "Copiando arquivos do WEB Server..."
;    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 nao atualizado. Produto nao encontrado.'
;	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, "Copiando arquivos do DHCP..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tDHCP atualizado da versao %{ID} para 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 nao atualizado. Produto nao encontrado.'
	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, "Copiando arquivos do NetWare para Macintosh..."
    CopyFile 1,1,1,1,0,SourceDrive,'','','',DestSYS,'','','',3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
        PI_EditNCF_Addline '\tImpressao NetWare para Macintosh - atualizaçao v4.11'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode
	Goto MAC_DONE

Label NOMAC
	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tImpressao NetWare para Macintosh nao atualizada. Produto nao encontrado.'
	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, "Copiando NLMs atualizados para SYS:SYSTEM..."
    CopyFile 1, 1, 0, 1, 0, SourceCommonSYS, '', '', '', DestSYS, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
        PI_EditNCF_Addline '\tArquivos do sistema operacional atualizados em 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, 'Sistema Operacional de Tipo Desconhecido %{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, "Modificando STARTUP.NCF, comentários adicionados para destacar mudanças, arquivo original renomeado para 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, "Copiando patches do sistema operacional para %{NWBOOT}..."
    CopyFile 1, 1, 1, 2, 0, PatchSrc, '', '', '',PatchDest, '', '', '', 3

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
        PI_EditNCF_Addline '\tArquivos do sistema operacional atualizados na Partiçao DOS.'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


    ;----- Swap the loader
    Display 2, "Atualizando SERVER.EXE com a nova versao do LOADER.EXE. Arquivo antigo renomeado para SERVER.OLD"
    NLMExec2 1, '%{NWBOOT}\\LSWAP %{NWBOOT}\\LOADER.EXE %{NWBOOT}\\SERVER.EXE', cCode
	GotoIfEqual %{cCode}, 0, NO_ERROR_LSWAP
		Display 1, "Falha do LSWAP ao trocar o LOADER em server.exe."

Label NO_ERROR_LSWAP

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


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

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
	PI_EditNCF_Addline '\tPK411.NLM Carregado.'
	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 adicionado ao 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}] ausente (a serápulado)'
    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, "Copiando patches do sistema operacional para %{NWBOOT}"
    CopyFile 1, 1, 1, 2, 0, PatchSrc, '', '', '',PatchDest, '', '', '', 0

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
        PI_EditNCF_Addline '\tArquivos do sistema operacional atualizados na partiçao DOS para o 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}, 12, 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, "Modificando IOSTART.NCF- comentários adicionados para destacar mudanças. Arquivo antigo nomeado para 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 '; Final da modificaçoes feitas pela instalaçao do 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, "Modificando MSSTART.NCF-comentários adicionados para destacar mudanças. Arquivo antigo renomeado para 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 '\t PK411.NLM adicionado ao MSSTART.NCF'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode


;----- Swap the loader
    Display 2, "Atualizando MSERVER.EXE com a versao mais recente do LOADER.EXE, arquivo antigo renomeado MSERVER.OLD"
    NLMExec2 1, '%{NWBOOT}\\LSWAP %{NWBOOT}\\LOADER.EXE %{NWBOOT}\\MSERVER.EXE', ccode
	GotoIfEqual %{cCode}, 0, SFTIII_NO_ERROR_LSWAP
		Display 1, "Falha do LSWAP ao trocar LOADER em server.exe."
Label SFTIII_NO_ERROR_LSWAP

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



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

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
        PI_EditNCF_Addline '\tPK411.NLM carregado no 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, "Carregando PK411.NLM no MSEngine"
    NLMExec2 0, '%{PatchDest}\\PK411.NLM', ccode

	;----- Add entry to Log file -----
	PI_EditNCF_Addline ''
        PI_EditNCF_Addline '\tPK411.NLM carregado no 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, "Removendo registros antigos do arquivo 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 '\tEntradas antigas removidas de 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 para 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 '\tEntrada SPACK adicionada 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, "Instalaçao do IntranetWare Support Pack completada!\n\n Obrigado por instalar o IntranetWare Support Pack.
        Verifique se os arquivos NCF estao corretos. Notifique os usuários, em seguida DESATIVE o servidor e REINICIE O SERVIDOR para completar a instalaçao."
    Goto EXIT


Label CloseScreen_SFT3
    Display 0,     "Instalaçao do IntranetWare Support Pack completada!\n\n Obrigado por instalar o IntranetWare Support Pack.
       QUESTAO:\n\n

      NetWare SFT III analisa o IOSTART.NCF varrendo o arquivo duas vezes.\n
      O primeiro passe para varrer todos os parâmetros SET, exceto para o seguinte:\n\n

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

      O segundo passe para varrer os comandos LOAD e os dois parâmetros SET listados acima.
      O comando LOAD e os parâmetros SET sao executados na ordem em que aparecem
      no arquivo NCF..\n\n

      Esta instalaçao do IntranetWare Support Pack tenta mover os dois parâmetros SET acima
      da instruçao LOAD do IntranetWare Support Pack."

    Display 0,    "A Novell recomenda que todas as configuraçoes do SFT III tenham os parâmetros 
ALL SET antes dos comandos ALL LOAD\n\n

      A Novell tambΘm recomenda que todas as instalaçoes do SFT III tenham um mínimo de 12 MB de memória para cada IO Engine adicionando o seguinte ao IOSTART.NCF:\n\n

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

      Isto elimina o seguinte ABEND:\n
      ABEND: SERVER-4.10-385: Memória insuficiente disponível para alocar buffers de recebimento suficientesé um resultado de se ter memória do IOEngine insuficiente e tambΘm de carregar os 
patches antes dos parâmetros SET.\n\n

      Verifique se os arquivos NCF estao corretos e, em seguida, DESATIVE o servidor e REINICIE O SERVIDOR para completar a instalaçao do 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----- Fim da instalaçao do Support Pack %{SupportPackVersion} -----'
	PI_EditNCF	autoexecDir, '%{LogFile}', '.BAK', cCode

[ RETURN TO DIRECTORY ]