; 000524 T.Neidhardt, ft112@fen.baynet.de, EasySystem
; AmigaShell script
; Script for update.

;-------------------------------- variables
failat 30
stack 40000

set app EASys!
set EASYSVER 4.7.2

;-------------------------------- preparations

c:relabel RAM: RAM-Disk
assign "RAM Disk:" RAM: ADD
unalias lha
unalias list

version >NIL: workbench.library 44
IF warn
 setenv osver 3.x
ELSE
 setenv osver 3.5
ENDIF

; Arq may cause heavy problems while installing on OS3.5:
c/CLIExchange "Arq 1.83" KILL
c/CLIExchange "Arq" KILL

assign iGuide: ""
assign Install_C: c

;--------------------------------
LAB UPDATE

echo "*n*n Performing update..*n"
Install_C:CLIExchange MultiNotify DISABLE
wait 2

copy iGuide:EASys! SYS:EASys! CLONE ALL QUIET

if exists SYS:StartSys
 copy iGuide:StartSys SYS:StartSys CLONE ALL QUIET
endif

;--------------------------------
echo "*n Finishing EASys! setup*n"
delete >NIL: EASys!:Prefs/#?/GUI-SnapReqSizes.3 QUIET
execute iGuide:Finish.script

if not exists SYS:EASys!/bin/ToolManager
 if exists profile:wbstartup/ToolManager
  delete SYS:StartSys/Profiles/#?/wbstartup/ToolManager#? FORCE QUIET
 endif

 if exists profile:wbstartup/MultiNotify
  delete SYS:StartSys/Profiles/#?/wbstartup/MultiNotify#? FORCE QUIET
 endif


 if exists SYS:Commodities/ToolManager
  copy SYS:Commodities/ToolManager#? SYS:EASys!/bin CLONE QUIET
  delete SYS:Commodities/ToolManager#? FORCE QUIET
 endif

 if exists SYS:Tools/Commodities/ToolManager
  copy SYS:Tools/Commodities/ToolManager#? SYS:EASys!/bin CLONE QUIET
  delete SYS:Tools Commodities/ToolManager#? FORCE QUIET
 endif

 if exists SYS:WBstartup/ToolManager
  copy SYS:WBstartup/ToolManager#? SYS:EASys!/bin CLONE QUIET
  delete SYS:WBstartup/ToolManager#? FORCE QUIET
 endif

 if exists "SYS:WBstartup (enabled)/ToolManager"
  copy "SYS:WBstartup (enabled)/ToolManager#?" SYS:EASys!/bin CLONE QUIET
  delete "SYS:WBstartup (enabled)/ToolManager#?" FORCE QUIET
 endif
endif

if not exists SYS:EASys!/bin/MultiNotify
 if exists SYS:Commodities/MultiNotify
  copy SYS:Commodities/MultiNotify#? SYS:EASys!/bin CLONE QUIET
  delete SYS:Commodities/MultiNotify#? FORCE QUIET
 endif

 if exists SYS:Tools/Commodities/MultiNotify
  copy SYS:Tools/Commodities/MultiNotify#? SYS:EASys!/bin CLONE QUIET
  delete SYS:Tools Commodities/MultiNotify#? FORCE QUIET
 endif

 if exists SYS:WBstartup/MultiNotify
  copy SYS:WBstartup/MultiNotify#? SYS:EASys!/bin CLONE QUIET
  delete SYS:WBstartup/MultiNotify#? FORCE QUIET
 endif

 if exists "SYS:WBstartup (enabled)/MultiNotify"
  copy "SYS:WBstartup (enabled)/MultiNotify#?" SYS:EASys!/bin CLONE QUIET
  delete "SYS:WBstartup (enabled)/MultiNotify#?" FORCE QUIET
 endif
endif

;--------------------------------
if exists SYS:StartSys
 echo "*n Finishing ModAS setup..*n"
 execute iGuide:FinishModAS.script
endif
;--------------------------------
protect SYS:EASys!/Help/EASys!.version +rwd
echo >SYS:EASys!/Help/EASys!.version "$EASYSVER"
protect SYS:EASys!/Help/EASys!.version -wd

rx EASys!:Prefs/Internet_Apps.rexx

echo "*n .. update done. Please restart system."
wait 10
cd SYS:
endcli

;--------------------------------
lab ERROR
echo "*ec*n*e[1m Error installing $app:*e[0m*n*n The following files must be in this directory:*n*n $app.lha*n Install_Guide*n $app_iGuide.lha*n Lha*n*n*n Your version is*e[1m not up to date*e[0m or it is*e[1m incomplete*e[0m.*n*n Closing this window 1
wait 15
cd SYS:
