; ArtPRO installations Script
; © 1997 Defect Softworks All rights reserved.
; May only be distributed within the ArtPRO package
; 
; Written by Frank Pagels /DFT
; Date: 12/Feb/97

(set falsekickmsg	"You need at least OS 2.04 to run ArtPRO!")	;!!!

(set OS_VER (/ (getversion) 65536) )

(if(< OS_VER 37)
  (abort falsekickmsg)
)

(set cpu (database "cpu"))	;check CPU Type

(if (or (= cpu 68020) (= cpu 68030)) (set #cpu 0))
(if (= cpu 68040) (set #cpu 1))
(if (> (exists ("libs:68060.library")) 0) (set #cpu 2) )

(set #doclang 0)
;(if (= @language "deutsch") (set #doclang 1))

(set progdir1
 (askdir (prompt "In wich drawer should ArtPRO be installed?\n (a drawer will be created)")
   (help @askdir-help)
   (DEFAULT @default-dest)))

(	(makedir (tackon progdir1 "ArtPRO")) 
	(copyfiles (source "Icons/ArtPRO.info")
	(dest progdir1))

	(set progdir (tackon progdir1 "ArtPRO"))
)
;--------------------------------------------------------------------------
(
	(copyfiles (source "ArtPRO")
	(dest progdir))

	(copyfiles (source "installdata/ArtPRO.info")	;!!!
	(dest progdir))

)

;------ Install Loader -------
(
	(makedir (tackon progdir "ALoaders"))
	(copyfiles (source "Aloaders")
	(dest (tackon progdir "ALoaders"))
	(all))
)

;------ Install Saver --------
(
	(makedir (tackon progdir "ASavers"))
	(copyfiles (source "ASavers")
		   (dest (tackon progdir "ASavers"))
		   (all)
	)

)

;----- Copy needed Librarys 

    (copylib
	(prompt "Copy ReqTools.library")
	(help @copylib-help)
	(source "libs/reqtools.library")
	(dest "Libs:")
	(confirm)
    )

    
	(Set #WhatLib
	(cat  "Which version of the render.library do you want to install now ?"))

	(set InstallLib
		(askchoice
			(prompt #WhatLib)
			(help @askoptions-help)
			(choices
				"020"		;Bit 0
				"040"		;Bit 1
				"060")		;Bit 2
			(default #cpu)
		)
	)
   
(
	(if (= InstallLib 0)

	   (copylib 
   		(prompt "Copy Render.library")
		(help @copylib-help)
 	        (source "RenderLib/libs/render.library_68020")
		(dest "Libs:")
		(newname "render.library")
		(confirm)
	   )
	)



	(if (= InstallLib 1)

	   (copylib 
   		(prompt "Copy Render.library")
		(help @copylib-help)
 	        (source "RenderLib/libs/render.library_68040")
		(dest "Libs:")
		(newname "render.library")
		(confirm)
	   )
	)
		 


	(if (= InstallLib 2)

	   (copylib 
   		(prompt "Copy Render.library")
		(help @copylib-help)
 	        (source "RenderLib/libs/render.library_68060")
		(dest "Libs:")
		(newname "render.library")
		(confirm)
	   )
	)
    
)

;----- copy Dokumentation ------

(
	(Set #Whatdoc
	(cat  "What ArtPRO documentation would you like to install?\n"))

	(set Installdoc
		(askchoice
			(prompt #Whatdoc)
			(help @askoptions-help)
			(choices
				"English")		;Bit 0
			;	"German")		;Bit 1
			(default #doclang)
		)
	)
   
	(set docdir
		(askdir (prompt "Select a drawer for the Guide:")
		(help @askdir-help)
		(DEFAULT progdir)))


	(if (= Installdoc 0)
		(
			(copyfiles (source "docs/english/ArtPRO.guide")		;!!!
				   (dest docdir))

			(copyfiles (source "installdata/ArtPRO.guide.info")	;!!!
				   (dest docdir))
		)
	)

;	(if (= Installdoc 1)
;
;	   (copyfiles (source "docs/deutsch/ArtPRO.guide")
;		(dest docdir))
;
;	   (copyfiles (source "docs/deutsch/ArtPRO.guide.info")
;		(dest docdir))
;
;	)


)

;---- Kopiere Icons ----

(
	(makedir (tackon progdir "Icons"))
	(copyfiles (source "Icons")
		(dest (tackon progdir "Icons"))
		(all))
	(copyfiles (source "installdata/Icons.info")	;!!!
		(dest progdir))

)


(
  (set appdir
  (askdir (prompt "In wich drawer should the external AppIcon be installed?")
   (help @askdir-help)
   (DEFAULT progdir)))

 	(copyfiles (source "Installdata/AppIcon.info")
		(dest appdir)
	)
		(Tooltype (dest (tackon progdir "ArtPRO"))
		(Settooltype "APPICON" (tackon appdir "AppIcon"))
	)
)

(set @default-dest progdir)


(copyfiles (source "Orderform.doc")
	(dest progdir)
)

(copyfiles (source "Orderform.dok")
	(dest progdir)
)

(makedir "ENV:ArtPRO")
(makedir "ENVARC:ArtPRO")

(exit "Note: ArtPRO is Shareware!\n\n"
      "Enjoy this!") 
