home *** CD-ROM | disk | FTP | other *** search
- ;This Installer script is used to install ReSource V6 on your hard disk.
- ;
- ;This script Copyright ©1994 by The Puzzle Factory, Inc.
-
- (set SysVer (/ (getversion) 65536))
- (set LibsColon (getassign "libs"))
- (set ReSourceColon (getassign "ReSource"))
-
- (set #HelloMsg
- (cat
- "\n\n\nThis script will install\n\nReSource V6\n\non your hard disk."
- )
- )
-
- (set #MinOSMsg
- (cat
- "Sorry, ReSource REQUIRES V37 (2.04) or better of the Amiga OS."
- )
- )
-
- (set #InstallASLPrompt
- (cat
- "Install V39.4 of asl.library?"
- )
- )
-
- (set #InstallASLHelp
- (cat
- "For full support of all ReSource features, ReSource requires a version "
- "of asl.library which contains the system ScreenMode requester.\n\n"
- @copylib-help
- )
- )
-
- (set #ReSourceDirPrompt
- (cat
- "Where should the ReSource directory be created?"
- )
- )
-
- (set #ReSourceDirHelp
- (cat
- "A directory named \"RS\" will be created here to hold all the "
- "main ReSource executables.\n\n"
- @askdir-help
- )
- )
-
- (set #ReSourceDirNoSpace
- (cat
- "Sorry, that volume doesn't have enough space free for a ReSource "
- "installation! Please choose another place to install ReSource."
- )
- )
-
- (set #ReSourceLibsPrompt
- (cat
- "Where should the ReSource libraries be installed?"
- )
- )
-
- (set #OldVerMsg
- (cat
- "Sorry, you seem to already have a version of the ReSource support "
- "libraries installed in an earlier path, which means the new version "
- "of the libraries will not be found. Please choose a path which is "
- "higher in the list (see your documentation, or the 'HELP' for the "
- "previous screen), or delete any old versions of the ReSource support "
- "libraries and run this script again."
- )
- )
-
- (set #InvalidDirMsg
- (cat
- "Sorry, the directory you have chosen would place the ReSource "
- "support libraries where ReSource could never find them. Please "
- "choose one of the recommended directories (see your documentation, "
- "or the 'HELP' for the previous screen)."
- )
- )
-
- (set #ReSourceLibsNoSpace
- (cat
- "Sorry, that location doesn't have enough space free to install the "
- "ReSource support libraries! Please choose another place to install "
- "these libraries."
- )
- )
-
- (set #ExtrasHelp
- (cat
- "Check which of these options you are interested in installing "
- "at this time. You will be given a chance to select a location "
- "separately for each option.\n\n"
- @askoptions-help
- )
- )
-
- (set #ExtrasNoSpace
- (cat
- "Sorry, there is not enough room on that volume to install the extra "
- "files you have chosen. Please choose another destination."
- )
- )
-
- (user 2)
-
- ;space_target - "thing" to find out available space for
- ;space_avail - return value
-
- (procedure GETSPACE
- (
- (set SPACEtmp space_target)
- (while (not (= SPACEdir SPACEtmp))
- (set SPACEtmp (pathonly SPACEtmp))
- (set SPACEdir (pathonly SPACEtmp))
- )
- (if (or (= SPACEdir "RAM:")
- (or (= SPACEdir "Ram:")
- (or (= SPACEdir "ram:") (= SPACEdir "Ram Disk:"))))
-
- ; looks like RAM:...
- (set space_avail (+ (database "total-mem")))
-
- ; looks like somewhere else...
- (set space_avail (getdiskspace space_target))
- )
- )
- )
-
- (complete 0)
-
- (message #HelloMsg)
-
- (if (< SysVer 37)
- (
- (message #MinOSMsg)
- (abort)
- )
- )
-
- (if (askbool
- (prompt #InstallASLPrompt)
- (help #InstallASLHelp)
- (choices "Proceed" "Skip this file")
- )
- (copylib
- (source "ReSource_3:asl.library")
- (dest "libs:")
- )
- )
-
- (set OK 0)
-
- (while (= OK 0)
- (set ResMain
- (askdir
- (prompt #ReSourceDirPrompt)
- (help #ReSourceDirHelp)
- (default @default-dest)
- )
- )
- (set space_target ResMain)
- (GETSPACE)
-
- (if (< space_avail 380000)
- (message #ReSourceDirNoSpace)
- (set OK 1)
- )
- )
-
- (set ResMain (tackon ResMain "RS"))
-
- (makedir ResMain (safe))
-
- (set @default-dest ResMain)
-
- (complete 1)
-
- (askdisk
- (prompt "\n\nPlease insert\n\nReSource Disk 1\n\nin any drive.")
- (help "The main ReSource files are supplied on ReSource Disk 1.\n\n"
- @askdisk-help
- )
- (dest "ReSource_1")
- )
-
- (working "Copying ReSource...")
-
- (copyfiles
- (source "ReSource_1:")
- (dest ResMain)
- (choices
- "ReadMe"
- "ReSource"
- "RS.KeyTable"
- "RS.Macros"
- "ShowKeys"
- "ShowMacros"
- )
- (infos)
- )
-
- (complete 10)
-
- (set tempdir (tackon ResMain "libs"))
-
- (makedir tempdir (safe))
-
- (set OK 0)
-
- (while (= OK 0)
- (set ResLib
- (askdir
- (prompt #ReSourceLibsPrompt)
- (help "ReSource has several support libraries needed for proper "
- "operation. The suggested default location for these "
- "libraries is in a subdirectory of the place you installed "
- "ReSource. ReSource knows to look for these libraries in one "
- "of several places:\n\n"
- (" %s\n" tempdir)
- " libs:\n"
- " libs:ReSource\n"
- " ReSource:\n"
- " ReSource:libs\n\n"
- "If you do not install the libraries in one of these places, "
- "ReSource will not run, as it won't be able to find the files "
- "it needs.\n\n"
- @askdir-help
- )
- (default tempdir)
- )
- )
-
- ; first check to see if they want 'em in PROGDIR:libs. If so, we can skip
- ; the rest of the following mess...
- (if (= ResLib tempdir)
-
- ; yes, in PROGDIR:libs. Exit loop
- (set OK 1)
-
- ; no... well then, here's YAK (Yet Another Kludge)
- (
- ; see if they chose a valid place to put the libraries
- (set ValidPath 0)
- (if (= ResLib LibsColon)
- (set ValidPath 1)
- )
- (if (= ResLib (tackon LibsColon "ReSource"))
- (set ValidPath (+ ValidPath 2))
- )
- (if (= ResLib ReSourceColon)
- (set ValidPath (+ ValidPath 4))
- )
- (if (= ResLib (tackon ReSourceColon "libs"))
- (set ValidPath (+ ValidPath 8))
- )
-
- ; if the path they chose is valid, see if there's an old .library
- ; earlier in the path
- (if ValidPath
-
- ; if they set the destination to a valid one, check for conflict with
- ; old version files in "earlier" locations
- (
- ; Check for 'ReSourcesyms.library' in all the paths that matter
- (set OldLib 0)
- (if (exists (tackon tempdir "ReSourcesyms.library"))
- (set OldLib 1)
- )
- (if (exists (tackon LibsColon "ReSourcesyms.library"))
- (set OldLib (+ OldLib 2))
- )
- (if (exists (tackon LibsColon "ReSource/ReSourcesyms.library"))
- (set OldLib (+ OldLib 4))
- )
- (if (exists (tackon ReSourceColon "ReSourcesyms.library"))
- (set OldLib (+ OldLib 8))
- )
-
- ; if ReSourcesyms.library exists in any paths, see if it'll
- ; conflict. Code may be hard to follow, but it works!
- (if OldLib
- (
- (if (in OldLib 0)
- (message #OldVerMsg)
- (if (and (in OldLib 1) (> ValidPath 1))
- (message #OldVerMsg)
- (if (and (in OldLib 2) (> ValidPath 2))
- (message #OldVerMsg)
- (if (and (in OldLib 3) (> ValidPath 4))
- (message #OldVerMsg)
-
- ; if we got this deep and everything
- ; is OK, exit the loop and go with it!
- (set OK 1)
- )
- )
- )
- )
- )
-
- ; didn't find any old versions of the .library file
- (set OK 1)
- )
- )
-
- ; if not a valid directory, tell 'em about it and loop back
- (message #InvalidDirMsg)
- )
- )
- ) ; end of 'if (= ResLib tempdir)'
-
- (if (= OK 1)
- (
- (set space_target ResLib)
- (GETSPACE)
-
- (if (< space_avail 470000)
- (
- (message #ReSourceLibsNoSpace)
- (set OK 0)
- )
- )
- )
- )
- ) ; end of 'while (= OK 0)'
-
- (if (not (= ResLib tempdir))
- (delete tempdir (safe))
- )
-
- (complete 20)
-
- (askdisk
- (prompt "\n\nPlease insert\n\nReSource Disk 1\n\nin any drive.")
- (help "The ReSource support libraries are supplied on ReSource Disk 1.\n\n"
- @askdisk-help
- )
- (dest "ReSource_1")
- )
-
- (working "Copying ReSource support libraries...")
-
- (copyfiles
- (source "ReSource_1:libs")
- (dest ResLib)
- (infos)
- (all)
- )
-
- (complete 25)
-
- (set ProgList
- (askoptions
- (prompt "Please choose which of the supplied 'extra' files you wish "
- "to install: (amount of disk space required is shown in "
- "parentheses)"
- )
- (help #ExtrasHelp)
- (choices
- "development tools (83k)"
- ".fd files (46k)"
- "include.i files (566k)"
- "link libraries (242k)"
- "startup files (47k)"
- )
- )
- )
-
- (complete 30)
-
- (if ProgList
- (
- (askdisk
- (prompt "\n\nPlease insert\n\nReSource Disk 3\n\nin any drive.")
- (help "The extra file archives are supplied on ReSource Disk 3.\n\n"
- @askdisk-help
- )
- (dest "ReSource_3")
- )
-
- (copyfiles (source "ReSource_3:lhex") (dest "ram:"))
- (if (in ProgList 0)
- (
- (set tempdir (tackon ResMain "devtools"))
- (makedir tempdir (safe))
-
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the developer tools be installed?")
- (help @askdir-help)
- (default tempdir)
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 85000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
- (if (not (= DestDir tempdir))
- (delete tempdir)
- )
- (working "Extracting from 'devtools' archive..")
- (run (cat "ram:lhex -aFw \"" DestDir "\" x ReSource_3:devtools.lha"))
- )
- )
- (complete 40)
- (if (in ProgList 1)
- (
- (set tempdir (tackon ResMain "fd"))
- (makedir tempdir (safe))
-
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the .fd files be installed?")
- (help @askdir-help)
- (default tempdir)
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 47000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
- (if (not (= DestDir tempdir))
- (delete tempdir)
- )
- (working "Extracting from 'fd' archive..")
- (run (cat "ram:lhex -aFw \"" DestDir "\" x ReSource_3:fd.lha"))
- )
- )
- (complete 50)
- (if (in ProgList 2)
- (
- (set tempdir (tackon ResMain "include"))
- (makedir tempdir (safe))
-
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the include files be installed?")
- (help @askdir-help)
- (default tempdir)
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 580000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
- (if (not (= DestDir tempdir))
- (delete tempdir)
- )
- (working "Extracting from 'include_i' archive..")
- (run (cat "ram:lhex -aFw \"" DestDir "\" x ReSource_3:include_i.lha"))
- )
- )
- (complete 60)
- (if (in ProgList 3)
- (
- (set tempdir (tackon ResMain "lib"))
- (makedir tempdir (safe))
-
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the .lib files be installed?")
- (help @askdir-help)
- (default tempdir)
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 248000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
- (if (not (= DestDir tempdir))
- (delete tempdir)
- )
- (working "Extracting from 'libs' archive..")
- (run (cat "ram:lhex -aFw \"" DestDir "\" x ReSource_3:libs.lha"))
- )
- )
- (complete 70)
- (if (in ProgList 4)
- (
- (set tempdir (tackon ResMain "startups"))
- (makedir tempdir (safe))
-
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the startup files be installed?")
- (help @askdir-help)
- (default tempdir)
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 48000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
- (if (not (= DestDir tempdir))
- (delete tempdir)
- )
- (working "Extracting from 'startups' archive..")
- (run (cat "ram:lhex -aFw \"" DestDir "\" x ReSource_3:startups.lha"))
- )
- )
- (delete "ram:lhex")
- )
- )
-
- (complete 80)
-
- (if (askbool
- (prompt "There are several optional files included in the ReSource "
- "package. You will be asked about each file individually. "
- "Do you wish to install any of these optional files?"
- )
- (help "These files include:\n\n"
- "CFuncs.rcl - a ReSource Control Language file that provides "
- "ReSource with information about standard 'C' functions.\n\n"
- "Various example files and ReSource documentation."
- )
- (choices "Install files" "Skip these files")
- )
-
- ; Install optional
- (
- (if (askbool
- (prompt "Install \"CFuncs.rcl\" file?")
- (help "This is a ReSource Control Language file that provides "
- "ReSource with information about standard 'C' functions. "
- "It is about 300K in length.\n\n"
- )
- )
-
- ; yes, install CFuncs.rcl
- (
- (askdisk
- (prompt "\n\nPlease insert\n\nReSource Disk 2\n\nin any drive.")
- (help "The optional file \"CFuncs.rcl\" is supplied on "
- "ReSource Disk 2.\n\n"
- @askdisk-help
- )
- (dest "ReSource_2")
- )
-
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the CFuncs.rcl file be installed?")
- (help @askdir-help)
- (default "libs:")
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 310000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
-
- (copyfiles
- (source "ReSource_2:CFuncs.rcl")
- (dest DestDir)
- )
- )
- )
-
- (complete 85)
-
- (if (askbool
- (prompt "Install ReSource documentation?")
- (help "Several documentation files are supplied on disk for ease "
- "of access while using ReSource."
- )
- )
-
- ; yes, install documentation
- (
- (set DocList
- (askoptions
- (prompt "Please choose which documentation files you wish "
- "to install."
- )
- (help @askoptions-help)
- (choices
- "RCL.doc"
- "ShowKeys.doc"
- "ShowMacros.doc"
- "UserSymbols.doc"
- )
- )
- )
- (if DocList
- (
- (askdisk
- (prompt "\n\nPlease insert\n\nReSource Disk 2\n\nin any "
- "drive."
- )
- (help "The ReSource documentation files are supplied "
- "on ReSource Disk 2, in the \"Docs\" directory.\n\n"
- @askdisk-help
- )
- (dest "ReSource_2")
- )
- (set DocDest
- (askdir
- (prompt "Where do you wish the documentation files "
- "installed?"
- )
- (help @askdir-help)
- (default @default-dest)
- )
- )
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the documentation files be installed?")
- (help @askdir-help)
- (default ResMain)
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 114000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
-
- (if (in DocList 0)
- (copyfiles
- (source "ReSource_2:Docs/RCL.doc")
- (dest DestDir)
- (infos)
- )
- )
- (if (in DocList 1)
- (copyfiles
- (source "ReSource_2:Docs/ShowKeys.doc")
- (dest DestDir)
- (infos)
- )
- )
- (if (in DocList 2)
- (copyfiles
- (source "ReSource_2:Docs/ShowMacros.doc")
- (dest DestDir)
- (infos)
- )
- )
- (if (in DocList 3)
- (copyfiles
- (source "ReSource_2:Docs/UserSymbols.doc")
- (dest DestDir)
- (infos)
- )
- )
- )
- )
- ) ; end of "if DocList"
- ) ; end of install documentation
-
- (complete 92)
-
- (if (askbool
- (prompt "Install Tutorial files?")
- (help "These are files used with the Tutorial section of the "
- "manual. Recommended!"
- )
- )
-
- ; yes, install tutorials
- (
- (askdisk
- (prompt "\n\nPlease insert\n\nReSource Disk 2\n\nin any drive.")
- (help "The Tutorial files are supplied on ReSource Disk 2, "
- "in the \"Tutorials\" directory.\n\n"
- @askdisk-help
- )
- (dest "ReSource_2")
- )
-
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the Tutorial files be installed?")
- (help @askdir-help)
- (default ResMain)
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 9000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
-
- (copyfiles
- (source "ReSource_2:Tutorials")
- (dest DestDir)
- (all)
- )
- )
- )
-
- (if (askbool
- (prompt "Install Utility files?")
- (help "These are small files which can be used to explore "
- "various parts of the OS.\n\n"
- "\"ListInt\" will dump Intuition structures as "
- "assembly source code, for use in your own programs.\n\n"
- "\"ShowCpr\" will dump system Copper lists as "
- "assembly source code.\n\n"
- "\"StarBurst\" will toggle the bit in dos.library "
- "that enables the use of \"*\" for wildcards."
- )
- )
-
- ; yes, install utilities
- (
- (askdisk
- (prompt "\n\nPlease insert\n\nReSource Disk 2\n\nin any drive.")
- (help "The Utility files are supplied on ReSource Disk 2, "
- "in the \"Utilities\" directory.\n\n"
- @askdisk-help
- )
- (dest "ReSource_2")
- )
-
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the Utility files be installed?")
- (help @askdir-help)
- (default ResMain)
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 26000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
-
- (copyfiles
- (source "ReSource_2:Utilities")
- (dest DestDir)
- (all)
- )
- )
- )
-
- (if (askbool
- (prompt "Install Example files?")
- (help "These files are intended to make your use of "
- "ReSource more productive by giving examples "
- "of how various features can be used."
- )
- )
-
- ; yes, install examples
- (
- (askdisk
- (prompt "\n\nPlease insert\n\nReSource Disk 2\n\nin any drive.")
- (help "The Example files are supplied on ReSource Disk 2, "
- "in the \"Examples\" directory.\n\n"
- @askdisk-help
- )
- (dest "ReSource_2")
- )
-
- (set OK 0)
- (while (= OK 0)
- (set DestDir
- (askdir
- (prompt "Where should the Example files be installed?")
- (help @askdir-help)
- (default ResMain)
- )
- )
-
- (set space_target DestDir)
- (GETSPACE)
-
- (if (< space_avail 94000)
- (message #ExtrasNoSpace)
- (set OK 1)
- )
- )
-
- (copyfiles
- (source "ReSource_2:Examples")
- (dest DestDir)
- (all)
- )
- )
- )
-
- (complete 96)
- )
- ; end of Install optional
- )
-
- (complete 100)
-