;; Ultraconv NG Demo-Installation utility
;; (C) 97 by Felix Schwarz
;; This script bases mainly on the UConv 1.x-script (C)1996 by Felix Schwarz

(set @default-dest "")
(set @pretend 0)
(set @user-level 2)
(complete 0)
(if (= @language "deutsch")
 (
   ; Let`s use German as language
   (set #welcome "\n\n\n\nUltraconv 2.1 NG\n© 1995-97 by Felix Schwarz\n\n\nWillkommen zum UConv 2.1 NG Installationstool\nDieses Script wird Ultraconv auf Ihre HD installieren\n")
   (set #askinstall "Wo wollen Sie UConv installieren ?\n(Ein Verzeichnis wird dort erzeugt werden)")
   (set #addline "Eine Zeile muß zu Ihrer user-startup hinzugefügt werden:\n")
   (set #ready "Ultraconv ist nun auf Ihrer HD in folgendem Verzeichnis installiert:\n")
   (set #enjoy "Viel Spaß!")
   (set #cputxt "Für welche CPU sollen optimierte Versionen\ninstalliert werden ?\n(nicht in der Demoversion)")
   (set #ix "\nWICHTIG!!\n\nSie MÜSSEN die ixemul.library installiert haben,\nsonst funktionieren die JPEG und MPEG-Funktionen nicht!!")
 )
 (
   ; Let`s use English as language
   (set #welcome "\n\n\n\nUltraconv 2.1 NG\n© 1995-97 by Felix Schwarz\n\n\nWelcome to the UConv 2.1 NG installation utility\nThis script will install Ultraconv on your HD\n")
   (set #askinstall "Where do you want to install UConv ?\n(A directory called Ultraconv will be created there)")
   (set #addline "One line has to be added to your user-startup:\n")
   (set #ready "Ultraconv is now installed on your HD at:\n")
   (set #enjoy "Enjoy it!")
   (set #cputxt "For which CPU shall I install an optimised version ?\n(not in the demo-version)")
   (set #ix "\nIMPORTANT!\n\nYou MUST have ixemul.library installed,\notherwise JPEG and MPEG-functions won`t work!")
 )
)


; Ok, let`s begin with a small greeting!
(message #welcome
)

(set #installdir
    (askdir
        (prompt #askinstall)
        (help @askdir-help)
        (default "Work:")
    )
)

(copyfiles
    (source "/")
    (dest #installdir)
    (pattern "Ultraconv#?")
)
(complete 65)
(set #delfile
   (tackon #installdir "Ultraconv/Install")
)

(set #delfile2
   (tackon #installdir "Ultraconv/Install.info")
)

(delete #delfile)
(delete #delfile2)

(set #assdir
  (tackon #installdir "Ultraconv")
)

(set #scomm
  (cat "Assign UConv: " #assdir)
)

(complete 70)

(startup "Ultraconv"
  (prompt #addline
          #scomm)
  (help "It must be added in order to run UConv properly!")
  (command #scomm)
)

(makeassign "UConv" #assdir)

(complete 80)

; Now let`s install the CPU-optimised parts for faster conversion!
(set #cpu2 (database "cpu"))
(if (= #cpu2 68000) (set #cpu 0))
(if (= #cpu2 68010) (set #cpu 0))
(if (= #cpu2 68020) (set #cpu 1))
(if (= #cpu2 68030) (set #cpu 2))
(if (= #cpu2 68040) (set #cpu 3))
(if (= #cpu2 68060) (set #cpu 3))

(if (= @installer-version 0)
  (if (> (exists ("sys:libs/68060.library")) 0) (set #cpu 3) )
)

(set #cpuvers (askchoice (choices "68000/68010" "68020" "68030+68881" "68040+68882/68060+68882")
              (prompt #cputxt)
              (help   "68000-version does work on ALL Amigas!\n"
                      "If you have a 68030/040/060 without FPU, then get one with, or use\n"
                      "the 68020-version.. FPUs increase your system`s speed enourmously!!\n")
              (default #cpu)
     )
)

(complete 95)

(if (= (exists "LIBS:ixemul.library") 0)
 (message #ix)
)

(complete 100)
(message #ready
    #assdir "\n"
         #enjoy
)
