(message "\n\nEqEd version 0.96\n\nAn Equation Editor "
"for the Amiga\n\n\nby\n\n\nBrian Aagaard Petersen\n\n"
"aagaard@fys.ku.dk")

(complete 0)

(set destination
  (askdir (prompt "Choose the path where the new drawer 'EqEd' should be created.")
          (help   "\nA full EqEd installation requires around 1000 KB\n"
                  "In the choosen path a new directory called 'EqEd' will be created, in which EqEd and the other files will be copied.")
          (default @default-dest)
  )
)

(set destination (tackon destination "EqEd"))

(set @default-dest destination)


(makedir destination
  (help @makedir-help)
  (infos)
)


(copyfiles (source "EqEd")
           (dest destination)
           (infos)
           (noposition)
)
(complete 10)
(copyfiles (source "EqEd.guide")
           (dest destination)
           (infos)
           (noposition)
)
(if
  (askbool (help   "EqEd uses MagicWB 8 color icons as standard!")
           (prompt "Do you want to use the standard 4 color icons?")
  )
  (
  (copyfiles (source "EqEd.guide_std.info")
           (dest destination )
           (newname "EqEd.guide.info")
  )
  (copyfiles (source "EqEd_std.info")
           (dest destination )
           (newname "EqEd.info")
  ))
)


(complete 20)

(set images (tackon destination "Images"))

(makedir images
  (help @makedir-help)
)

(copyfiles (source "Images/")
           (dest images)
           (all)
)

(complete 30)
(if
  (askbool (help   "EqEd comes with a few examples to demonstrate what it is capable of.")
           (prompt "Do you want to copy the examples?")
  )
  ((set examples (tackon destination "Examples"))

  (makedir examples
    (help @makedir-help)
    (infos) )

  (copyfiles (source "Examples/")
             (dest examples)
             (infos)
             (noposition)
             (all)
  ))
)
(complete 40)
(if
  (askbool (help   "Using the pre-made fontcache will allow you to try out "
                   "EqEd a lot faster, since you don't have to generate "
                   "a cache first. If you decide you like EqEd, you can "
                   "always generate another cache later!")
           (prompt "Install pre-made fontcache?")
  )
  (copyfiles (source "ScreenCache")
             (dest destination)
  )
)
(complete 60)
(if
  (askbool (help   "EqEd comes with ARexx scripts which makes it easy to use "
                   "EqEd together with FinalWriter.")
           (prompt "Do you want install ARexx scripts?")
  )
  (
  (set arexx (tackon destination "Rexx"))

  (makedir arexx
    (help @makedir-help) )

  (copyfiles (source "Rexx/")
             (dest arexx)
             (all)
  ))
)
(complete 70)
(set psfonts (askoptions  (prompt  "Which fonts do you wish to install?")
                          (help    "EqEd uses postscript fonts, so if you "
                                   "want to make another fontcache you will "
                                   "need some postscript fonts. These are "
                                   "the ones used in the cache file. ")
                          (choices " Utopia Regular"
                                   " Utopia Italic"
                                   " Utopia Bold"
                                   " Symbol"
                          )
             (default -1)
           )
)
(if (not(= psfonts 0))
 ((set pspath
   (askdir (prompt "Where do you want the fonts to be placed.")
           (help   "Normally PSFONTS: will be the best place for "
                   "the postscript fonts, since that is where "
                   "for instance FinalWriter looks for "
                   "postscript fonts." )
           (default "PSFonts:")
   )
  )

  (if (in psfonts 0)
    ((copyfiles (source "Fonts/Utopia-Regular.pfb")
                (dest pspath)
     )
    )
  )
  (if (in psfonts 1)
    ((copyfiles (source "Fonts/Utopia-Italic.pfb")
                (dest pspath)
     )
    )
  )
  (if (in psfonts 2)
    ((copyfiles (source "Fonts/Utopia-Bold.pfb")
                (dest pspath)
     )
    )
  )
  (if (in psfonts 3)
    ((copyfiles (source "Fonts/Symbol.pfb")
                (dest pspath)
     )
    )
  )
  (message "Remember to install the fonts with T1Manager!\n\n"
           "See the manual for more details.")
 )
)

(complete 85)
(set psfonts (askoptions  (prompt  "Which AFM files do you wish to install?")
                          (help    "EqEd uses AFM files to generate "
                                   "postscript output.")
                          (choices " Utopia Regular"
                                   " Utopia Italic"
                                   " Utopia Bold"
                                   " Symbol"
                          )
             (default -1)
           )
)
(if (not(= psfonts 0))
 ((set pspath
   (askdir (prompt "Where do you want the fonts to be placed.")
           (help   "Normally only EqEd will need to have access to the AFM files")
           (default destination)
   )
  )

  (if (in psfonts 0)
    ((copyfiles (source "Fonts/Utopia-Regular.afm")
                (dest pspath)
     )
    )
  )
  (if (in psfonts 1)
    ((copyfiles (source "Fonts/Utopia-Italic.afm")
                (dest pspath)
     )
    )
  )
  (if (in psfonts 2)
    ((copyfiles (source "Fonts/Utopia-Bold.afm")
                (dest pspath)
     )
    )
  )
  (if (in psfonts 3)
    ((copyfiles (source "Fonts/Symbol.afm")
                (dest pspath)
     )
    )
  )
 )
)
(complete 95)

(startup "EqEd"
	(command ("Assign EqEd: \"%s\"\n" destination))
	(prompt "\nAdding Assign to your S:User-Startup\n")
	(help "The assign EqEd: is needed by one of the ARexx "
              "scripts, but is otherwise not necessary.")
)
(complete 100)

