echo "KingFisher v1.3 Installation (Upgrade) Script"
echo "Copyright © 1992-1993 Udo Schuermann"
echo ""

failat 20
version >NIL: exec.library 37
if warn
   echo "AmigaDOS 1.x Installation"
   skip ADOS13
else
   version >NIL: exec.library 38
   if warn
      echo "AmigaDOS 2.x Installation"
   else
      echo "AmigaDOS 3.x Installation"
   endif
   skip ADOS20
endif


;***************************************************************************
; AmigaDOS 1.3 Installation starts here
LAB ADOS13
; the 2.0 version will do fine under 1.3, too
skip ADOS20
skip EXIT



;***************************************************************************
; AmigaDOS 2.0+ Installation starts here
LAB ADOS20
ask "Are you installing KingFisher to a hard disk volume? (y/n)"
if warn
   ; Hard disk installation
   echo ""
   echo "Hard disk volume installation to directory [4m:KF[0m"
   echo ""
   ask "Continue? (y/n)"
   if not warn
      echo ""
      echo "Installation canceled"
      quit
   endif
   makedir :KF
   LZ x KingFisher :KF/
   if exists :KF/KingFisher.config
      rename :KF/KingFisher.config :KF/KingFisher.prefs
      echo "Renamed :KF/KingFisher.config file to :KF/KingFisher.prefs
   else
      rename :KF/KingFisher.hd :KF/KingFisher.prefs
      echo "Created :KF/KingFisher.prefs"
   endif
else
   ; Floppy disk installation
   echo ""
   echo "Floppy disk installation"
   echo ""
   echo "You need two (2) blank and formatted floppy disks named"
   echo "   KingFisher-1"
   echo "   KingFisher-2"
   echo ""
   ask "Do you have these disks available (y/n)"
   if not warn
      echo ""     
      echo "Then please create these two floppy disks"
      echo "before running this script again."
      echo ""
      echo "The AmigaDOS commands for this purpose are:"
      echo ""
      echo "   sys:system/format drive df0: name KingFisher-1"
      echo "   sys:system/format drive df0: name KingFisher-2"
      echo ""
      quit
   endif
   echo ""
   ask "Please insert `KingFisher-2' in any drive and press RETURN"
   echo ""
   LZ x KingFisher KingFisher-2:Fish-0501-1100
   echo ""
   ask "Please insert `KingFisher-1' in any drive and press RETURN"
   echo ""
   LZ x KingFisher KingFisher-1:Fish-0001-0500 KingFisher-1:Fish.index KingFisher-1:KingFisher*
   if exists KingFisher-1:KingFisher.config
      rename KingFisher-1:KingFisher.config KingFisher-1:KingFisher.prefs
      echo "Renamed KingFisher-1:KingFisher.config to KingFisher-1:KingFisher.prefs"
   else
      rename KingFisher-1:KingFisher.floppy KingFisher-1:KingFisher.prefs
      echo "Created KingFisher-1:KingFisher.prefs"
   endif
   echo ""
endif
skip EXIT

LAB EXIT
echo End installation
