; SAGADrivers
; $VER: SAGADrivers 2.4.1 (16.08.2020)

; Generated by InstallerGen 1.5!

(complete 0)
(set @app-name "SAGADrivers")
(set @default-dest "RAM:")
; Welcome message...
(welcome "Welcome to the SAGA Drivers Package installer. This installer will guide you through the required steps to install drivers for your Vampire product.")

(complete 5)
; Copy most files
(copyfiles
  (prompt "We will now start by copying some files.")
  (help @copyfiles-help)
  (confirm "expert")
  (source "")
  (dest "C:")
  (choices "C/")
)
(copyfiles
  (prompt "We will now start by copying some files.")
  (help @copyfiles-help)
  (confirm "expert")
  (source "")
  (dest "DEVS:Keymaps")
  (choices "Devs/Keymaps/")
)
(copyfiles
  (prompt "We will now start by copying some files.")
  (help @copyfiles-help)
  (confirm "expert")
  (source "")
  (dest "DEVS:Monitors")
  (choices "Devs/Monitors/")
)
(copyfiles
  (prompt "We will now start by copying some files.")
  (help @copyfiles-help)
  (confirm "expert")
  (source "")
  (dest "DEVS:Networks")
  (choices "Devs/Networks/")
)
(copyfiles
  (prompt "We will now start by copying some files.")
  (help @copyfiles-help)
  (confirm "expert")
  (source "")
  (dest "DEVS:")
  (choices "Devs/sagasd.device")
)
(copyfiles
  (prompt "We will now start by copying some files.")
  (help @copyfiles-help)
  (confirm "expert")
  (source "")
  (dest "ENVARC:")
  (choices "ENVARC/")
)
(copyfiles
  (prompt "We will now start by copying some files.")
  (help @copyfiles-help)
  (confirm "expert")
  (source "")
  (dest "L:")
  (choices "L/")
)
(copyfiles
  (prompt "We will now start by copying some files.")
  (help @copyfiles-help)
  (confirm "expert")
  (source "")
  (dest "SYS:Storage")
  (choices "Storage/")
)
(copyfiles
  (prompt "We will now start by copying some files.")
  (help @copyfiles-help)
  (confirm "expert")
  (source "")
  (dest "SYS:System")
  (choices "System/")
)

(complete 9)
; Check for existence of old SAGA monitor file
(set #OLDSAGA
  (exists "DEVS:Monitors/SAGA" (noreq))
)

(complete 14)
; If yes, set OLDSAGA to 1
(if (= #OLDSAGA 1)
(

(complete 18)
; and move it to Storage
(rename #OLDSAGA "SYS:Storage/Monitors/SAGA"
  (prompt "")
  (help )
)

)
) ; End If
(complete 23)
; Check for for existence of old SAGA monitor icon file
(set #OLDSAGAICON
  (exists "DEVS:Monitors/SAGA.info" (noreq))
)

(complete 27)
; If yes, set OLDSAGAICON to 1
(if (= #OLDSAGAICON 1)
(

(complete 32)
; and move it to Storage
(rename #OLDSAGAICON "SYS:Storage/Monitors/SAGA.info"
  (prompt "")
  (help )
)

)
) ; End If
(complete 36)
; Check for existence of old saga.card
(set #SAGACARD
  (exists "LIBS:Picasso96/saga.card" (noreq))
)

(complete 41)
; If yes, set SAGACARD to 1
(if (= #SAGACARD 1)
(

(complete 45)
; and rename it to saga.card_old
(rename "LIBS:Picasso96/saga.card" "LIBS:Picasso96/saga.card_old"
  (prompt "")
  (help )
)

)
) ; End If
; Check existence of vampiregfx.card
(set #OLDGFX
  (exists "LIBS:Picasso96/vampiregfx.card" (noreq))
)

; If yes, set OLDGFX to 1
(if (= #OLDGFX 1)
(

; Rename old driver
(rename "LIBS:Picasso96/vampiregfx.card" "LIBS:Picasso96/vampiregfx.card_old"
  (prompt "")
  (help )
)

)
) ; End If
(complete 50)
; Ask user to choose between cores
(set GOLD21x
  (askchoice
    (prompt "Choose driver version")
    (help @askchoice-help)
    (choices "V4 Standalone r7649, GOLD2.12 or newer" "V4 Standalone r7383" "GOLD2.11 or earlier (deprecated)")
    (default 0)
  )
)
(if (= GOLD21x 0) (set #GOLD212_7649 1) (set #GOLD212_7649 0))
(if (= GOLD21x 1) (set #GOLD212_7383 1) (set #GOLD212_7383 0))
(if (= GOLD21x 2) (set #GOLD211 1) (set #GOLD211 0))

(complete 55)
; If user select GOLD2.12 7649 or newer
(if (= #GOLD212_7649 1)
(

(complete 59)
; Copy last driver
(copyfiles
  (prompt "")
  (help @copyfiles-help)
  (confirm "average")
  (source "")
  (dest "LIBS:Picasso96/")
  (choices "Libs/Picasso96/vampiregfx.card_7649")
)

; Rename driver
(rename "LIBS:Picasso96/vampiregfx.card_7649" "LIBS:Picasso96/vampiregfx.card"
  (prompt "")
  (help )
)

)
) ; End If
; if user selects GOLD212 7383 
(if (= #GOLD212_7383 1)
(

; Copy 7383 driver
(copyfiles
  (prompt "")
  (help @copyfiles-help)
  (source "")
  (dest "LIBS:Picasso96/")
  (choices "Libs/Picasso96/vampiregfx.card_7383")
)

; Rename driver
(rename "LIBS:Picasso96/vampiregfx.card_7383" "LIBS:Picasso96/vampiregfx.card"
  (prompt "")
  (help )
)

)
) ; End If
; if user selects GOLD211 
(if (= #GOLD211 1)
(

; Copy GOLD211 driver
(copyfiles
  (prompt "")
  (help @copyfiles-help)
  (confirm "average")
  (source "")
  (dest "LIBS:Picasso96/")
  (choices "Libs/Picasso96/vampiregfx.card_gold211")
)

; Rename driver
(rename "LIBS:Picasso96/vampiregfx.card_gold211" "LIBS:Picasso96/vampiregfx.card"
  (prompt "")
  (help )
)

)
) ; End If
(complete 82)
; Check for Picasso96Settings existence...
(set #P96FILE
  (exists "DEVS:Picasso96Settings" (noreq))
)

(complete 86)
; If yes, set P96FILE to 1
(if (= #P96FILE 1)
(

(complete 91)
; Rename old file to _old
(rename "DEVS:Picasso96Settings" "DEVS:Picasso96Settings_old"
  (prompt "")
  (help )
)

(complete 95)
; Copy newer one
(copyfiles
  (prompt "")
  (help @copyfiles-help)
  (source "")
  (dest "DEVS:")
  (choices "Devs/Picasso96Settings")
)

)
) ; End If
(complete 82)
; Tadaaa
(exit)

