; DirWork 2.0 Install Script (1.01)
; 14/4/94	Copyright 1994 Quasar Distribution
; By PJF (iwannasleep)
; Translated by:

(set @default-dest "SYS:")

; English stuff

(set #install-files
(cat "Please choose which parts to install:"
))

(set #dirwork-location
(cat "Select location to put DirWork 2 directory:"
))

(set #copying-files
(cat "Copying files..."
))

(set #copying-configs
(cat "Copying configuration files"
))

(set #install-arexx
(cat "Do you wish to install the ARexx scripts "
     "for the GLControl configuration?"
))

(set #copy-rexx
(cat "Copying rexx scripts for GLControl cfg..."
))

(set #data-set
(cat "Which datatypes do you wish to install?"
))

(set #install-windowsbitmap
(cat "You can install the Windows Bitmap datatype\n"
))

(set #install-windowsicon
(cat "You can install the Windows Icon datatype\n"
))

(set #install-macpaint
(cat "You can install the MacPaint datatype\n"
))

(set #install-pcx
(cat "You can install the PCX datatype\n"
))

(set #install-asl
(cat "You have Kickstart 2.0+\nasl.library can be used\n"
))

(set #def-rexx
(cat "Where do you wish to install the ARexx scripts?"
))

(set #help-arexx
(cat "The GLControl configuration uses ARexx scripts.  You will "
     "need to install them if you wish to use the commands."
))

(set #ss-patch-assign
(cat "Note: You only need to perform this if you wish some "
     "example configurations to be fully functional. \n\n"
     "I am now going to add an assign to your s:user-startup "
     "file so the example configurations can find some icons for "
     "their AppIcons functions. Do you wish to do this? "
))

(set #ss-patch-path
(cat "Note: You only need to perform this if you wish to be "
     "able to start an example configuration by double-clicking its icon.\n\n"
     "I am now going to add a path to your s:user-startup "
     "file so the example configurations can find the "
     "DirWork program. Do you wish to do this? "
))

(set #do-path-now
(cat "Do you wish DirWork to be added to your path now? "
))

(set #copy-dwnewfg
(cat "Do you wish to copy the default DirWork configuration "
     "(explained in the manual) to your S: directory so "
     "double-clicking on the DW icon will run this configuration?"
))

(set #help-files-to-install
(cat "DirWork Program - This will install the DirWork program "
     "and icon file. \n"
     "DirWork Configuration Editor - This will install the DirWork "
     "Configuration Editor which is used to edit the look and "
     "operation of DirWork.\n"
     "Example Configurations - The example configurations will be "
     "installed, with usable configurations.\n"
     "Skeleton Configurations - Example configurations with limited "
     "or no functionality will be installed.  Perfect for those who "
     "wish to see more of what DirWork can do.\n"
))

;--------------------------------------------------

(set files_to_install
	(askoptions
		(prompt #install-files)
		(help #help-files-to-install)
		(choices "DirWork Program"
			 "DirWork Configuration Editor"
			 "Example Configurations"
			 "Skeleton Configurations"
		)
	)

)

(set dest2	(askdir	(prompt #dirwork-location)
			(default @default-dest)
			(help @askdir-help)
			)
)

(set dest1 (tackon dest2 "DirWork_2"))
(makedir dest1 (infos))

; copy the DirWork program
(if (IN files_to_install 0)
	(
		(copyfiles
			(prompt #copying-files)
			(source "DirWork_2:")
			(dest dest1)
			(choices "DW")
			(infos)
			(help @copyfiles-help)
		)
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest1 "DW"))
			(settooltype "CONFIGFILE")
		) 
	)
)

; copy the Configuration Editor
(if (IN files_to_install 1)
	(
		(copyfiles
			(prompt #copying-files)
			(source "DirWork_2:")
			(dest dest1)
			(choices "DWEdit"
				 "ExtraActionDefaults"
				 "ExtraMatchStrings")
			(infos)
			(help @copyfiles-help)
		)
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest1 "DWEdit"))
			(settooltype "CONFIGFILE")
		) 
	)
)

; copy the configurations
(if (IN files_to_install 2)
	(
		(set dest2 (tackon dest1 "Configurations"))
		(makedir dest2 (infos))
		(copyfiles
			(prompt #copying-configs)
			(source "DirWork_2:Configurations")
			(dest dest2)
			(pattern "#?")
			(files)
			(infos)
			(help @copyfiles-help)
		)
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "DWDock.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "DW.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "DWSmall.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "GLControl.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "Super.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "DWClassic.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "Info.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "DW162Pal.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "DW162NTSC.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "PlayView.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "Tall.cfg"))
			(setdefaulttool "DW")
		) 
		(tooltype
			(help @tooltype-help)
			(dest (tackon dest2 "Topbottom.cfg"))
			(setdefaulttool "DW")
		) 
	)
)

