; Installer Script $VER: RexxSkeleton 2.5 Generate System
; All Copyright 1995 By Micro Art Data - Copenhagen....

(set #WrongKickStart "\n\n\nERROR - Must be Workbench 2.xx to Use\nRexxSkeleton 2.5 Generator System.")
(set #NotEnoughSpace "\n\n\nERROR - It seems that there is not enough room\n at sys: disk - remove or delete and proceed.")
(set myrx "")
(set mytx "")
(if (< (/ (getversion) 65536) 37)
	(abort #WrongKickStart))

(message
   "\n\nWelcome to the RexxSkeleton 2.5 installation!\n\n"
   "Copyright 1995 By Micro Art Data - Copenhagen...\n\n"
   "This utility program installs RexxSkeleton 2.5\nand all programs related\n"
   "Like the special Load_Skeleton & Skeleton_Edit\n\n"
	"Special RexxEditor, all Examples & Related Guides.\n\n"
	(help "RexxSkeleton 2.5 main system is the Raw script generator and is usely installed at work partion at your HD system")

)
(set RexxSkeleton_2.5 @default-path)
(set target (getassign "WORK" 'v'))
(if (= target "")
	(set target (getassign "HD1" 'd')))
(if (= target "")
	(set target (getassign "DH1" 'd')))
(if (= target "")
	(set target @default-dest))
(set target
	(askdir
	(prompt "Which Partion do you usually use as Work?\n"
			"RexxSkeleton 2.5 main system is installed there.")
	(help @askdir-help)
	(default target))
)

(message
   "\n\n\n\n\nIt is recommended to hold the RexxSkeleton 2.5 disk\n"
	"in the internal Df0: disk drive\n\n"
	" and Install creates the directory automaticly\n"
	(tackon target "RexxSkeleton")
)

(message
   "\n\n\n\n\nTo speedup the installation process, some data will be "
   "temporarily copied to the Ram disk."
)

(if (< (getdiskspace "sys:") 500000)
	(abort #NotEnoughSpace)
)

(makedir "Clips:c")
(run "copy RexxSkeleton_2.5:c/Lz Clips:c quiet")
(run "Clips:c/lz x RexxSkeleton_2.5:Libs/Libs.lha Clips:libs/")

(if (= (/ (getversion) 65536) 37)
(copylib
	(prompt "\n\nCopy amigaguide.library")
   	(help "@copylib-help")
    (source "Clips:libs/amigaguide.library")
    (dest "Libs:")
	(confirm)
	)
)
(copylib
	(prompt "\n\nCopy arp.library")
   	(help "@copylib-help")
    (source "Clips:libs/arp.library")
    (dest "Libs:")
	(confirm)
)
(copylib
	(prompt "\n\nCopy rexxarpLib.library")
   	(help "@copylib-help")
    (source "Clips:libs/rexxarplib.library")
    (dest "Libs:")
	(confirm)
)
(if (<> (exists "Libs:rexxapp.library") 1)
	(run "copy Clips:Libs/rexxapp.library Libs: quiet")
)
(copylib
	(prompt "\n\nCopy rexxreqtools.library")
   	(help "@copylib-help")
    (source "Clips:libs/rexxreqtools.library")
    (dest "Libs:")
	(confirm)
)
(copylib
	(prompt "\n\nCopy reqtools.library")
   	(help "@copylib-help")
    (source "Clips:libs/reqtools.library")
    (dest "Libs:")
	(confirm)
)
(copylib
	(prompt "\n\nCopy rexxhost.library")
   	(help "@copylib-help")
    (source "Clips:libs/rexxhost.library")
    (dest "Libs:")
	(confirm)
)
(copylib
	(prompt "\n\nCopy screenshare.library")
   	(help "@copylib-help")
    (source "clips:libs/screenshare.library")
    (dest "Libs:")
	(confirm)
)
(run "copy clips:Libs/skeleton.library Libs: quiet")
(copylib
	(prompt "\n\nCopy iff.library")
   	(help "@copylib-help")
    (source "clips:libs/iff.library")
    (dest "Libs:")
	(confirm)
)

(run "delete clips:Libs/ all quiet")

(copyfiles (source "RexxSkeleton_2.5:c/Skeleton_Edit") (dest "c:"))
(copyfiles (source "RexxSkeleton_2.5:s/Skeleton_Edit.Help") (dest "S:"))
(copyfiles (source "RexxSkeleton_2.5:L/Skeleton-Handler") (dest "L:"))

(if (< (getdiskspace target) 500000)
	(abort #NotEnoughSpace)
)

(set @realdest (tackon target "RexxSkeleton"))

(set n 0)
(set sourcedir "RexxSkeleton_2.5:")
(while (set thisfile (select n "RexxSkeleton_2.5B" "RexxSkeleton_2.5B.info" "Load_Skeleton" "Load_Skeleton.info" "Readme.doc" "Readme.doc.info" ""))
	(
		(copyfiles
		(prompt "Copy RexxSkeleton Main System & Readme files")
		(help "Please Wait...")
		(source (tackon sourcedir thisfile))
		(dest @realdest)
	)
(set n (+ n 1))
 )
)

(Run "copy RexxSkeleton_2.5:c/main.info "(tackon target "RexxSkeleton.info"))
(if (<> (exists "Fonts:helvetica/11") 1)
	(copyfiles (source "RexxSkeleton_2.5:Fonts/helvetica/11") (dest "Fonts:helvetica"))
)
(if (<> (exists "Fonts:helvetica.font") 1)
	(copyfiles (source "RexxSkeleton_2.5:Fonts/helvetica.font") (dest "Fonts:"))
)
(run "clips:c/lz x RexxSkeleton_2.5:Rexx/Scripts.lha clips:Rexx/")
(set n 0)
(set sourcedir "clips:Rexx")
(while (set thisfile (select n "Bool_Key.rexx" "Menu_Button.rexx" "Newsize_Text.rexx" ""))
	(
		(copyfiles
		(prompt "Copy Rexx Scripts as Demos")
		(help "")
		(source (tackon sourcedir thisfile))
		(dest "Rexx:RexxSkeleton")
	)
(set n (+ n 1))
 )
)

(run "delete clips:Rexx/ all quiet")

(set n 0)
(set sourcedir "RexxSkeleton_2.5:System")
(while (set thisfile (select n "Rexxmast" "Rexxmast.info" "RexxMast.doc" "RexxMast.doc.info" ""))
	(
		(copyfiles
		(prompt "Copy Special Rexxmast")
		(help "")
		(source (tackon sourcedir thisfile))
		(dest (tackon @realdest "System"))
	)
(set n (+ n 1))
 )
)
(copyfiles
	(prompt "Copy Guide Documents")
	(help "Please wait...")
	(source "RexxSkeleton_2.5:Guides")
	(pattern "#?.guide")
	(dest (tackon @realdest "Guides"))
)
(copyfiles
	(prompt "Copy Guide Documents")
	(help "Please wait...")
	(source "RexxSkeleton_2.5:Guides")
	(pattern "#?.info")
	(dest (tackon @realdest "Guides"))
)
(copyfiles
	(prompt "Relate Special Icons")
	(help "Please wait...")
	(source "RexxSkeleton_2.5:Utilities")
	(pattern "#?.info")
	(dest (tackon @realdest "Guides"))
)
(set n 0)
(set sourcedir "RexxSkeleton_2.5:")
(while (set thisfile (select n "System.info" "Guides.info" "Example.info" ""))
	(
		(copyfiles
		(prompt "Copy Special Rexxmast")
		(help "")
		(source (tackon sourcedir thisfile))
		(dest @realdest)
	)
(set n (+ n 1))
 )
)

(message
   "\n\n\n\n\nTo speedup the installation process, Example data will be "
   "temporarily copied to the Ram disk."
)

(run "clips:c/lz x RexxSkeleton_2.5:Example/Examples.lha clips:Example/")

(copyfiles
	(prompt "Copy CDRom Example")
	(help "Please wait...")
	(source "clips:Example")
	(pattern "CD#?")
	(dest (tackon @realdest "Example"))
)
(copyfiles
	(prompt "Copy DeCrunch Example")
	(help "Please wait...")
	(source "clips:Example")
	(pattern "DeC#?")
	(dest (tackon @realdest "Example"))
)
(copyfiles
	(prompt "Copy Graphic Example")
	(help "Please wait...")
	(source "clips:Example")
	(pattern "Gra#?")
	(dest (tackon @realdest "Example"))
)
(copyfiles
	(prompt "Copy Load_Skeleton Example")
	(help "Please wait...")
	(source "clips:Example")
	(pattern "Load#?")
	(dest (tackon @realdest "Example"))
)
(copyfiles
	(prompt "Copy Request_Font Example")
	(help "Please wait...")
	(source "clips:Example")
	(pattern "Req#?")
	(dest (tackon @realdest "Example"))
)
(copyfiles
	(prompt "Copy RSMakefile Example")
	(help "Please wait...")
	(source "clips:Example")
	(pattern "RSM#?")
	(dest (tackon @realdest "Example"))
)
(copyfiles
	(prompt "Copy ServeRexx Example")
	(help "Please wait...")
	(source "clips:Example")
	(pattern "Ser#?")
	(dest (tackon @realdest "Example"))
)
(copyfiles
	(prompt "Copy Small Demos Example")
	(help "Please wait...")
	(source "clips:Example")
	(pattern "Sma#?")
	(dest (tackon @realdest "Example"))
)
(copyfiles
	(prompt "Copy Multi_Windows Example")
	(help "Please Wait...")
	(source "clips:Example")
	(pattern "Mul#?")
	(dest (tackon @realdest "Example"))
)
(copyfiles
	(prompt "Copy Mega_Window Example")
	(help "Please Wait...")
	(source "clips:Example")
	(pattern "Meg#?")
	(dest (tackon @realdest "Example"))
)

(run "delete clips:Example/ all quiet")
(run "clips:c/lz x RexxSkeleton_2.5:Env/Envs.lha Env:")

(if (= (exists "Sys:c/rx") 1)
	(set myrx "Sys:c/Rx")
)
(if (= (exists "Sys:Rexxc/Rx") 1)
	(set myrx "sys:Rexxc")
)

(set myrx
	(askdir
	(prompt "Which directory contains the Rexx serve programs\n"
			"Rx, Hi, Tcc, Tco - RexxSkeleton 2.5 needs this path")
	(help @askdir-help)
	(default "Sys:Rexxc")
	)
)

(run "Setenv RSRXOPT "myrx)
(run "clips:c/lz x RexxSkeleton_2.5:Rexxc/Rexxc.lha "myrx)

(set choixe
	(askchoice
		(prompt "\nWhich TextEditor do you want to install into "
				"the RexxSkeleton 2.5 Main interface "
				"Default is Skeleton_Edit but any editor could be used!\n")
		(help "\n\n\nSkeleton_Edit 2.4 is special designed to handle ARexx")
		(choices "Skeleton_Edit" "Another_Editor")
		(default 0)
	)
)
(run "Setenv RSTXOPT C:Skeleton_Edit")
(if (= choixe 1)
(set mytx
	(askfile
	(prompt "\nSelect another TextEditor\n"
			"RexxSkeleton 2.5 system get the path\n"
			"thought the Env:RSTXOPT value...")
	(help @askfile-help)
	(default target))
	)
)
(if (<> (fileonly mytx) "")
	(run "Setenv RSTXOPT "mytx)
)

(set n 0)
(set sourcedir "Env:")
(while (set thisfile (select n "RexxSkeleton.Prefs" "Skeleton_Edit.Prefs" "Skeleton_Edit.OPT" "RSGUIDE" ""))
	(
		(copyfiles
		(prompt "Copy RexxSkeleton System Preferences as defaults")
		(help "Please Wait...")
		(source (tackon sourcedir thisfile))
		(dest "EnvArc:")
	)
(set n (+ n 1))
 )
)
(run "delete clips:c/ all quiet")
(set @default-dest (tackon target "RexxSkeleton"))
(exit)

