#!/bin/sh
#Installer Replacement Script v1.0
#by Iritscen
#For use in the Anniversary Edition, a modding framework for Oni
#This file should be in Edition/updates/Edition[-patch]/install/

CURDIR=$(cd $(dirname "$0"); pwd)
DELDIR=$1
OLDINS=$CURDIR/../../../install/Installer.app
NEWINS=$CURDIR/Installer.app

sleep 1

if [ -a $NEWINS ]; then
	if [ -a $OLDINS ]; then
		mv $OLDINS $DELDIR
	else
		exit
	fi
	sleep 1
	mv $NEWINS $OLDINS
	NEWINS=$OLDINS
	sleep 1
	open $NEWINS
else
	open $OLDINS
fi