; $VER: GoldED 0.97
; Copyright 1994 Dietmar Eilert - All Rights Reserved

(delopts "oknodelete" "force" "askuser")
(complete 0)

(message (cat "\n"

    "Programmer's Editor, All Rights Reserved.      \n"
    "                                               \n"
    "GoldED '94 Dietmar Eilert, Aachen/Germany     \n"
    "Reqtools  '91-94 Nico Franois/Belgium        \n"
    "GUIMake '93 Rico Krasowski, Kassel/Germany    \n"
    "                                               \n"
    "GoldED is NOT 'freely distributable'. Please   \n"
    "have a look at the licence file before         \n"
    "installing GoldED; installing this software    \n"
    "means accepting that licence. Thank you.       \n"
))

(welcome)

(set @default-dest "")

; set default language selection (catalogs) to 'none'

(set catalogs 0)

; sure we are running under a 2.04 ROM ?

(if (< (/ (getversion) 65536) 37)

    (
      (message "\n Sorry, this package requires OS v2.04 or better.\n")
      (exit (quiet))
    )
)

(if (not (exists "prefs:" (noreq))) (makeassign "prefs" "sys:prefs"))

(onerror (

    (if (> @ioerr 0)

        (message

            (cat "\n"

                " error code: " @ioerr "\n\n"

                " Some error has occurred. Please inform a GoldED  \n"
                " support site (e.g. try DIETMAR@MAILWAY.ZER). The \n"
                " following information is required: error code    \n"
                " (above), last error message, the percentage done \n"
                " (window title) and your log file. Thank you !    \n"
            )
        )
    )
))

(welcome)

(if (exists "GoldED:" (noreq))

    (set update (askchoice

        (prompt (cat "\nGOLDED: assign detected...\n"))

        (help (cat "\n"

            " If you decide for updating your old installation \n"
            " you won't be asked for directories. Directories  \n"
            " of your previous installation will be used.      \n"
            "                                                  \n"
            " If you decide for removing your current GoldED   \n"
            " installation this script will try to delete      \n"
            " files introduced by a former GoldED installation.\n"
            " However, this utility is not able to remove all  \n"
            " files related to GoldED. For example it won't    \n"
            " remove the reqtools library since this library   \n"
            " might be used by other applications, too. It     \n"
            " won't remove the QuickStarter since it doesn't   \n"
            " know where it has been placed.                   \n"
            "                                                  \n"
            " If you ever run into troubles related to this    \n"
            " install script (which certainly is not perfect), \n"
            " remove your outdated GED copy (use the 'remove'  \n"
            " option) before attempting a completely new       \n"
            " installation.                                    \n"
        ))

        (default 1)

        (choices

            "install new"
            "update existing GoldED"
            "remove GoldED from your system"
        )
    ))
)

; remove GoldED ?

(if (= update 2) (

    (if (exists "GoldED:" (noreq))

        (
          (run "assign >NIL: oldged: GoldED:/")

          (run "assign >NIL: HiSpeed:  remove")
          (run "assign >NIL: GoldED:   remove")
          (run "assign >NIL: GUIMake:  remove")

          (run "delete >NIL: oldged:GoldED all quiet force")
          (run "delete >NIL: oldged:GoldED.info")

          (if (exists "locale:catalogs/deutsch/GoldED.catalog" (noreq))
              (run "delete >NIL: locale:catalogs/deutsch/GoldED.catalog")
          )

          (if (exists "locale:catalogs/deutsch/HiSpeed.catalog" (noreq))
              (run "delete >NIL: locale:catalogs/deutsch/HiSpeed.catalog")
          )

          (run "delete >NIL: prefs:presets/GED_#? all quiet")
          (run "delete >NIL: prefs:presets/GoldED all quiet")

          (if (exists "envarc:GoldED")
              (run "delete >NIL: envarc:GoldED all quiet")
          )

          (run "delete >NIL: env:GoldED all quiet")
          (run "delete >NIL: fonts:GoldED all quiet")
          (run "delete >NIL: s:GUIMake.pref")

          ((startup

              "GoldED"
              (prompt "remove 'GoldED:' assign ?\n")
              (help "You must have this assign removed !")
              (command  "; (removed)")
          ))

          ((startup

              "HiSpeed"
              (prompt "remove 'HiSpeed:' assign ?\n")
              (help "You must have this assign removed !")
              (command  "; (removed)")
          ))

          ((startup

              "GED_quick"
              (prompt "remove quickstarter access ?\n")
              (help "You must have this access removed !")
              (command  "; (removed)")
          ))

          ((startup

              "GUIMake"
              (prompt "remove GUIMake access ?\n")
              (help "You must have this access removed !")
              (command  "; (removed)")
          ))

        )
    )
    (exit (quiet))
))

