; Script created by Bruce Steers bsteers@btinternet.com

(set ver "$VER: Install_ksmED 2.2 (18.06.00)")
                   (set verN "2.2")

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

(welcome "\nWelcome to the Install_ksmED "verN" Script\nThis script will install ksmED to Your AmIRC drawer")


 (if (exists "Miami:/AmIRC")
  (set dst (expandpath "Miami:/AmIRC"))
  (set dst "AmIRC:")
 )


   (set dst
    (askdir
    (default dst)
    (newpath dst)
    (prompt "IF this IS NOT where AmIRC is installed\nSelect your way into the AmIRC drawer\nand then press Proceed")
    (help "\nCHOSE THE DRAWER AmIRC EXISTS IN\n\n" @askdir-help)
    )
   )

(complete 20)

 (set @default-dest (expandpath dst))
 (set ircheck (tackon dst "AmIRC"))

(if (= 0 (exists ircheck))
(
(abort "\n\nThe File AMIRC was not found in this drawer")
)
)


(complete 30)

  (copyfiles
  (source (tackon srcdir "ksmED"))
  (dest @default-dest)
  (infos)
  )

(complete 40)


  (copyfiles
  (source (tackon srcdir "ksmED.readme"))
  (prompt "Install the readme..")
  (dest @default-dest)
  (help @copyfiles-help)
  (confirm)
  (infos)
  )

(complete 50)

  (copyfiles
  (source (tackon srcdir "ksmED.guide"))
  (dest @default-dest)
  (prompt "Install the AmigaGuide..")
  (help @copyfiles-help)
  (confirm)
  (infos)
  )

(complete 60)
  (copyfiles
  (source (tackon srcdir "rexx/ksmED.amirx"))
  (dest (tackon @default-dest "rexx/"))
  )


(complete 70)

	(set ovrx
	 (cat	(tackon srcdir "Rexx/removeoldver.rexx")
	 " "
	 ircheck
	 )
	)
 (rexx ovrx
 (safe)
 )

(complete 80)

	(set airx
	 (cat (tackon srcdir "Rexx/install.rexx")
	 " "
	 ircheck
	 )
	)

(rexx airx
(safe)
)


(complete 99)
(exit  "\n\n" @app-name " Installaton is now over.\n\nPlease Read the Docs to understand how to use AmiSay\n\nSee the Scripts Dir for adding AmiSay to various Programs\n\n()_\\\n() /")

