; $VER: Install_NetCall 1.4 (03.06.95)

(transcript "Installiere NetCall...")

(set default-dest "Mail:bin")

;
; Default-Katalog (English)
;

(set #NetCallDest   (cat "Where do you wish to install NetCall? "
                         "(no drawer will be created by this script)"))
(set #NetCallWorking     "Installing NetCall...")
(set #NetCallIcon   (cat "\nDo you wish to install the NetCall-icon?\n\n"
                         "(If you execute NetCall from the shell or from "
                         "scripts only, you don't need the icon)"))
(set #InstallNetCallIcon "Installing NetCall-icon...")
(set #NetCallCfg    (cat "Where do you wish to install the NetCall "
                         "configuration file (NetCall.cfg)?"))
(set #CfgMan             "Install NetCall.cfg by hand")
(set #NetCallCfgExists   "NetCall.cfg already exists!\n\nOverwrite?")
(set #InstallExtacy      "Installing extacy.library...")
(set #ExtacyLibrary      "Where do you wish to install the extacy.library?")
(set #German             "german (built-in)")
(set #English            "english")
(set #WhichCatalogs      "Which language-catalogs do you want to install?")
(set #InstallEnglish     "Installing english catalog...")
(set #CatalogDir    (cat "Where do you wish to install the "
                         "language-catalog(s)?"))
(set #WhichDocs          "Which documents do you want to install?")
(set #EngAmigaGuide      "English Amiga-Guide")
(set #EngDocumentation   "English Document (ASCII)")
(set #EngTeXDVI          "English TeX DVI")
(set #GerAmigaGuide      "German Amiga-Guide")
(set #GerDocumentation   "German Document (ASCII)")
(set #GerTeXDVI          "German TeX DVI")
(set #DocsDir            "Where do you wish to install the document(s)?")
(set #ByeText            "Please read the configuration-chapter in the manual...")

;
; eingestelle Sprache
;

(if (= @language "deutsch")
  (
    (set #NetCallDest   (cat "In welches Verzeichnis soll NetCall installiert werden? "
                             "(es wird KEINE eigene Schublade fr NetCall erzeugt.)"))
    (set #NetCallWorking     "Installiere NetCall...")
    (set #NetCallIcon   (cat "\nMchten Sie das NetCall-Icon installieren?\n\n"
                             "(Wird NetCall nur ber die Shell oder ber "
                             "Skripts aufgerufen, ist das Icon nicht notwendig)"))
    (set #InstallNetCallIcon "Installiere NetCall-Icon...")
    (set #NetCallCfg    (cat "In welches Verzeichnis soll die "
                             "Konfigurations-Datei von NetCall "
                             "(NetCall.cfg) kopiert werden?"))
    (set #CfgMan             "NetCall.cfg manuell installieren")
    (set #NetCallCfgExists   "NetCall.cfg existiert bereits!\n\nberschreiben?")
    (set #InstallExtacy      "extacy.library installieren...")
    (set #ExtacyLibrary (cat "In welches Verzeichnis soll die "
                             "extacy.library kopiert werden?"))
    (set #German             "deutsch (eingebaut)")
    (set #English            "englisch")
    (set #WhichCatalogs      "Welche Sprach-Kataloge sollen installiert werden?")
    (set #InstallEnglish     "englischer NetCall.cfg installieren...")
    (set #CatalogDir    (cat "In welches Verzeichnis soll(en) der/die "
                             "Sprach-Katalog(e) kopiert werden?"))
    (set #WhichDocs          "Welche Anleitungen von NetCall sollen installiert werden?")
    (set #EngAmigaGuide      "englisches Amiga-Guide")
    (set #EngDocumentation   "englische Dokumentation (ASCII)")
    (set #EngTeXDVI          "englisches TeX DVI")
    (set #GerAmigaGuide      "deutsches Amiga-Guide")
    (set #GerDocumentation   "deutsche Dokumentation (ASCII)")
    (set #GerTeXDVI          "deutsches TeX DVI")
    (set #DocsDir            "In welches Verzeichnis soll(en) die Anleitung(en) kopiert werden?")
    (set #ByeText            "Bitte lesen Sie das Konfigurations-Kapitel in der Dokumentation...")

  )
)

;
; NetCall-Zielverzeichnis auswhlen
;

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

;
; NetCall installieren
;

(working #NetCallWorking)

(if (AND (NOT (= (substr default-dest (- (strlen default-dest) 1 ) 1 ) ":" ))
         (NOT (= (substr default-dest (- (strlen default-dest) 1 ) 1 ) "/" )))
  ((set default-dest (cat default-dest "/"))
    )
)

(makeassign "NETCALL" default-dest)

(copyfiles
   (prompt #NetCallWorking)
   (source "NetCall") (dest default-dest)
)

;
; NetCall-Icon installieren, falls erwnscht
;

(if (askbool (prompt #NetCallIcon)
             (help   @askbool-help))
  (copyfiles
    (prompt #InstallNetCallIcon)
    (source "NetCall.info") (dest default-dest)
  )
)

;
; NetCall.cfg in bestimmtes Verzeichnis kopieren
;

(set cfgpath (askchoice (prompt #NetCallCfg)
                        (help   @askchoice-help)
                        (choices "Mail:"
                                 default-dest
                                 #CfgMan)
                        (default 0)
              )
)

(if (= cfgpath 0)

  (if (exists "Mail:NetCall.cfg")
    (
      (if (askbool (prompt #NetCallCfgExists)
                   (help   @askbool-help))

        (copyfiles
          (source "NetCall.cfg") (dest "Mail:")
          (help   @copyfiles-help)
        )
      )
    )

    (copyfiles
      (source "NetCall.cfg") (dest "Mail:")
      (help   @copyfiles-help)
    )
  )

)

(if (= cfgpath 1)

  (if (exists (tackon default-dest "NetCall.cfg"))
    (
      (if (askbool (prompt #NetCallCfgExists)
                   (help   @askbool-help))

        (copyfiles
          (source "NetCall.cfg") (dest default-dest)
          (help   @copyfiles-help)
        )
      )
    )

    (copyfiles
      (source "NetCall.cfg") (dest default-dest)
      (help   @copyfiles-help)
    )
  )

)

;
; extacy.library kopieren
;

(if (exists "LIBS:extacy.library")
  (copylib
    (prompt #InstallExtacy)
    (help @copylib-help)
    (source "libs/extacy.library") (dest "LIBS:")
    (confirm)
  )
  ((set libpath (askchoice (prompt #ExtacyLibrary)
                        (help @askchoice-help)
                        (choices "LIBS:"
                                 default-dest)
                        (default 0)
                )
   )
   (if (= libpath 0)
    (copyfiles
      (source "libs/extacy.library") (dest "LIBS:")
    )
   )
   (if (= libpath 1)
    (copyfiles
      (source "libs/extacy.library") (dest default-dest)
    )
   )
  )
)

;
; NetCall.catalog kopieren
;

(set catalog (askoptions (prompt  #WhichCatalogs)
                         (help    @askoptions-help)
                         (choices #German
                                  #English)
                         (default 1)
             )
)

(if (<> 0 (BITAND catalog 2))
  (if (exists "LOCALE:catalogs/english/NetCall.catalog")
    (copyfiles
      (prompt #InstallEnglish)
      (help   @copyfiles-help)
      (source "catalogs/english/NetCall.catalog")
      (dest   "LOCALE:catalogs/english")
    )
  ((set catpath (askchoice (prompt  #CatalogDir)
                           (help    @askchoice-help)
                           (choices "LOCALE:catalogs"
                                    default-dest)
                           (default 1)
                )
   )
   (if (= catpath 0)
    ((if (not (exists "LOCALE:catalogs/english"))
       (makedir "LOCALE:catalogs/english")
     )
     (copyfiles
       (source "catalogs/english/NetCall.catalog")
       (dest   "LOCALE:catalogs/english")
     )
    )
   )
   (if (= catpath 1)
    ((if (not (exists "NETCALL:catalogs/english"))
       ((makedir "NETCALL:catalogs") (makedir "NETCALL:catalogs/english"))
     )
     (copyfiles
      (source "catalogs/english/NetCall.catalog")
      (dest   "NETCALL:catalogs/english")
     )
    )
   )
  )
 )
)

;
; Amiga-Guide von NetCall kopieren
;

(set docu (askoptions (prompt #WhichDocs)
                      (help @askoptions-help)
                      (choices #GerAmigaGuide
                               #GerDocumentation
                               #GerTeXDVI
                               #EngAmigaGuide
                               #EngDocumentation
                               #EngTeXDVI)
                      (default 1)
           )
)

(if (<> docu 0)
  ((set docdest
    (askdir
      (prompt  #DocsDir)
      (default default-dest)
      (help    @askdir-help)
    )
   )
   (if (<> 0 (BITAND docu 1))
    (copyfiles
      (source "Documentation/NetCall_Deutsch.guide")
      (dest   docdest)
      (infos)
    )
   )
   (if (<> 0 (BITAND docu 2))
    (copyfiles
      (source "Documentation/NetCall_Deutsch.dok")
      (dest   docdest)
      (infos)
    )
   )
   (if (<> 0 (BITAND docu 4))
    (copyfiles
      (source "Documentation/NetCall_Deutsch.dvi")
      (dest   docdest)
      (infos)
    )
   )
   (if (<> 0 (BITAND docu 8))
    (copyfiles
      (source "Documentation/NetCall_English.guide")
      (dest   docdest)
      (infos)
    )
   )
   (if (<> 0 (BITAND docu 16))
    (copyfiles
      (source "Documentation/NetCall_English.doc")
      (dest   docdest)
      (infos)
    )
   )
   (if (<> 0 (BITAND docu 32))
    (copyfiles
      (source "Documentation/NetCall_English.dvi")
      (dest   docdest)
      (infos)
    )
   )
  )
)


(set @default-dest default-dest)

(exit #ByeText)
