; NLV Installer Script
; by Jürgen Schmitz

;--------------------------------------------------------------------
;set text vars
;

(set #inst
  (cat "Installation script of NodelistViewer (NLV).\n\n"
       "NLV is published as SHAREWARE.\n"
       "for more details read the manual.\n\n"
       "The program is copyright (c) by J.Schmitz [SOFT]\n"
       "all rights reserved"
))

(set #nlvDrawer
  (cat "Select a drawer for NodelistViewer"
))

(set #nlvLanguages
  (cat "Select languages to install for NodelistViewer"
))

(set #nlvLanguagesDefault -1)

(set #exit
  (cat "NLV is installed now!\nLike it, use it..."
))

;--------------------------------------------------------------------
;install
;

(message #inst)

(welcome)

(set @default-dest
     (askdir (prompt #nlvDrawer)
             (default @default-dest)
             (help @askdir-help)))

(copyfiles (source "/NodelistViewer")
           (dest @default-dest)
           (infos))

(if (exists "SYS:Locale" (noreq))
(
  (if (exists "Locale:" (noreq))
  (
   (set res
    (askoptions (prompt #nlvLanguages)
                (help @askchoice-help)
                (default #nlvLanguagesDefault)
                (choices "deutsch" "english")
    )
   )

; deutscher Catalog wird nicht kopiert!
;   (if (in res 0)
;     (copyfiles (source "/Catalogs/deutsch/NodelistViewer.catalog")
;                (dest "Locale:Catalogs/deutsch")
;     )
;    )

    (if (in res 1)
      (copyfiles (source "/Catalogs/english/NodelistViewer.catalog")
                 (dest "Locale:Catalogs/english")
      )
    )
  ))  
))

(exit #exit)