; what parts should be installed ?

(if (= update 0) (

    (set parts (askoptions 

        (prompt "\n What parts do you want to have installed ? \n")

        (help (cat "\n"

            " You should decide for a complete installation if  \n"
            " you are a novice user. Preferences files, manuals \n"
            " & libraries are essential for running the editor  \n"
            " (e.g. the manual is referenced by GoldED's help   \n"
            " facility).                                        \n"
            "                                                   \n"
            " The QuickStarter is a small (4 KB) GoldED front-  \n"
            " end. You can use it AS IF it were a real editor.  \n"
            " For example you might type 'ed letter' to edit the\n"
            " file letter if the QuickStarter were named 'ed'.  \n"
            " The big advantage of a QuickStarter is its abilty \n"
            " to pass a new job to an already running instance  \n"
            " of GoldED (if there is any). Needless to say that \n"
            " this happens *very* fast. The QuickStarter may be \n"
            " made resident (the main editor may not).          \n"
            "                                                   \n"
            " Backups of your presets (if available) are made,  \n"
            " however your current configuration (if available) \n"
            " is OVERWRITTEN. I would suggest to split it into  \n"
            " pieces (e.g. menu preset, display preset, ...)    \n"
            " if you want to keep parts of it.                  \n"
            "                                                   \n"
            " Libraries are not overwritten unless they are out-\n"
            " dated (depends on version/revision number).       \n"
          ))

        (choices

            " main editor & manual"
            " QuickStarter"
            " libraries"
            " support tools"
         )

        (default 255))
    ))

    (set parts 255)
)

(complete 1)

(if (OR (IN parts 0) (IN parts 6)) (

    (if (= update 1) 

        ; 0 = medRes icons, 1 = hiRes icons

        (if (> (getsize "golded:golded.info") 800)

            (set icons 2)
            (set icons 0)
        )

        ((set icons (askchoice

            (prompt  "Select preferred icon type")

            (choices

                " med-res icons (pixel ratio 1:2)"
                " hi-res  icons (pixel ratio 1:1)"
            )

            (help (cat "\n"

                " Select med-res if the pixel ratio of your preferred\n"
                " screen resolution is approx. 1:2 (e.g. in 640*200  \n"
                " mode the pixel width is half of pixel height).     \n"
                "                                                    \n"
                " Select hi-res if the pixel ratio of your preferred \n"
                " resolution is approx. 1:1 (eg. 640*400 or 800*600).\n"
            ))

            (default 1)
        ))
    ))
))

(complete 2)

; install the editor itself ?

