failat 21

IF ${LUPD_TODO} eq "continue"

RequestChoice >ENV:Choicex Title="WARNING" Body="I'm about to overwrite old files. These are mainly system files*nbut there may also be user settings of 3rd party applications.*nBefore updating, please be sure you have a backup of them." Gadgets=Continue|Stop
IF ${Choicex} eq 0
  Skip CLEAN
EndIf

echo copying icons  
copy FROM sysource:Devs.info TO sydest: QUIET FOOVR NOPRO
copy FROM sysource:Fonts.info TO sydest: QUIET FOOVR NOPRO
copy FROM sysource:Libs.info TO sydest: QUIET FOOVR NOPRO
copy FROM sysource:Locale.info TO sydest: QUIET FOOVR NOPRO
copy FROM sysource:Prefs.info TO sydest: QUIET FOOVR NOPRO
copy FROM sysource:Rexxc.info TO sydest: QUIET FOOVR NOPRO
copy FROM sysource:Storage.info TO sydest: QUIET FOOVR NOPRO
copy FROM sysource:System.info TO sydest: QUIET FOOVR NOPRO

; copy tools preserving FKey user settings
copy FROM sydest:Tools/Commodities/FKey.info TO sydest:Tools/Commodities/FKey.info.bck QUIET FOOVR NOPRO
copy FROM sysource:Tools.info TO sydest: QUIET FOOVR NOPRO
copy FROM sydest:Tools/Commodities/FKey.info.bck TO sydest:Tools/Commodities/FKey.info QUIET FOOVR NOPRO

copy FROM sysource:Utilities.info TO sydest: QUIET FOOVR NOPRO
copy FROM sysource:WBStartup.info TO sydest: QUIET FOOVR NOPRO
copy FROM sysource:Demos.info TO othdest: QUIET FOOVR NOPRO
if exists othdest:Extras.info
  copy FROM sysource:Extras.info TO othdest: QUIET FOOVR NOPRO
endif
if exists othdest:Development.info
  copy FROM sysource:Development.info TO othdest: QUIET FOOVR NOPRO
endif
copy FROM sysource:Tests.info TO othdest: QUIET FOOVR NOPRO
  
echo Updating Kernel...
; make a copy of older kernel
 if not exists boot/last-kernel
  makedir sys:boot/last-kernel
 endif
 copy sys:boot/#?.gz TO sys:boot/last-kernel FOOVR NOPRO
;  copy the new kernel
 copy FROM sysource:boot/#?.gz TO sydest:boot/ QUIET FOOVR NOPRO

echo Updating Shell commands
copy FROM sysource:C TO sydest:C ALL QUIET FOOVR NOPRO PAT #?~(info)

echo Updating Classes
copy FROM sysource:Classes TO sydest:Classes ALL QUIET FOOVR NOPRO
 
echo Updating Datatypes
copy FROM sysource:Datatypes TO sydest:Datatypes ALL QUIET FOOVR NOPRO
  
echo Updating Demos
copy FROM sysource:Demos TO othdest:Demos ALL QUIET FOOVR NOPRO
  
echo Updating Devs
copy FROM sysource:Devs TO sydest:Devs ALL QUIET FOOVR NOPRO
 
echo Updating Libraries
copy FROM sysource:Libs TO sydest:Libs ALL QUIET FOOVR NOPRO
  
echo Updating Locale files
copy FROM sysource:Locale TO sydest:Locale ALL QUIET FOOVR NOPRO

echo Updating Rexx files
copy FROM sysource:Rexxc TO sydest:Rexxc ALL QUIET FOOVR NOPRO
  
echo Updating Startup Sequence (user startup won't be touched)
copy FROM sysource:s/startup-sequence TO sydest:s QUIET FOOVR NOPRO
copy FROM sysource:s/icaros-sequence TO sydest:s QUIET FOOVR NOPRO
copy FROM sysource:s/hidds.prefs TO sydest:s/hidds.prefs QUIET FOOVR NOPRO
  
echo Updating Storage
copy FROM sysource:Storage TO sydest:Storage ALL QUIET FOOVR NOPRO
  
echo Updating System drawer
copy FROM sysource:System TO sydest:System ALL QUIET FOOVR NOPRO
  
echo Updating Tests files
copy FROM sysource:Tests TO othdest:Tests ALL QUIET FOOVR NOPRO
  
echo Updating Tools
copy FROM sysource:Tools TO sydest:Tools ALL QUIET FOOVR NOPRO
  
echo Updating Utilities
copy FROM sysource:Utilities TO sydest:Utilities ALL QUIET FOOVR NOPRO
  
echo Updating Preferences - current settings will be kept
copy FROM sysource:Prefs/#? TO sydest:Prefs QUIET FOOVR NOPRO
copy FROM sysource:Prefs/Presets TO sydest:Prefs/Presets ALL QUIET FOOVR NOPRO
copy FROM sysource:Prefs/Env-Archive/SYS/Packages TO sydest:Prefs/Env-Archive/SYS/Packages ALL QUIET FOOVR NOPRO
copy FROM sysource:Prefs/Env-Archive/SYS/def_#? TO sydest:Prefs/Env-Archive/SYS ALL QUIET FOOVR NOPRO
copy FROM sysource:Prefs/Env-Archive/CURRENT_INSTALL TO envarc:CURRENT_INSTALL QUIET FOOVR NOPRO  
echo Updating Fonts
copy FROM sysource:Fonts TO sydest:Fonts ALL QUIET FOOVR NOPRO

echo Updating Development (it will take a while)...
IF EXISTS Development:sbin
  copy FROM sysource:Development TO othdest:Development ALL QUIET FOOVR NOPRO
 Else
  copy FROM sysource:Development/bin TO Development:bin ALL QUIET FOOVR NOPRO
EndIf

echo Copying Extras (it will take a while...)
LIST env:Icaros/icinstall NOHEAD FILES LFORMAT="Echo Updating Extras - %N*NIF ${%P%N} EQ True*N copy sysource:Extras/%N Extras:%N ALL FOOVR NOPRO*NEndIf" >ExtCopy
Execute ExtCopy
; delete ExtCopy >NIL:


IF EXISTS sysource:S/icaros-update
  execute sysource:S/icaros-update
  delete sydest:S/icaros-update
EndIF

EndIf

Lab UAFINISH
; end of file