echo ""
echo " --------------------"
echo "  Install newlist7.1"
echo " --------------------"
echo ""
echo " This script will copy the appropriate version to c: and call it 'nl'." 
echo ""
echo "            Note: pressing return at prompts will mean 'no'."
echo ""
if exists c:nl
      echo ""
      echo " ATTENTION:  c:nl already exists!"
      ask  "             Do you wish to overwrite c:nl (y/n)?"
      if warn
      else
         echo ""
         echo "Installation aborted."  
         skip xit
      endif
      resident c:nl remove >nil:
      echo ""
      echo ""
endif

echo " Which newlist would you like to install?"
echo ""
echo "   Newlist6-13        -  old version for WB1.2/1.3 users"
echo "   Newlist71          -  English only    WB2.0 only"
echo "   Newlist71intl      -  Localized WB2.0 only"
echo "   Newlist71intl.030  -  Localized WB2.0 only 68030 version which"
echo "                              will crash on stock 68000 amiga"
echo ""
echo " I recommend you install the intl versions as they let you edit"
echo "   almost all of the internal strings and colors with no slow down!"
echo ""

ask " Install Newlist6-13 (y/n) ?"
if warn 
   copy newlist6-13 c:nl
   echo "      Newlist6-13 copied to c:nl..."
   resident c:nl add
   skip more
endif
ask " Install Newlist71 (y/n) ?"
if warn
   copy newlist71 c:nl
   echo "      Newlist71 copied to c:nl..."
   resident c:nl add
   skip more
endif
ask " Install Newlist71intl (y/n) ?"
if warn 
   copy newlist71intl c:nl
   echo "      Newlist71intl copied to c:nl..."
   skip installlang
endif
ask " Install Newlist71intl.030 (y/n) ?"
if warn 
   copy newlist71intl.030 c:nl
   echo "      Newlist71intl.030 copied to c:nl..."
lab installlang
   if exists ENV:NEWLIST_LANG
      echo ""
      ask " Want to replace ENV:NEWLIST_LANG (y/n) ?"
      if warn
      else 
         skip more
      endif
   endif
   echo ""
   echo " Please install a language...."
   cd languages
   execute install-lang
   cd /
   if exists ENV:NEWLIST_LANG
      else
         echo ""
         echo " Installation not complete!"
         echo "   In order to run newlist7intl versions a language must be installed."
         skip xit
      endif
   resident c:nl add
endif
lab more
echo ""
echo " -------------------"
echo "  Misc stuff to add"
echo " -------------------"
echo ""
echo " 'Aliases'   a bunch of useful aliases that use newlist's features."
echo " 'NewSpat'   a replacement for Commodore's s:spat that uses nl"
echo " 'NewDpat'   a replacement for Commodore's s:dpat that uses nl"
echo " 'newdir'    a neat newlist multi-execution example"
echo ""
ask " Shall I append 'Aliases' to your s:shell-startup (y/n) ?"
if warn 
   type scripts/Aliases >>s:shell-startup
endif
ask " Shall I replace s:spat and s:dpat with newlist versions (y/n)?"
if warn
   echo "  --Original spat and dpat will be renamed to spat.bak and dpat.bak"
   if exists s:spat
      rename s:spat s:spat.bak
   endif
   if exists s:dpat
      rename s:dpat s:dpat.bak
   endif
   copy scripts/newspat s:spat
   copy scripts/newdpat s:dpat
endif
ask " Shall I copy 'newdir' to your c: directory (y/n)?"
if warn
   copy scripts/newdir c:
endif
echo ""
echo " --------"
echo "  Extras"
echo " --------"
echo ""
echo "  RESIDENT   -  loads the program once into memory so further calls"
echo "                  do not need to be loaded again from disk."
echo "                  This makes newlist fast to run."
echo "  ENV:       -  Environment variables go here.  Newlist has environment"
echo "                  variable support to allow a user to customize his"
echo "                  default settings."
echo ""
ask " Shall I add 'RESIDENT c:nl PURE ADD' to the top of your s:user-startup ?"
if warn
   if exists s:user-startup
      copy s:user-startup ram:
      echo "RESIDENT c:nl PURE ADD" >s:user-startup
      type ram:user-startup >>s:user-startup
      delete ram:user-startup >nil:
   endif
endif
if exists ENV:NEWLIST
   echo ""
   echo " ----------"
   echo " ATTENTION: ENV: variables already exist!  Re-installing will erase all of"
   echo "            your ENV: variables and settings."
   echo ""
endif
ask " Shall I install my favorite ENV: settings in ENV: and ENVARC: (y/n) ?"
if warn
   if exists ENV:
      copy env env: >nil:
   endif
   if exists ENVARC:
      copy env envarc: >nil:
   endif
endif
echo ""
echo ""
echo " Installation complete.  If you have any problems, consult the"
echo "   installation section in NewList.doc."
echo ""
echo "           Try it out with:   nl"
echo "                              nl -z"
echo "                              nl -q"
echo "                              nl -qs"
echo "                              nl -qt"
echo "                              nl -?"
echo ""
echo " Enjoy!"
lab xit
echo ""