(if (IN parts 0) (

    (set reboot 1)

    (if (= update 1)

        (set target "golded:/")

        ((set target (askdir

            (prompt  " Where do you want to have the package installed ? \n")

            (help (cat "\n"

                " Simply select a directory (a root directory is    \n"
                " fine, too). I'm going to create a new directory   \n"
                " called 'GoldED' within the directory you specify. \n"
                " You should select a directory which has an icon   \n"
                " attached to it (e.g. SYS:Utilities).              \n"
                "                                                   \n"
                " The GoldED directory will keep several support    \n"
                " files/tools as well as the main editor. ARexx     \n"
                " macros related to GoldED are usually kept in a    \n"
                " subdirectory of GoldED. Furthermore the manuals   \n"
                " reside in GoldED's directory.                     \n"
            ))

            (default "SYS:TOOLS")
        ))
    ))

    (set @default-dest target)

    (complete 5)

    (set targetsize (getdiskspace target))

    (if (< targetsize 1250000) (

        (if (<> (getdevice target) "RAM") (

            (abort (cat "\n"

                " This installation requires about 1.2 MB free \n"
                " on the volume where you wish to install GED. \n"
                " Please make this space available and then re-\n"
                " install.                                     \n"
            ))
        ))
    ))

    (complete 10)

    (copyfiles

        (source "data/main")
        (dest target)
        (infos)
        (all)
    )

    (complete 15)

    (if (= icons 0)

        (copyfiles

          (source "data/Icons/GoldED")
          (dest (tackon target "GoldED"))
          (all)
          (infos)
        )
    )

    (makeassign "GoldED" (tackon target "GoldED"))

    ; decrunch manual (self-extracting)

    (run "data/doc/Manual.run GoldED:")

    ; remove obsolete files

    (delete "GoldED:GoldED.guide" (infos))
    (delete "GoldED:Hi!" (infos))

    (complete 20)

    (if (= update 1)

        (
            (set catalogs 3)

            (if (exists "locale:catalogs/deutsch/golded.catalog" (noreq))

                (
                    (set catalogs 2)
                    (delete "locale:catalogs/deutsch/golded.catalog")
                )
            )
        )

        ((set catalogs (askoptions

            (prompt "\n What catalogs do you want to have installed ? \n")

            (choices
                " English"
                " German "
            )

            (help (cat "\n"

                " Catalogs are required by OS2.1 or better to localize\n"
                " GoldED, i.e. to make the editor use the language    \n"
                " selected by the locale preferences program (however \n"
                " menus are not loacalized since menus are not part of\n"
                " the editor itself).                                 \n"
            ))

            (default 3)
        ))
    ))

    (if (not (exists "locale:" (noreq))) (

        (makedir "sys:locale")
        (makeassign  "locale" "sys:locale")
    ))

    (if (not (exists "locale:catalogs"))) (makedir "locale:catalogs")

    (if (IN catalogs 1) (

        (if (not (exists "locale:catalogs/deutsch"))) (makedir "locale:catalogs/deutsch")

        (copyfiles

            (source "data/catalogs/deutsch")
            (dest   "locale:catalogs/deutsch")
            (all)
        )
    ))

    (if (= update 0)

        (   
            (makeassign  "GoldED" (tackon target "GoldED"))
            
            (startup

                "GoldED"

                (prompt "Add 'GoldED:' assign to 's:user-startup' ? \n")

                (help (cat "\n"
                
                    " This editor does support user menus, i.e. you can \n"
                    " set up own menu items of several types (scripts,  \n"
                    " ARexx macros, DOS commands, ...). Thus ususally   \n"
                    " external files have to be referenced. It is quite \n"
                    " convenient - and strongly recommended - to place  \n"
                    " files related to GoldED in a symbolic directory   \n"
                    " GoldED: (or one of its subdirectories). If you    \n"
                    " don't set up an approbiate assign you will run    \n"
                    " into TROUBLE. Nevertheless, the main editor itself\n"
                    " does not need any assign to run. Actually it does \n"
                    " not need any external file at all apart from its  \n"
                    " config file (envarc:GOLDED/GOLDED.PREFS).         \n"
                    "                                                   \n"
                )
            )
            
            (command  ("ASSIGN >NIL: GOLDED: %s " (tackon target "GoldED")))
        ))
    )
))

(complete 25)

; install QuickStarter ?

