(complete 0)
(set @default-dest "Work:")

(message (cat "\n\nWelcome to the Audio Evolution 4 installation utility!\n\n\n")
)

(welcome)


(set dest_dir
   (askdir (prompt "Where would you like Audio Evolution to be installed?\n"
                    "A new drawer called AudioEvolution4 will be created there.")
           (help @askdir-help)
           (default @default-dest)
           (newpath))
)

(set @default-dest (tackon dest_dir "AudioEvolution4"))
(makedir @default-dest (infos))
(makedir (tackon @default-dest "Data"))
(makedir (tackon @default-dest "Images"))
(makedir (tackon @default-dest "Projects"))
(makedir (tackon @default-dest "EventLists"))
(makedir (tackon @default-dest "PlugIns"))
(makedir (tackon @default-dest "Modules"))
(makedir (tackon @default-dest "RemoteSetups"))
(makedir (tackon @default-dest "AEHTML"))


(set SourceName "AudioEvolution")
(set SourceNameInfo "icons/AudioEvolution.info")



(set InstallPTool 1)
(set InstallPTool
     (askchoice (prompt "Do you wish to install the Bars&Pipes synchronisation tool?")
                (help (cat "The Bars&Pipes synchronisation tool is a 'ptool' to \n"
                      "synchronize the start of Audio Evolution with B&P."
                      )
                )
                (choices "Yes" "No")
                (default InstallPTool)
     )
)

(if (= InstallPTool 0)
 (
   (set bpdir
      (askdir (prompt "Where would you like the B&P tool to be installed?\n")
            (default "Work:")
            (help "\nChoose the Bars&Pipes/Tools directory\n")
            (disk)
      )
   )

   (copyfiles (prompt ("Copying AudioEvolutionTool.ptool to %s.\n" bpdir) )
                              (source "AudioEvolutionTool.ptool")
                              (dest bpdir)
                              (confirm)
                              (help "\nThis will copy the B&P-ptool file.")
   )
 )
)


(copyfiles (source SourceNameInfo)
                              (dest @default-dest)
                              (infos)
                              (help "\nThis will copy the main Audio Evolution icon.")
)


(copyfiles (prompt (cat "Copying Audio Evolution.\n"
                        "Note that this is an 68040+FPU version.\n"
                        "Other versions can be downloaded from our website."))
                              (source SourceName)
                              (dest @default-dest)
                              (newname "AudioEvolution")
                              (infos)
                              (confirm)
                              (help "\nThis will copy the main Audio Evolution file.")
)


(complete 20)


(if (<> (exists "VersionInfo")  0)
 (copyfiles (prompt ("Copying VersionInfo to %s.\n" @default-dest))
                              (source "VersionInfo")
                              (dest @default-dest)
                              (infos)
                              (help "\nThis will copy the version-info file.")
 )
)



(complete 25)

(copyfiles (prompt ("Copying Data to %s.\n" (tackon @default-dest "Data") ))
                              (source "Data")
                              (dest (tackon @default-dest "Data"))
                              (all)
                              (help "\nThis will copy some data files.")
)

(complete 30)

(copyfiles (prompt ("Copying AE4Manual.html.\n"))
                              (source "AE4Manual.html")
                              (dest @default-dest)
                              (infos)
                              (all)
)


(complete 35)

(copyfiles (prompt ("Copying AE4Manual.pdf.\n"))
                              (source "AE4Manual.pdf")
                              (dest @default-dest)
                              (infos)
                              (all)
)

(complete 40)

(copyfiles (prompt ("Copying AEHTML.\n"))
                              (source "AEHTML")
                              (dest (tackon @default-dest "AEHTML"))
                              (infos)
                              (all)
)




(complete 75)

(copyfiles (prompt ("Copying Images to %s.\n" (tackon @default-dest "Images") ))
                              (source "Images")
                              (dest (tackon @default-dest "Images"))
                              (all)
                              (help "\nThis will copy some image files.")
)

(complete 80)

(copyfiles (prompt ("Copying plug-ins to %s.\n" (tackon @default-dest "PlugIns") ))
                              (source "PlugIns")
                              (dest (tackon @default-dest "PlugIns"))
                              (all)
                              (help "\nThis will copy some realtime effects.")
)


(complete 85)

(copyfiles (prompt ("Copying add-on modules to %s.\n" (tackon @default-dest "Modules") ))
                              (source "Modules")
                              (dest (tackon @default-dest "Modules"))
                              (all)
                              (help "\nThis will copy some add-on modules.")
)


(complete 90)

(copyfiles (prompt "Audio Evolution needs some fonts in the FONTS: directory.\n")
           (source "fonts/")
           (dest "FONTS:")
           (all)
           (confirm)
           (help "\nThis will copy the Trinomic and AudioEvolutionDigital fonts.")
)


(copylib 
          (source "libs/popupmenu.library")
          (dest "libs:")
          (help "\nThe popupmenu library is required to run Audio Evolution!")
)


(copylib 
          (source "libs/EasyRexx.library")
          (dest "libs:")
          (help "\nThe EasyRexx library is required to communicate with Audio Evolution through AREXX.")
)


(run "sys:Utilities/MultiView ReleaseNotes68k"
)

(complete 100)

(set installed "YES")         

(if (= installed "YES") 
   (exit (cat "\n\nThank you for installing the Audio Evolution demo!\n"
              "Visit www.audio-evolution.com for news and updates."))
   (exit)
)   
