failat 21

IF ${LUPD_TODO} eq "continue"

RequestChoice >ENV:Choicex Title="Last way out" Body="I'm about to overwrite old files.*nAre you sure?" Gadgets=Continue|Cancel
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/aros-pc-i386.gz TO sys:boot/last-kernel FOOVR NOPRO
 copy sys:boot/aros-kernel-pc-i386.gz TO sys:boot/last-kernel FOOVR NOPRO
 copy sys:boot/aros-usb-pc-i386.gz TO sys:boot/last-kernel FOOVR NOPRO
; copy the new kernel
 copy FROM sysource:boot/aros-#? 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

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


IF NOT EXISTS extras:
  RequestChoice >ENV:Choice Title="Third party software" Body="It appears you have either a OLD AROS installation*Nor no EXTRAS software installed. Please select*Na destination for third party software*NOptions are SYS:Extras or Work:. If you don't*Nwant to update or install any extra software, just*Nselect Cancel."  gadgets=System|Work|Cancel
  IF ${Choice} eq 1 
  ASSIGN extras: sydest:extras
  EndIf
  IF ${Choice} eq 2 
  ASSIGN extras: work:extras
  EndIf
  IF ${Choice} eq 0 
  skip UAFINISH
  EndIf
EndIf

echo Copying Extras (it will take a while...)
copy FROM sysource:Extras extras: ALL QUIET FOOVR NOPRO

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

EndIf

Lab UAFINISH
; end of file

