#!./vipsi

put«
  *********************************************
  *                hello vipsi                *
  *********************************************

        i'm about to install myself
        this requires root privileges
»


try
	sys "rm", "-f",          "/usr/bin/calc"
	sys "cp", "-f", "vipsi", "/usr/bin"
	sys "ln", "-s", "vipsi", "/usr/bin/calc"
	sys "touch",             "/etc/vipsi.cgi.conf"
else
	log nl, "        ", errorstr
	log nl, "        this requires root privileges"
	put nl
	del errorstr
then


var homedir = fullpath "~"
if rightstr(homedir,1)!="/" homedir #= "/" then
put nl, "        installing preferences into ", convert(homedir to quoted), nl
var prefsdir    = homedir  # ".vipsi/"
var calc_prefs  = prefsdir # "calc.prefs"
var shell_prefs = prefsdir # "shell.prefs"
var script_prefs= prefsdir # "script.prefs"

if !exists dir prefsdir
	new dir prefsdir
then

if !exists file calc_prefs
	file calc_prefs = file "../examples/calc.prefs"
then

if !exists file shell_prefs
	file shell_prefs = file "../examples/shell.prefs"
then

if !exists file script_prefs
	file script_prefs = file "../examples/script.prefs"
then


put nl, "        if no errors occured then all is done"
put nl
put nl

wait 0.66