(if (IN parts 1) (

    (set progname (askchoice

        (prompt " Choose a name for the QuickStarter")

        (help (cat "\n"

            " The QuickStarter is a small (4 KB) GoldED front-  \n"
            " end. You can use it AS IF it were a real editor.  \n"
            " For example you might type 'ed letter' to edit the\n"
            " file letter if the QuickStarter were named 'ed'.  \n"
            " The big advantage of a QuickStarter is its abilty \n"
            " to pass a new job to an already runnning instance \n"
            " of GoldED (if there is any). This happens FAST.   \n"             
            "                                                   \n"
            " The QuickStarters default name is 'ED' but feel   \n"
            " free to choose any name you like. Personally, I   \n"
            " prefer to use 'ED' (replacing Commodore's ED).    \n"
        ))

        (choices 

            "GED"
            "ED"
            "(other)"
        )

        (default 1)
    ))

    (complete 30)

    (if (= progname 0) (set name "GED"))
    (if (= progname 1) (set name "ED" ))

    (if (= progname 2)

        (set name (askstring

            (prompt  " Enter a name:\n")

            (help (cat "\n"

                " Any name (GED, ED, ...) will do. Existing files are \n"
                " overwritten. If you decide for 'ED', the original ED\n" 
                " is lost (well, let's call it a gain :-)              \n"
            ))

            (default "ED")
        ))
    )

    (complete 35)

    (set comdir (askdir

        (prompt (cat "\n"

            " Now let's place the QuickStarter within a valid   \n"
            " command directory. Select a directory:            \n"
        ))

        (help (cat "\n"

            " You should select one of these directories if you \n"
            " want to run the editor simply by typing its name, \n"
            " no matter what your current path is:              \n"
            "                                                   \n"
            " SYS:C, SYS:TOOLS, SYS:UTILITIES or SYS:SYSTEM     \n"
            "                                                   \n"
            " If you choose ED as default name, you must either \n"
            " place the quick starter into c: or delete the old \n"
            " ED from c: to prevent unpredictable behaviour.    \n"
        ))

        (default "C:")
    ))

    (copyfiles 

        (source  "data/main/GoldED/ED")
        (dest    comdir)
        (newname name)
    )

    (run "resident >NIL: ED remove")

    (startup

        "GED_quick"

        (prompt "\n Make QuickStarter resident ? \n")

        (help (cat "\n"

            " I would suggest to make the QuickStarter (4 KB)   \n"
            " resident - it will work faster.                   \n"
        ))

        (command  (cat "resident " (tackon comdir name) " pure"))
    )
))

(complete 40)

; install presets ...

