;This documents provides a script to install ReSource V5 on your hard disk.
;This script does not copy the documentation files, and some other optional
;files to your hard disk.  These files are:
;
;    ReSource1:
;    :Install                 Installation information and script
;    :ReadMe                  Important information about this release
;    :ReSource.info           Icon for ReSource
;    :RSConfig.info           Icon for RSConfig
;    
;    ReSource2:
;    :Docs/
;       ShowKeys.doc          Documentation for ShowKeys
;       ShowMacros.doc        Documentation for ShowMacros
;       Libraries.doc         Description of ReSource's libraries
;       Example_Macros.doc    Documentation for example macros
;       RCL.doc               Documentation for ReSource Command Language
;       History.doc           Optional file containing incremental documentation
;    :UserSymbols/
;       CIA_Regs.symbols      User-symbol base for CIA registers
;       CIA_Regs.symbols.asm  Source code for above
;       JFuncs.symbols        User-symbol base for Janus Library functions
;       JFuncs.symbols.asm    Source code for above
;       JServices.symbols     User-symbol base for Janus service numbers
;       JServices.symbols.asm Source code for above
;       UserSymbols.doc       Documentation for creating user-defined symbol bases
;    :Offsets/                All the V2.0 library offsets
;    :Includes/               All the V2.0 include.i files

echo " "
echo "[0;33mReSource[0;31m ©1988-1991 Glen McDiarmid.  All rights reserved"
echo "Distributed by The Puzzle Factory, Inc."
echo " "

assign OrigDir: ""               ;Save current directory

if exists c:copy                 ;Copy needed commands to ram: for speed
  copy c:copy ram:
endif

if exists c:echo
  ram:copy c:echo ram:
endif

cd ram:

echo "This script will install ReSource V5 onto your hard disk."
echo " "
echo "These files will be copied to the following destinations:"
echo "c:ReSource  c:ShowKeys  c:ShowMacros  c:RSConfig"
echo "libs:ReSource/ReSourcemenus.library   libs:ReSource/ReSourcesyms.library"
echo "libs:ReSource/ReSourceloader.library  libs:ReSource/ReSourcehelp.library"
echo " "
echo "These files will be copied only if they do not already exist:"
echo "s:RS.Keytable  s:RS.Macros  libs:arp.library"
echo " "
ask      "Ok to continue with the installation? [y/N]: "
if not warn
  skip Thanks
endif
echo " "
echo "Copying the files now.  Type Ctrl-D to abort."
echo " "

echo "This is the main program."
echo "Copying ReSource to c:"
Copy ReSource1:ReSource c:
echo " "

echo "These programs are all utilities to be used with ReSource."
echo "Copying ShowKeys to c:"
Copy ReSource1:ShowKeys c:
echo " "

if not exists s:RS.Keytable
  echo "Copying RS.Keytable s:"
  Copy ReSource1:s/RS.Keytable s:
echo " "
endif
echo "Copying ShowMacros to c:"
Copy ReSource1:ShowMacros c:
echo " "
if not exists s:RS.Macros
  echo "Copying RS.Macros s:"
  Copy ReSource1:s/RS.Macros s:
echo " "
endif
echo "Copying RSConfig to c:"
Copy ReSource1:RSConfig c:
echo " "

echo "ReSource can look for its libraries in a number of different places."
echo "We are going to use libs:ReSource."
if not exists libs:ReSource
  echo " "
  echo "Creating libs:ReSource/"
  makedir libs:ReSource
endif

echo " "
echo "This library provides ReSource with its menus."
echo "Copying ReSourcemenus.library to libs:ReSource/"
copy ReSource1:libs/ReSourcemenus.library libs:ReSource/
echo " "

echo "This library contains the built-in symbol bases."
echo "Copying ReSourcesyms.library to libs:ReSource/"
copy ReSource1:libs/ReSourcesyms.library libs:ReSource/
echo " "

echo "This library provides ReSource with the loader functions."
echo "Copying ReSourceloader.library to libs:ReSource/"
copy ReSource1:libs/ReSourceloader.library libs:ReSource/
echo " "

echo "This library contains the online help system."
echo "Copying ReSourcehelp.library to libs:ReSource/"
copy ReSource1:libs/ReSourcehelp.library libs:ReSource/
echo " "

if not exists libs:arp.library
  echo "ReSource requires arp.library be present."
  echo "Copying arp.library to libs:"
  copy ReSource1:libs/arp.library to libs:
echo " "
endif
echo " "

echo " "
echo "CFuncs.rcl is a ReSource Command Language file that provides ReSource with"
echo "information about standard 'C' functions.  It is about 300K in length."
ask  "Would you like this file copied to libs:ReSource/ now? [y/N]: "
if warn
  echo "Copying CFuncs.rcl to libs:ReSource/"
  copy ReSource1:libs/CFuncs.rcl to libs:ReSource/
endif
echo " "

ReSource1:TestWB2
if not warn
  skip Complete
endif

if not exists c:FF
  echo "Could not find c:FF."
  echo "We suggest that you use FF© or BlitzFonts© due"
  echo "to the large number of menu items in ReSource."
  echo " "
endif

lab Complete
echo "Installation of ReSource V5 is complete."

lab Thanks
echo " "
echo "Thanks for your support, from all of us at The Puzzle Factory."

if exists ram:copy              ;Delete copied commands from ram:
  delete ram:copy quiet
endif

if exists ram:echo
  delete ram:echo quiet
endif

cd OrigDir:                    ;Retrieve current directory
assign OrigDir:   
cd ""
