; Installer for new german THOR locales
; by Andreas Bombe <andreas.bombe@munich.netsurf.de>
;
; $VER: InstallThorGer 2.4 (23.11.96)

(procedure p_mydebug #debugtext
    (if #debug
        (debug #debugtext)
    )
)

;**********************************************************

(set    #currver    2
        #currrev    4
        #debug      0
)

(set    #nothor     "Konnte THOR-Installation nicht finden."
        #cantdebug  "Debugausgaben nicht möglich mit dieser Installerversion!"
        #cptext     "Kopiere %s"
        #exitmsg    (cat "\nDie Installation ist beendet.\n\n\n"\
                         "Sollten Sie Fehler finden oder "\
                         "Verbesserungsvorschläge haben, "\
                         "schreiben Sie mir:\n\n"\
                         "andreas.bombe@munich.netsurf.de")
)

(if (AND #debug (= @installer-version 0))
    (abort #cantdebug)
)

(p_mydebug (cat "attempting to install German locales for THOR "\
                #currver "." #currrev "\n"))

(if (exists "ENV:THOR" (noreq))
    (
        (set #thorpath (getenv "THOR/THORPath"))
        (set #thorpath (substr #thorpath 0 (- (strlen #thorpath) 1)))
        (set #destdir (tackon #thorpath "catalogs/deutsch"))
        (set @default-dest #destdir)
    )
    (abort #nothor)
)

(p_mydebug (cat "thorpath is " #thorpath))

(if #debug
    (
        (set #instvernum (getversion (tackon #destdir "thor.catalog")))
        (set #instver (/ #instvernum 65536))
        (set #instrev (- #instvernum (* #instver 65536)))
        (debug "Catalogs" (cat "V" #instver "." #instrev) "already installed. Vernum =" #instvernum)
    )
)

(foreach "" "#?.catalog"
    (copylib
        (prompt (#cptext @each-name))
        (help @copylib-help)
        (confirm)
        (source @each-name)
        (dest #destdir)
    )
)

(exit #exitmsg)

