; Script created by Bruce Steers bsteers@btinternet.com

(set ver "$VER: Install_AmIRSay 4.0 (04/04/00)")
                       (set verN "4.0")

(set v39 (>= (/ (getversion "exec.library" (resident)) 65536) 39))
(set srcdir (pathonly @icon))

(welcome "\nWelcome to the Install_AmIRSay "verN" Script\nThis script will install all AmIRSay related files and offer to create a few handy ALIAS's")

(set @default-dest (expandpath "miami:/amirc"))
 (set dst
  (askdir
  (default @default-dest)
  (newpath @default-dest)
  (prompt "\n\"AmIRC/\" dir ?\n Select AmIRC Program Dir")
  (help "\n\nYOU MUST point the way to AmIRC\'s Drawer")
  )
 )

(if (not (exists (tackon dst "AmIRC")))
(abort "Sorry but AmIRC did not exist\nin the drawer you chose ???\n\n YOU MUST point the way to AmIRC\'s Drawer")
)

(complete 10)

(set @default-dest (expandpath dst))

  (copyfiles
  (source "AmIRSayPrefs")
  (dest @default-dest)
  (prompt "Install AmIRSayPrefs to your "@default-dest" dir ?\n")
  (help "")
  (confirm)
  (infos)
  )

  (copyfiles
  (source "rexx/AmIRSay.amirx")
  (dest (tackon @default-dest "rexx/"))
  (prompt "Install AmIRSay.amirx to your \"AmIRC/rexx\" dir ?")
  (help "")
  (confirm)
  (infos)
  )

  (copyfiles
  (source "amirsay.readme")
  (dest @default-dest)
  (prompt "Install AmIRSay.readme to your \"AmIRC/\" dir ?")
  (help "")
  (confirm)
  (infos)
  )
  (if (= @user-level 2)
    ( (set guideDST (select (askchoice
                        (prompt "Where do you want the Guide Installed ?")
                        (choices @default-dest "Help:" "Help:English")
                        (help "Choose 1 of the 3 destinations for the AmIRSay.guide\n\nInstalling guide will make the HELP key load the guide relevant to where the mouse is or what page is open in the GUI")
                        (default 0)
                        )
                @default-dest "Help:" "Help:English"
                )
      )
     (copyfiles
     (source "AmIRSay.guide")
     (dest guideDST)
     (infos)
     )
    )
   (
    (copyfiles
    (source "AmIRSay.guide")
    (dest @default-dest)
    (infos)
    )
   )
  )


(set lang
	(askoptions
		(prompt "Select Language catalogs to install\nEnglish is Built in.\n")
		(help @askchoice-help)
		(choices "Deutsch" "Français" "Dansk")
		(default 0)
	)
)

 (if (or (= lang 1) (or (= lang 3) (or (= lang 5) (= lang 7))))
  (
  (set cata (tackon srcdir "catalogs/deutsch/"))
    (copyfiles
    (source cata)
    (dest "LOCALE:Catalogs/deutsch/")
    (all)
    )
  )
 )


 (if (or (= lang 2) (or (= lang 3) (or (= lang 6) (= lang 7))))
  (
  (set cata (tackon srcdir "catalogs/français/"))
    (copyfiles
    (source cata)
    (dest "LOCALE:Catalogs/français/")
    (all)
    )
  )
)

 (if (or (= lang 4) (or (= lang 5) (or (= lang 6) (= lang 7))))
  (
  (set cata (tackon srcdir "catalogs/dansk/"))
    (copyfiles
    (source cata)
    (dest "LOCALE:Catalogs/dansk/")
    (all)
    )
  )
)

 (set cfg (tackon @default-dest "Default.AmIRCfg"))

   (run "rx rexx/add2amirc.rexx "cfg""
   (prompt "\nI can add some usefull aliases to your Default.AmIRCfg (Reccomended)\n"
"/SAYS = Start AmIRSay        \n"
"/SAYV = Get AmIRSay Version  \n"
"/SAYN = Check for New Version\n"
"/SAYG = load GUI             \n"
"/SAYU = Update Preferences   \n"
"/SAYQ = QUIT AmIRSay         \n"
"/SAY# = Silence/Hear Channels\n\n"
"/SAY? = Call Help            \n\n"
"Also i will ask to backup Default.AmIRCfg .")
   (help "")
   (confirm AVERAGE)
   )


(complete 99)
(set @default-dest (expandpath dst))
(complete 100)
(exit  "\n\n" @app-name " Installaton is now over.\n\nPlease Read the Docs to understand how to use AmIRSay\n\n()_\\\n() /")