(if (IN parts 0) (

    (set prefsdir "prefs:presets/GoldED")

    (if (exists prefsdir) (

        (set bakdir "prefs:presets/GED_BAK")

        (if (exists bakdir) (

            (while (exists bakdir) (
                (set bakdir (cat bakdir "X"))
            ))
        ))

        (complete 45)

        (working "creating backup of old presets ...")

        (complete 50)

        (copyfiles

          (source prefsdir)
          (dest   bakdir)
          (nogauge)
          (all)
        )

        (message (cat "\n"

            "Backups of your old preferences have been written\n"
            "to directory:\n\n"

             bakdir
        ))

        (run (cat "delete " prefsdir " all quiet"))
    ))

    (complete 55)

    (copyfiles

      (source "data/presets")
      (dest   "prefs:presets")
      (all)
    )

    (complete 60)

    ; install config file ...

    (set language 255)

    ; already a language selected (while installing main editor) ?

    (if (= catalogs 1) (set language 0))
    (if (= catalogs 2) (set language 1))

    (if (= language 255) (

        (set language (askchoice

            (prompt "\n Choose default menu definition file: \n")

            (choices

                "English"
                "Deutsch"
            )

            (help (cat "\n"

                " GoldED is localized (i.e. uses the locale library   \n"
                " of WB2.1/3.x) as far as its internal textes are     \n"
                " concerned. Since menus are not part of the editor   \n"
                " itself they are not localized. Instead, the user may\n"
                " specify a menu definition file to get menus in his/ \n"
                " her preferred language.                             \n"
            ))

            (default 0)
        ))
    ))

    (set guimake (askbool

        (prompt "\n Install GUIMake's menu ('93 Rico Krasowski) ?")

        (help (cat "\n"

            " GUIMake is a GUI driven compiler frontend for GoldED\n"
            " (to be used instead of makefiles). Supports project \n"
            " management and comfortable error handling (e.g. jump\n"
            " to first error after compilation). Included with    \n"
            " kind permisssion of the author of GUIMake.          \n"
            "                                                     \n"
            " Supported compiler(s) so far: unregistered DICE and \n"
            " registered DICE.                                    \n"
        ))

        (default 1)
    ))

    (if (= guimake 1)

        (
            (if (= language 0)

                (set menufile "GUI_FactoryUS.men")
                (set menufile "GUI_FactoryD.men" )
            )

        )

        (
            (if (= language 0)

                (set menufile "FactoryUS.men")
                (set menufile "FactoryD.men" )
            )
        )
    )

    (if (= (database "vblank") 50) (

        (set vblank 1)
        (set vblank 3)
    ))

    (complete 61)

    (set screen (askchoice

        (prompt "\n Choose default screen resolution \n")

        (choices

            "custom screen NTSC"
            "custom screen NTSC interlaced"
            "custom screen PAL"
            "custom screen PAL interlaced"
            "workbench screen"
        )

        (default vblank)

        (help (cat "\n"

            " Decide for a default screen mode to be used when the\n"
            " editor is started for the 1st time. I would suggest \n"
            " to use a custom screen for this will make GoldED run\n"
            " faster and look much nicer.                         \n"
        ))
    ))

    (complete 62)

    (if (= screen 4)

        (set display "workbench.dsp")

        (
            (if (< (/ (getversion) 65536) 39)

                (
                    (set mode (askchoice
                    
                        (prompt "Look & feel")

                        (choices

                            "Blue     (2 colors, faaaast)"
                            "TKEd     (4 colors, bright red)"
                            "Sun      (4 colors, orange-grey)"
                            "TPP      (4 colors, dark blue)"
                            "Ocean    (4 colors, bright green)"
                            "Stone    (2 colors, grey, fast)"
                            "Leaf     (4 colors, my favourite)"
                        )

                        (help (cat "\n"

                            " Suggestion: use a 2-color mode if your Amiga  \n"
                            " isn't that fast (68000) but a four color mode \n"
                            " for any other Amiga. Be warned: There a many  \n"
                            " more modes available from within GoldED :-)   \n"
                        ))
                    ))
                )

                (
                    (set mode (askchoice
                    
                        (prompt "Look & feel")

                        (choices

                            "Blue     (2 colors, faaaast)"
                            "TKEd     (4 colors, bright red)"
                            "Sun      (4 colors, orange-grey)"
                            "TPP      (4 colors, dark blue)"
                            "Ocean    (4 colors, bright green)"
                            "Stone    (2 colors, grey, fast)"
                            "Leaf     (4 colors, my favourite)"
                            "CED-Blue (4 colors, bright blue)"
                            "Tennis   (4 colors, brown-green)"
                        )

                        (help (cat "\n"

                            " Suggestion: use a 2-color mode if your Amiga  \n"
                            " isn't that fast (68000) but a four color mode \n"
                            " for any other Amiga. Be warned: There a many  \n"
                            " more modes available from within GoldED :-)   \n"
                        ))
                    ))
                )
            )

            (if (= mode 0) (set display "Blue"  ))
            (if (= mode 1) (set display "TKEd"  ))
            (if (= mode 2) (set display "Sun"   ))
            (if (= mode 3) (set display "TPP"   ))
            (if (= mode 4) (set display "Ocean" ))
            (if (= mode 5) (set display "Stone" ))
            (if (= mode 6) (set display "Leaf"  ))
            (if (= mode 7) (set display "CED"   ))
            (if (= mode 8) (set display "Tennis"))

            (if (or (= screen 0) (= screen 1))

                (set display (cat display "_NTSC"))
                (set display (cat display "_PAL" ))
            )

            (if (or (= screen 1) (= screen 3)) (

                (set display (cat display "_LACE"))
            ))

            (set display (cat display ".dsp"))
        )
    )

    (complete 63)

    (set printer (askchoice

        (prompt "\n What printer do you own ? \n")

        (choices

            "DeskJet or similar (Olivetti, Fujitsu, ...)"
            "Laser printer (PCL)"
            "none/other"
        )

        (default 0)

        (help "\n Simply select the printer model you own.")
    ))

    (if (= printer 2)

        (set prtfile "standard.prt"  )
        (set prtfile "DeskJetLQ.prt" )
    )

    (complete 64)

    (set proglang (askchoice

        (prompt "\n Select preferred programming language:\n")

        (choices

            "C"
            "Pascal"
            "Basic"
            "other"
        )

        (default 0)

        (help (cat "\n"

            " GoldED offers smart indention after keywords like   \n"
            " IF. The indention scheme depends on your programming\n"
            " language. Additionally, a C-dictionary is available \n"
            " (required for AutoCompletion).                      \n"
        ))
    ))

    (if (= proglang 0) 

        ((set indention  "C.ind") 
         (set dictionary "C.dic"))

        ((set indention  "empty.ind")
         (set dictionary "empty.dic"))
    )

    (if (= proglang 1) (set indention "Pascal.ind"))
    (if (= proglang 2) (set indention "Basic.ind"))

    (copyfiles

        (source "data/envarc")
        (dest "envarc:")
        (infos)
        (all)
    )

    (set prefs " data/presets/GoldED/")

    ; create main preferences file by joining preset files (order is important)

    (run (cat
       
       "JOIN "

       (cat prefs "standard.msc")
       (cat prefs "standard.key")
       (cat prefs "empty.ref"   )
       (cat prefs  display      )
       (cat prefs "standard.def")
       (cat prefs  prtfile      )
       (cat prefs "standard.tab")

       " AS T:GED.prefs"
    ))

    (run (cat
       
       "JOIN T:GED.prefs "

       (cat prefs  menufile     )
       (cat prefs  dictionary   )
       (cat prefs  indention    )
       (cat prefs "standard.lay")
       (cat prefs "empty.prj"   )
       (cat prefs "standard.hnt")
       (cat prefs "standard.gui")
       (cat prefs "standard.api")

       " AS envarc:GoldED/GoldED.prefs"
    ))

    (copyfiles

        (source "envarc:GoldED")
        (dest   "env:GoldED")
        (all)
        (infos)
    )

    ; install 2nd set of icons (pixel ratio approx. 1:2) ?

    (if (= icons 0)

        (copyfiles 

          (source "data/Icons/Envarc")
          (dest   "envarc:")
          (infos)
          (all)
        )
    )
))

