echo "This script will copy MachV to your WBStartup drawer and SetMachV"
echo "to your sys:Tools or sys:Utilities drawer.*N"
echo "The library mach.library will be copied to your libs: directory.*N"
echo "Then it will create the directory ENVARC:MachV and copy"
echo "MachV.prefs to it.*N"
echo "If you are updating from a previous version of MachV, your"
echo "MachV.prefs file will not be overwritten.*N"
echo "You will be prompted for all actions.*N"

ask "Ok to proceed?"
if not warn
  echo "Script aborted!"
  quit
endif

; Copy MachV

if not exists MachV
  echo "MachV not found. Aborting..."
  quit
endif

if exists sys:WBStartup
  set destdir sys:WBStartup
else
  set destdir c:
endif

ask "Copy MachV to $destdir?"
if warn
  echo "Copying MachV to $destdir"
  copy MachV to $destdir
  copy MachV.info to $destdir
endif

; Copy SetMachV

if not exists SetMachV
  echo "SetMachV not found. Aborting..."
  quit
endif

if exists sys:Tools
  set destdir sys:Tools
else
  if exists sys:Utilities
    set destdir sys:Utilities
  else
    set destdir c:
  endif
endif

ask "Copy SetMachV to $destdir?"
if warn
  echo "Copying SetMachV to $destdir*N"
  copy SetMachV $destdir
  copy SetMachV.info $destdir
endif

if exists mach.library
  ask "Copy mach.library to libs:?"
  if warn
    echo "Copying mach.library to libs:*N"
    copy mach.library libs:
  endif
else
  echo "mach.library not found. Aborting..."
  quit
endif

if not exists ENVARC:MachV
  ask "Create ENVARC:MachV?"
  if warn
    echo "Creating the directory ENVARC:MachV"
    makedir ENVARC:MachV
  endif
endif

if not exists ENVARC:MachV/MachV.prefs
  echo "Copying MachV.prefs to ENVARC:MachV*N"
  copy MachV.prefs ENVARC:MachV
  copy MachV.prefs.info ENVARC:MachV
else
  echo "ENVARC:MachV/MachV.prefs already exists. MachV.prefs not copied.*N"
endif

ask "Copy vibra.8SVX sound file to ENVARC:MachV?"
if warn
  copy Beeps/vibra.8SVX ENVARC:MachV
endif

echo "*NInstallation complete."







