head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	94.04.27.12.06.27;	author peteric;	state Exp;
branches;
next	;


desc
@Install routine for C= installer.
@


1.1
log
@Initial revision
@
text
@; Hey Emacs, this script might as well be -*- lisp -*-
;
; Ftree installation script for Installer
;
; Copyright © 1994 P. Ivcimey-Cook
;
; $Id$
;
; This script has been tested with Installer 1.24:
;
;     Installer and Installer project icon
;     (c) Copyright 1991-93 Commodore-Amiga, Inc.  All Rights Reserved.
;     Reproduced and distributed under license from Commodore.
;
;     INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
;     NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
;     OR RESPONSIBILITY IS ASSUMED.
;
; Use following Icon tooltypes / Command line options:
; APPNAME=FTree
; MINUSER=AVERAGE
;
(set version "1.0")
(set app-vname (cat @@app-name " version " version))

(transcript "Installing the Family Tree Charter Version " version)

(welcome "    Welcome to " app-vname " installation.\n"
		"Please note that " @@app-name " can ONLY be run from a shell (CLI) at present."
)

(set instdir (pathonly @@icon))

(if
	(askbool
		(prompt @@app-name " is currently installed\nin directory " @@instdir "\n"
					"Do you wish to copy the files elsewhere?")
		(help	"The installer can set up the system to use files\n"
				"in their current locations, or copy them elsewhere.\n"
				"Select Yes if you wish for the files to be copied\n"
				"somewhere else.")
		(default 0)
		(choices "Yes - Copy" "No - Leave")
	)
	(
		(set newinstdir
			(askdir
				(prompt "Please select a new directory for the " app-vname " files.")
				(help @@askdir-help)
				(default (cat "TOOLS:FTree-" version))
			)
		)
		
		(set n 1)
		(set m 10)					; number of files in this list
		(while (set thisfile (select n
					"bin/ftree"
					"guide/ftree.guide"
					"guide/ftree.guide"
					"examples/example"
					"examples/people"
					"examples/cooks"
					"examples/mccallums"
					"libs/ixemul.library"
					"libs/arp.library"
					"ps/ftinit.ps"
				))
		(
			
			(copyfiles 
				(prompt "Copying file " thisfile " to new directory")
				(help @@copyfiles-help)
				(icons)
				(source thisfile)
				(dest (tackon newinstdir thisfile))
			)
			
			(transcript "Copying file \"" thisfile "\" to new directory.")
			(complete (+ 10 (* (/ n m) 10)) )
		)
		(set instdir newinstdir)
		(complete 20)
	)
	(
		(transcript "Installed directory \"" instdir "\" being left as-is.")
		(complete 20)
	)
)

(set psfontdir (getassign "psfonts:" "va"))
(set psfonts-assigned (<> psfontdir ""))

(if (NOT (psfonts-assigned))
	(
		(transcript "\"psfonts:\" volume not defined.")
		(set psfontdir (askdir
				(prompt "Please enter the directory in which PostScript fonts can be found.\n"
						"A directory \"afm\" will be created in this for the Adobe Font Metric files required by " @@app-name)
				(help @@askdir-help)
				(default "SYS:PSFonts")
				(newpath)
			)
		(makedir psfontdir)
		(makedir (tackon psfontdir "afm"))
		(makeassign "PSFONTS" psfontdir)
		(startup @@app-name
				(prompt @@app-name " needs to modify the user-startup file so that the directory \"PSFONTS\" is available.")
				(help @@startup-help)
				(command	"assign PSFONTS: " psfontdir "\n"
							"path " (tackon instdir "bin") " add\n")
		)
	)
)

(complete 30)

(transcript "Installing ixemul.library")

(copylib
	(help @@copylib-help)
	(prompt "Installing System Library (Ixemul.library)")
	(confirm)
	(source "Libs/ixemul.library")
	(dest
		(askdir
			(prompt "Please select a place for \"ixemul.library\".")
			(help @@askdir-help)
			(default "LIBS:")
		)
	)
)

(complete 40)

(set vernum (getversion "exec.library" (resident)))
(set execver (/ vernum 65536))

(if (< execver 39)
	(
		(transcript "Installing arp.library")

		(message "You are using an Amiga with an operating system earlier than Kickstart 2.\n"
				"The standard PostScript interpreter \"Post\" requires Kickstart 2 to work correctly.\n"
				"However, an external PostScript LaserPrinter can still be used to print " app-vname "'s output.\n"
				"Therefore the OS1.2/1.3 support library \"arp.library\" will be copied.")
		
		(copylib
			(help @@copylib-help)
			(prompt "Installing System Library (Arp.library)")
			(confirm)
			(source "Libs/arp.library")
			(dest
				(askdir
					(prompt "Please select a place for \"arp.library\".")
					(help @@askdir-help)
					(default "LIBS:")
				)
			)
		)
	)
)

(complete 50)


@