(complete 65)

(if (= update 0) (

    ; install libraries ?

    (if (IN parts 2) (

        (if (exists "support/amigaguide")

            (copylib

                (prompt "Installation der AmigaGuide-Library...")
                (help @copylib-help)
                (source "support/amigaguide/amigaguide.library")
                (dest "libs:")
                (confirm)
            )
        )

        (if (exists "support/reqtools") (

            (copylib

                (prompt "Installation der Reqtools-Library...")
                (help @copylib-help)
                (source "support/reqtools/reqtools.library")
                (dest "libs:")
                (confirm)
            )

            (if (not (exists "envarc:ReqTools.prefs")) (
                (copyfiles (source "support/reqtools/ReqTools.prefs") (dest "envarc:"))
            ))
        ))

        (if (exists "support/xpk") (

            (copylib

                (prompt "Installation der XpkMaster-Library...")
                (help @copylib-help)
                (dest "libs:")
                (source "support/xpk/xpkmaster.library")
                (confirm)
            )

            (if (not (exists "libs:compressors"))

                (copyfiles

                    (source "support/xpk/compressors")
                    (dest "libs:compressors")
                    (all)
                )
            )
        ))
    ))

    (complete 70)

))

; install font (has been revised, i.e. has to be installed in update mode, too)

(copyfiles

    (source "data/fonts" )
    (dest   "fonts:")
    (all)
    (nogauge)
)

(complete 75)

; process second disk ...

(if (exists "/GoldED2")

    (set from "/GoldED2/")

    (
         ; is this a Fish disk (i.e. name of 2nd disk unknown) ?

         (if (= @app-name "GoldED/FF") (

             (while (not (exists "df0:GoldED2.info"))

                 (
                   (message (cat "\n"

                       " Please insert part II of the GoldED distribution\n"
                       " into disk drive df0: ...                        \n"
                   ))
                 )
             )

             (makeassign "GOLDED2" "df0:")
         ))

         (set from "GoldED2:GoldEd2/" )
    )
)

