(set WhereTo "Wählen Sie das Verzeichnis wo LEXIKA hin soll\n(Ein Verzeichnis wird erstellt)")

(set CopyExe "Copying Lexika")
(set Copytxt "Copying Texte")
(set Copys "Copying S")
(set Copyc "Copying C")
(set Copyscr "Copying Scripts")
(set Copypin "Copying Pinsel")

(set StartP "\n\nFolgende Zeile wird in die \n User startup eingefügt \n Um Lexika zu starten ist ein reboot nötig ! \n Assign LEXIKA: \"")

;; Help messages
(set WhereToHelp "Wähle ein verzeichnis in das \n das Magazin installiert werden soll")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Procedures                                                             ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(procedure
        makedirstruct
        (set @default-dest (tackon @default-dest "Lexika"))
        (makedir @default-dest
                                (infos)
        )
        
        (makedir (tackon @default-dest "Texte")
                                (infos)
        )
        (set txtDest (tackon @default-dest "Texte"))
        
        (makedir (tackon @default-dest "C")
                                (infos)
        )
        (set CDest (tackon @default-dest "C"))
        
        (makedir (tackon @default-dest "S")
                                (infos)
        )
        (set SDest (tackon @default-dest "S"))
        
        (makedir (tackon @default-dest "Scripts")
                                (infos)
        )
        (set ScrDest (tackon @default-dest "Scripts"))
        
        (makedir (tackon @default-dest "Pinsel")
                                (infos)
        )
        (set pinDest (tackon @default-dest "Pinsel"))
)

(procedure
        installexes
        ;;
        ;; Procedure to copy the main executables
        ;;
        ;; No args, no locals, no returns.
        ;;
        
        (copyfiles
                (prompt CopyExe)
                (help @copyfiles-help)
                (source "LEXIKA:Lexika")
                (dest @default-dest)                
                (infos)
        )
        (copyfiles
                (prompt CopyExe)
                (help @copyfiles-help)
                (source "Lexika:Lexika.info")
                (dest @default-dest)
                (INFOs)
        )
)
(procedure
        installpin
        (copyfiles
                (prompt Copypin)
                (help @copyfiles-help)
                (source "pinsel/")
                (all)
                (dest pinDest)
                (infos)
        )
)

(procedure
        installdocs
        (copyfiles
                (prompt Copytxt)
                (help @copyfiles-help)
                (source "Texte/")
                (all)
                (dest txtDest)
                (infos)
        )
)
(procedure
        installscr
        (copyfiles
                (prompt copyscr)
                (help @copyfiles-help)
                (source "Scripts/")
                (all)
                (dest scrdest)
                (INFOS)
        )
)
(procedure
        installrexx
        (copyfiles
                (prompt CopyS)
                (help @copyfiles-help)
                (source "S/")
                (all)
                (dest SDest)
                (infos)
        )
)
(procedure
        installstore
        (copyfiles
                (prompt CopyX)
                (help @copyfiles-help)
                (source "C")
                (all)
                (dest CDest)
                (infos)
        )
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Start of the installer                                                 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(set hello "\nWillkommen zu\n\nLEXIKA V1.0\n By Frank Zender\n\n© 1995/96 Terrorsoft, Cologme\n\nLexika Install Script Version 1.0")

(message hello)
(welcome)

;; Get directory to install to
(set @default-dest (askdir
                                                (prompt WhereTo)
                                                (help WhereToHelp)
                                                (default @default-dest)
                                        )
)

;; Make the directory structure, we'll have some destination vars at the end
;; of this proccy too
(makedirstruct)
(complete 10)

;; Install the main executables
(installexes)
(complete 20)
;; Install the docs
(installdocs)
(complete 40)
;; Install Arexx examples
(installrexx)
(installpin)
(installscr)
(complete 60)
;; Install Storage dir
(installstore)
(complete 70)

;; Add to the user-startup
(startup "Lexika V1.0"
        (prompt (cat (cat StartP @default-dest) "\""))
        (help @startup-help)
        (command (cat (cat "ASSIGN LEXIKA: \"" @default-dest) "\""))
)

(complete 100)
