; $VER: RO-Install 0.83 (1.11.94)
; RO Installer script by Juergen Schubert <juergen@desert.sub.org>
; Modified by Oliver Rummeyer, inspired by MagicCX-Install ©1994 Kai Iske.

;========================================================
; Set Strings

(set #nokick
(cat "You must be using Kickstart 2.04 to use RO. Aborting!"
))

(set #nomui
(cat "Can`t find \"MUI:\". You need version 2.2 of MUI or better. Aborting!"
))

(set #startmsg
(cat "\n\RO installation script.\n"
     "This script installs RO on your Amiga.\n\n"
     "Read the Documentation files for\n"
     "more information on the distribution.\n"
     "RO © 1994 Oliver Rummeyer\n"
     "All rights reserved."
))

(set #icons "Which type of icons would you like to install")
(set #magicwbicons "MagicWB-Style Icons; 8 colors")
(set #classicicons "Classic-WB-Style Icons; 4 colors")
(set #noicons "No Icons")

(set #install "\n\nInstalling RO to\n\n")
(set #drawer
(cat "In which disk or drawer should RO be installed?\n"
     "(A drawer \"RO\" will be created there)"
))

(set #update
(cat "A drawer \"RO\" already exists in the specified disk "
     "or drawer. You should make a backup of your prefs "
     "file before you continue the installation procedure.\n\n"
     "Should I continue the installation procedure?"
))

(set #lang "Which languages should be installed?")
(set #own
(cat	"\n\nIf you want to create own versions of\n"
	"the catalogs please have a look at the\n"
	"distributions Locale directory. You will\n"
	"find the .ct and .cd files there.\n"
))

(set #install-doc "Would you like to install RO`s online documentation?")
(set #doc "Which documentation formats would you like to install?")
(set #doclang "Which language do you prefer for the documentation?")

(set #exitmsg "Have fun using RO!\nAnd don`t forget it`s Shareware!")

;========================================================

(if (< (/ (getversion) 65536) 37)
(
    (abort #nokick)
))

(if (= (exists "MUI:" (noreq)) 0)
(
    (abort #nomui)
))

;=========================================================

(message #startmsg)

(complete 0)

;=========================================================

(set IconType
	(askchoice
		(prompt #icons)
		(help @askchoice-help)
		(choices
			#magicwbicons
			#classicicons
			#noicons
		)
		(default 0)
	)
)

(complete 20)

;=========================================================

(set TargetDir
	(askdir
		(prompt #drawer)
		(default "SYS:Tools")
		(help @askdir-help)
	)
)

(set DestDir (tackon TargetDir "RO"))
(set @default-dest DestDir)

(if (= (exists DestDir) 2)
   (message #update)
)

(complete 40)

;=========================================================

(makedir DestDir
    (prompt #install DestDir)
)

(if (= IconType 0)
	(
    	(copyfiles
        	(source "")
	        (choices "/Icons/8col/RO.info" "/Icons/8col/RO.guide.info")
    	    (dest DestDir)
	    )
		(copyfiles
			(source "/Icons/8col/Drawer.info")
			(dest TargetDir)
			(newname "RO.info")
		)
	)
)

(if (= IconType 1)
(
   	(copyfiles
       	(source "")
        (choices "/Icons/4col/RO.info" "/Icons/4col/RO.guide.info")
   	    (dest DestDir)
    )
	(copyfiles
		(source "/Icons/4col/Drawer.info")
		(dest TargetDir)
		(newname "RO.info")
	)
)
)

(copyfiles
	(help @copyfiles-help)
	(source "")
	(choices "/Binary/RO" "/Binary/RO.prefs" )
	(dest DestDir)
	(files)
)

(complete 60)

;========================================================
; Install Locale

(if (AND (NOT (= (getassign "Locale") "")) (exists "libs:locale.library"))
(

	(set Lang
		(askoptions
			(prompt #lang)
			(help @askoptions-help)
			(choices "Deutsch" "Italiano")
			(default 0)
		)
	)

	(if (IN Lang 0)
		(copyfiles
			(source "")
			(choices "/Locale/Catalogs/Deutsch/ro.catalog")
			(dest "LOCALE:Catalogs/Deutsch")
		)
	)

	(if (IN Lang 1)
		(copyfiles
			(source "")
			(choices "/Locale/Catalogs/Italiano/ro.catalog")
			(dest "LOCALE:Catalogs/Italiano")
		)
	)

	(message #own)
))

(complete 80)

;=========================================================

(set doctype
	(askoptions
		(prompt #doc)
		(help @askoptions-help)
		(choices "AmigaGuide ® V39")
		(default 1)
	)
)

(if (= doctype 1)
(

	(set doclang
		(askchoice
			(prompt #doclang)
			(help @askchoice-help)
			(choices
				"German"
				"English"
			)
			(default 1)
		)
	)

	(if (= doclang 0)
		(copyfiles
			(source "/Docs/RO.guide,deutsch")
			(dest DestDir)
			(newname "RO.guide")
		)
	)

	(if (= doclang 1)
		(copyfiles
			(source "/Docs/RO.guide,english")
			(dest DestDir)
			(newname "RO.guide")
		)
	)

))

(if (= doctype 0)
	(run "Delete "
		(tackon DestDir "RO.guide.info")
	)
)

(complete 100)

;==========================================================
(exit #exitmsg)