; install main editor (2nd part) ?

(if (IN parts 0) (

    ; copy hires icons ?

    (if (= icons 1)

        (copyfiles

            (source (cat from "data/main"))
            (dest target)
            (all)
        )
    )

    ; decrunch manual (self-extracting)

    (run (cat from "data/doc/Anleitung.run GoldED:"))
))

; install tools ?

(if (IN parts 3) (

    (set drive "GoldED:Tools")

    (if (not (exists drive)) (makedir drive))

    (complete 80)

    ; get rid of blank within destination path name ("Ram disk:") ...

    (if (= "RAM" (getdevice drive)) (set drive "RAM:"))

    ; install catalogs

    (if (not (exists "locale:" (noreq))) (

        (makedir "sys:locale")
        (makeassign  "locale" "sys:locale")
    ))

    (copyfiles 

        (source (tackon from "tools/locale"))
        (dest "locale:")
        (all)
    )

    (if (exists "GUIMake:" (noreq)) (set guimake 1))

    (if (= guimake 1) (

        (set target (tackon drive "GUIMake"))

        ((startup

            "GUIMake"

            (prompt "\n Add 'GUIMake:' assign to 's:user-startup' ? \n")

            (help (cat "\n"

                " A 'GUIMake:' assign is required if you want to use\n"
                " GUIMake (GUI driven compiler frontend).           \n"
            ))

            (command  ("ASSIGN >NIL: GUIMake: %s " target))
        ))
    ))

    (set target (tackon drive "HiSpeed"))

    (if (not (exists target)) (makedir target))

    (makeassign "HISPEED" target)

    (run "delete HISPEED:#? ALL QUIET")

    (copyfiles

        (source (cat from "tools/HiSpeed"))
        (dest "HISPEED:")
        (all)
        (infos)
    )

    (copyfiles (source (cat from "tools/HiSpeed.info")) (infos) (dest drive))

    (complete 85)

    (if (= update 0) (

        ((startup

            "HISPEED"

            (prompt "\n Add 'HISPEED:' assign to 's:user-startup' ? \n")

            (help (cat "\n"

                " A 'HISPEED:' assign is required if you want to run\n"
                " HiSpeed without having to worry about the current \n"
                " path (i.e. you won't have to CD to HiSpeed's dir).\n"
                " However, this assignment is not required if you   \n"
                " don't intend to use the softfonts of this package.\n"
                "                                                   \n"
            ))

            (command  ("ASSIGN >NIL: HISPEED: %s " target))
        ))

        ; remove preferences of former versions

        (if (exists "envarc:HiSpeed.config")
            (delete "envarc:hispeed.config")
        )

        (if (exists "s:HiSpeed.config")
            (delete "s:HiSpeed.config")
        )
        
    ))

    (if (exists "envarc:HiSpeed")

        (
            (copyfiles

                (source  "envarc:HiSpeed/HiSpeed.prefs")
                (newname "HiSpeed.prefs.bak")
                (dest    "envarc:HiSpeed")
            )

            (delete "envarc:HiSpeed/HiSpeed.prefs")
        )

        (makedir "envarc:HiSpeed")
    )

    (copyfiles

        (source  (cat from "tools/envarc"))
        (dest    "envarc:")
        (infos)
        (all)
    )

    (complete 90)

    (copyfiles

        (source (cat from "tools"))
        (dest "GoldED:Tools")
        (pattern "(U|ED|PRJ|REC|GUI|GED)#?")
        (infos)
    )

    (makeassign "GUIMake" "GoldED:tools/guimake")

    (copyfiles

        (source (cat from "tools/GUIMake/s/GUIMake.pref"))
        (dest "s:")
    )

    (complete 95)
))

; delete temporary files

(if (not (= update 2))

    (message (cat "\n"

        "Installation complete. You should reboot your Amiga \n"
        "before running this GED-release for the 1st time.   \n"
        "Have fun :-)                                        \n"
    ))
)

(complete 100)