(if (IN files_to_install 2)
	(set rexxy 	(askbool
				(prompt #install-arexx)
				(help #help-arexx)
			)
	)
)

(if (= rexxy 1)
	(
	(set rexxdest (askdir (prompt #def-rexx)
			  (default "Rexx:")
			  (help @askdir-help)
		  )
	)
	(copyfiles
		(prompt #copy-rexx)
		(source "DirWork_2:Rexx/")
		(dest rexxdest)
		(all)
		(help @copyfiles-help)
	)
	)
)

(if (IN files_to_install 3)
	(
	(set dest2 (tackon dest1 "Configurations"))
	(makedir dest2 (infos))
	(set dest2 (tackon dest2 "Skeletons"))
	(makedir dest2 (infos))
	(copyfiles
		(prompt #copying-files)
		(source "DirWork_2:Configurations/Skeletons")
		(dest dest2)
		(pattern "#?")
		(files)
		(infos)
		(help @copyfiles-help)
	)
	)
)

(set vernum (getversion))
(set ver (/ vernum 65536))

(if (>= ver 39)
	(set types_to_install
		(askoptions
			(prompt #data-set)
			(help @askoptions-help)
			(choices "Windows Bitmap"
				 "Windows Icon"
				 "MacPaint"
				 "PCX"
			)
		)
	)
)

(if (IN types_to_install 0)
	(
		(copylib
			(prompt #install-windowsbitmap)
			(source "DirWork_2:classes/datatypes/bmp.datatype")
			(dest "sys:classes/datatypes/")
			(optional nofail askuser force)
			(confirm)
			(help @copylib-help)
		)
		(copyfiles
			(source "DirWork_2:devs/datatypes/Windows Bitmap")
			(dest "devs:datatypes/")
		)
	)
)

(if (IN types_to_install 1)
	(
		(copylib
			(prompt #install-windowsicon)
			(source "DirWork_2:classes/datatypes/ico.datatype")
			(dest "sys:classes/datatypes/")
			(optional nofail askuser force)
			(confirm)
			(help @copylib-help)
		)
		(copyfiles
			(source "DirWork_2:devs/datatypes/Windows Icon")
			(dest "devs:datatypes/")
		)
	)
)

(if (IN types_to_install 2)
	(
		(copylib
			(prompt #install-macpaint)
			(source "DirWork_2:classes/datatypes/macpaint.datatype")
			(dest "sys:classes/datatypes/")
			(optional nofail askuser force)
			(confirm)
			(help @copylib-help)
		)
		(copyfiles
			(source "DirWork_2:devs/datatypes/MacPaint")
			(dest "devs:datatypes/")
		)
	)
)

(if (IN types_to_install 3)
	(
		(copylib
			(prompt #install-pcx)
			(source "DirWork_2:classes/datatypes/pcx.datatype")
			(dest "sys:classes/datatypes/")
			(optional nofail askuser force)
			(confirm)
			(help @copylib-help)
		)
		(copyfiles
			(source "DirWork_2:devs/datatypes/PCX")
			(dest "devs:datatypes/")
		)
	)
)

(if (>= ver 39)
	(run "AddDataTypes Refresh")
)

(if (AND (>= ver 37) (<= ver 38))(
		(copylib
			(prompt #install-asl)
			(source "DirWork_2:libs/asl.library")
			(dest "libs:")
			(optional nofail askuser force)
			(confirm)
			(help @copylib-help)
		)
))

(startup "DirWork2 assign"
	(prompt #ss-patch-assign)
	(help @startup-help)
	(command ("Assign DirWork_2: %s/\n" dest1))
)

(startup "DirWork2 path"
	(prompt #ss-patch-path)
	(help @startup-help)
	(command ("path %s/ add\n" dest1))
)


(set dopath (askbool
		(prompt #do-path-now)
		(help #help-askbool)
	)
)

(if (= dopath 1)
	(
	(set doit ("path \"%s/\" add" dest1))
	(run doit)
	)
)

(set donewcfg (askbool
		(prompt #copy-dwnewfg)
		(help #help-askbool)
	)
)

(if (= donewcfg 1)
	(copyfiles
		(prompt #copying-files)
		(source "DirWork_2:Configurations")
		(dest "s:")
		(choices "DW.cfg")
		(infos)
		(help @copyfiles-help)
	)
)

(set @default-dest dest1)

