.KEY disk/a,adffile/a
.BRA {
.KET }

; Adf Template
; -------------
;
; Date: 2019-07-20
; Author: Henrik Noerfjand Stengaard
;
; AmigaDOS script to template to install amiga os 3.1 from adf file
; "disk" argument defines amiga os 3.1 adf to install.


; quit, if detect disk doesn't exist
IF NOT EXISTS "{adffile}"
  echo "*e[1mError: Adf file '{adffile}' doesn't exist!*e[0m"
  quit 20
ENDIF

; quit, if detect disk doesn't exist
IF NOT EXISTS "INSTALLDIR:S/Amiga-OS-3.1/Detect-{disk}"
  echo "*e[1mError: Detect Amiga OS 3.1 {disk} doesn't exist!*e[0m"
  quit 20
ENDIF

; quit, if install disk doesn't exist
IF NOT EXISTS "INSTALLDIR:S/Amiga-OS-3.1/Install-{disk}"
  echo "*e[1mError: Install Amiga OS 3.1 {disk} doesn't exist!*e[0m"
  quit 20
ENDIF


; mount disk
; ----------

; copy adf file to ff0:
diskwiz >NIL: "{adffile}" ff0:

; run detect amiga os 3.1 disk
echo "Amiga OS 3.1 {disk}..."
Execute "INSTALLDIR:S/Amiga-OS-3.1/Install-{disk}"
