;
; $VER: IconLink installation 1.0 (29.6.2000))
;
; Copyright (c) 2000 Tom Granger
;

;-------------------------------------------------
;
; Localization
;

(if (= @language "deutsch")
  (
    ;
    ; Deutsche Texte
    ;

    (set #bad-wb "AmigaOS 3.5 ist Vorraussetzung für die Nutzung von IconLink.rexx !")
    (set #bad-wblib "Das externe Programm 'CopyIcons' benötigt workbench.library V 44+ (Bestandteil des BoingBag1 Archives)!")
    (set #welcome "Willkommen zur Installation von IconLink.rexx!")
    (set #selectdir "Bitte wählen Sie das Verzeichnis, in das IconLink.rexx kopiert werden soll!\nDefault ist REXX:")
    (set #selecttoolsdir "Bitte legen sie fest, wohin 'CopyIcon' und 'WBRun' kopiert werden sollen.\nDefault ist C:")
    (set #selectdocsdir "Bitte legen Sie fest, wohin die Anleitung (Amigaguide) kopiert werden soll.\nDefault ist HELP:")
    (set #askstarter "Wollen Sie 'LinkStarter.rexx' installieren?\n\n Dieses Script wird benötigt, um dem 'Tools' Menü der Workbench zwei neue Menüpunkte hinzuzufügen. Sie benötigen 'Linkstarter.rexx' NICHT, wenn Sie T.H.E. installiert haben.\n\nDieses Script wird in das Verzeichnis 'WBStartup' kopiert.")
    (set #copyrexx "Kopiere 'IconLink.rexx'...")
    (set #copydocs "Kopiere Anleitung...")
    (set #copycicon "Kopiere 'CopyIcon'...")
    (set #copywbrun "Kopiere 'WBRun'...")
    (set #copyicon "Kopiere Schublade 'Icons'...")
    (set #copystarter "Kopiere 'LinkStarter.rexx'")
    (set #yes "Ja")
    (set #no "Nein")
  )
  (
    (if (= @language "français")
      (
        ;
        ; Textes français
        ;

        (set #bad-wb "Vous devez avoir l'AmigaOS 3.5 pour pouvoir utiliser IconLink !")
        (set #bad-wblib "Vous devez avoir la workbench.library V 44+!\npour pouvoir utiliser copyicons !\n(Vous pouvez la trouver dans le package BoingBag1 sur Amiga.com)")
        (set #welcome "Bienvenue dans le script d'installation d'IconLink !")
        (set #selectdir "Choisissez un emplacement où installer CreateLink.rexx.\nL'emplacement par défaut est REXX:")
        (set #selecttoolsdir "Choisissez un emplacement où installer copyicon et WBRUN.\nL'emplacement par défaut est C:")
        (set #selectdocsdir "Choisissez un emplacement où installer la documentation.\nL'emplacement pas défaut est HELP:")
        (set #askstarter "Voulez-vous installer LinkStarter.rexx ?\n\n Ce programme est nécessaire pour ajouter deux nouvelles entrées dans le menu 'Outils' du Workbench. Vous n'avez pas besoin de LinkStarter si vous avez installé T.H.E !\n\nLe script sera installé dans le tiroir WBStartup du Workbench.")
        (set #copyrexx "Copie de CreateLink.rexx...")
        (set #copydocs "Copie des docs...")
        (set #copycicon "Copie de copyicon...")
        (set #copywbrun "Copie de WBRUN...")
        (set #copyicon "Copie du tiroir 'icons'...")
        (set #copystarter "Copie de LinkStarter.rexx")
        (set #yes "Oui")
        (set #no "Non")
      )
      (
        ;
        ; English texts
        ;

        (set #bad-wb "You must have AmigaOS 3.5 or newer to be able to use IconLink!")
        (set #bad-wblib "You need workbench.library V 44+!\nto be able to use copyicons !\n(Get it from the BoingBag1 package on Amiga.com)")
        (set #welcome "Welcome to IconLink's Installation script !")
        (set #selectdir "Please select where to install IconLink.rexx.\nDefault is REXX:")
        (set #selecttoolsdir "Please select where to install copyicon and WBRUN.\nDefault is C:")
        (set #selectdocsdir "Please select where to install the doc files.\nDefault is HELP:")
        (set #askstarter "Do you want to install 'LinkStarter.rexx' ?\n\n This program is needed to add two new menu items to Workbench's 'Tools' menu. You don't need 'LinkStarter' if you have T.H.E installed!\n\n The script will be installed in your 'WBStartup' drawer.")
        (set #copyrexx "Copying IconLink.rexx...")
        (set #copydocs "Copying docs...")
        (set #copycicon "Copying 'Copyicon'...")
        (set #copywbrun "Copying 'WBRun'...")
        (set #copyicon "Copying 'Icons' drawer...")
        (set #copystarter "Copying 'LinkStarter.rexx'")
        (set #yes "Yes")
        (set #no "No")
      )
    )
  )
)

;---------------------------------------------------------------------------
;
; Setup
;

(complete 0)

(if (< (getversion "SYS:c/loadwb") (* 44 65536))
  (abort #bad-wb)
)

(if (< (getversion "LIBS:workbench.library") (* 44 65536))
  (abort #bad-wblib)
)

(set @rexx-dest "REXX:")
(set @tool-dest "C:")
(set @docs-dest "HELP:")
(set @icon-dest "SYS:Prefs/Presets")
(set @wbstartup "SYS:WBStartup")

;----------------------------------------------------------------------------
;
; Welcome
;

(welcome #welcome)
(complete 10)

;----------------------------------------------------------------------------
;
; Setup target directories
;

(set #destdir
  (askdir
    (prompt #selectdir)
    (help @askdir-help)
    (default @rexx-dest)
  )
)
(complete 15)

(set #tooldir
  (askdir
    (prompt #selecttoolsdir)
    (help @askdir-help)
    (default @tool-dest)
  )
)
(complete 20)

(set default-level @user-level)
(user 2)
(set #docsdir
  (askdir
    (prompt #selectdocsdir)
    (help @askdir-help)
    (default @docs-dest)
  )
)
(user default-level)
(complete 25)

(set @default-dest #destdir)
(set @tool-dest #tooldir)
(set @docs-dest #docsdir)

(makedir @icon-dest
  (help @makedir-help)
  (infos)
)
(complete 30)

;---------------------------------------------
;
; Copying LinkStarter.rexx
;

(set default-level @user-level)
(user 2)
(if
  (askbool
    (prompt #askstarter)
    (help @askbool-help)
    (choices #yes #no)
  )
  (
    (user default-level)
    (copyfiles
      (prompt #copystarter)
      (help @copyfiles-help)
      (source "WBStartup/LinkStarter.rexx")
      (dest @wbstartup)
      (infos)
      (confirm)
    )
  )
)
(user default-level)
(complete 40)

;---------------------------------------------
;
; Copying IconLink.rexx
;

(copyfiles
  (prompt #copyrexx)
  (help @copyfiles-help)
  (source "rexx/IconLink.rexx")
  (dest @default-dest)
  (infos)
  (confirm)
)
(complete 50)

;------------------------------
;
; Copying docs
;

(copyfiles
  (prompt #copydocs)
  (help @copyfiles-help)
  (source "")
  (pattern "#?.(guide|readme)")
  (dest @docs-dest)
  (infos)
  (confirm)
)
(complete 60)

;----------------------------------------------
;
; Copying copyicon, WBRUN and the icons drawer
;

(copyfiles
  (help @copyfiles-help)
  (prompt #copycicon)
  (source "c/copyicon")
  (dest @tool-dest)
  (confirm)
)
(complete 70)

(copyfiles
  (help @copyfiles-help)
  (prompt #copywbrun)
  (source "c/wbrun")
  (dest @tool-dest)
  (confirm)
)
(complete 80)

(copyfiles
  (help @copyfiles-help)
  (prompt #copyicon)
  (source "icons/")
  (pattern "def_#?")
  (dest @icon-dest)
  (confirm)
)
(complete 90)

;----------------------
;
; End
;

(complete 100)
(exit)
