; SAGA Drivers
; $VER: SAGA Drivers 1.1 (06.03.2018)
; SAGA Drivers by Apollo Team

(complete 0)
(set @app-name "SAGA Drivers")
(set @default-dest "RAM:")
; Welcome step
(welcome "Welcome to the installation of SAGA Drivers for 68080 accelerators.")


(complete 10)
; Getting ready...
(message "We will now start copying files. Sit back and relax..."
)

(complete 20)
; Copy the files
(copyfiles
  (prompt "Copying files...")
  (help @copyfiles-help)
  (source "")
  (dest "C:")
  (choices "C/")
)

(copyfiles
  (prompt "Copying files...")
  (help @copyfiles-help)
  (source "")
  (dest "L:")
  (choices "L/")
)

(copyfiles
  (prompt "Copying files...")
  (help @copyfiles-help)
  (source "")
  (dest "ENVARC:")
  (choices "ENVARC/")
)

(copyfiles
  (prompt "Copying files...")
  (help @copyfiles-help)
  (source "")
  (dest "SYS:System")
  (choices "System/")
)
(copyfiles
  (prompt "Copying files...")
  (help @copyfiles-help)
  (source "")
  (dest "SYS:Storage")
  (choices "Storage/")
)
(copyfiles
  (prompt "Copying files...")
  (help @copyfiles-help)
  (source "")
  (dest "Devs:Monitors")
  (choices "Devs/Monitors/")
)


(complete 22)
; Check if SAGA monitor file exists
(set #MONITORFILE
  (exists "DEVS:Monitors/SAGA" (noreq))
)

(complete 23)
; If SAGA monitors exists
(if (> #MONITORFILE 0)
(

(complete 25)
; Renaming old Monitor file
(rename "DEVS:Monitors/SAGA" "SYS:Storage/Monitors/SAGA"
  (prompt "Moving existing SAGA monitor file")
  (help )
)
(rename "DEVS:Monitors/SAGA.info" "SYS:Storage/Monitors/SAGA.info"
  (prompt "Moving existing SAGA monitor file")
  (help )
)



)
) ; End If

(complete 30)
; Copy the drivers
(copylib
  (source "Devs/sagasd.device")
  (dest "DEVS:")
  (prompt "Copying Devs/sagasd.device")
  (help @copylib-help)
  (confirm "average")
)

(complete 35)
; Check if saga.card file exists
(set #SAGAFILE
  (exists "LIBS:Picasso96/saga.card" (noreq))
)

(complete 37)
; If saga.card exists
(if (> #SAGAFILE 0)
(

(complete 38)
; Renaming old saga.card
(rename "LIBS:Picasso96/saga.card" "LIBS:Picasso96/saga.card_old"
  (prompt "Backuping existing saga.card file")
  (help )
)

)
) ; End If

(complete 39)
(copylib
  (source "Libs/Picasso96/vampiregfx.card")
  (dest "Libs:Picasso96")
  (prompt "Copying Libs/Picasso96/vampiregfx.card")
  (help @copylib-help)
  (confirm "average")
)

(copylib
  (source "Devs/Networks/sdnet.device")
  (dest "DEVS:Networks")
  (prompt "Copying Devs/Networks/sdnet.device")
  (help @copylib-help)
  (confirm "average")
)

(complete 40)
; Check if Picasso96Settings file exists
(set #P96FILE
  (exists "DEVS:Picasso96Settings" (noreq))
)

(complete 50)
; If Picasso96Settings exists
(if (> #P96FILE 0)
(

(complete 55)
; Renaming old Picasso96Settings
(rename "DEVS:Picasso96Settings" "DEVS:Picasso96Settings.old"
  (prompt "Backuping existing Picasso96Settings file")
  (help )
)

)
) ; End If
(complete 60)
; Picasso96Settings format choice
(set #Resolutions
  (askchoice
    (prompt "Please select preferred listing mode of resolutions")
    (help @askchoice-help)
    (choices "By resolution ratio (4:3, 16:9, etc.)" "By resolution size (800x600, etc.)")
    (default 0)
  )
)
(if (= #Resolutions 0) (set #ratio 1) (set #ratio 0))
(if (= #Resolutions 1) (set #size 1) (set #size 0))

(complete 65)
; 
(if (> #ratio 0)
(

(complete 65)
; Copying new Picasso96Settings (by ratio)
(copyfiles
  (source "Devs/Picasso96Settings_v5_ratio")
  (dest "DEVS:")
  (newname "DEVS:Picasso96Settings")
  (prompt "Copying Picasso96Settings (listed by ratio)")
  (help )
)

(complete 65)
; 
) ; Else
(

(complete 65)
; Copying new Picasso96Settings (by size)
(copyfiles
  (source "Devs/Picasso96Settings_v5_sizes")
  (dest "DEVS:")
  (newname "DEVS:Picasso96Settings")
  (prompt "Copying Picasso96Settings file (listed by size)")
  (help )
)

)
) ; End If
(complete 100)
; End message
(exit "Thanks for installing SAGA drivers !\n\n** PLEASE, REBOOT YOUR COMPUTER NOW TO MAKE THE CHANGES EFFECTIVE ! **")

