echo "Installing XiPaint module:"
failat 7
if exists :hhsxipaintmodkey.library
  echo "Installing Keyfile:"
  copy clone :H#?xipaintmodkey.library LIBS:
  echo "Keyfile hhsxipaintmodkey.library installed in LIBS:"
endif
requestfile noicons title "Select XiPaint main directory:" >ENV:XiPDir
if warn
  if not exists XiPaint:
    echo "I need to know the directory!"
    quit 20
  endif
else
  assign XiPaint: `echo $XiPDir`
endif
if exists XiPaint:
  if exists XiPaint:Modules
    echo "XiPaint 3.2 or higher detected:"
    echo "Installing .xio module in XiPaint:Modules"
    copy clone #?.xio XiPaint:Modules
  else
    echo "Old XiPaint without module support detected:"
    echo "Installing .xio module in XiPaint main directory"
    copy clone #?.xio XiPaint:
    echo "Installing loader script:"
    if exists XiPaint/Makro
      copy clone #?loader#?.rx XiPaint:Makro
    else
      copy clone #?loader#?.rx XiPaint:Makros
    endif
  endif
  echo "Installing MakeAnim macro:"
  if exists XiPaint:Makro
    copy clone make#?.rx#? XiPaint:Makro
  else
    copy clone make#?.rx#? XiPaint:Makros
  endif
  copy clone make#?.rx#? XiPaint:
  echo "The documentation is not installed; copy it by dragging"
  echo "to any place you like."
endif
wait 100

