#!/bin/bash
# Update the installation log with path info
#
# Executable property has been set in Subversion.
#
echo "" >> ~/HOBOwareInstall.txt
echo "postinstall script" >> ~/HOBOwareInstall.txt
echo "" >> ~/HOBOwareInstall.txt
echo "HOBOware installer launched from $1" >> ~/HOBOwareInstall.txt 
echo "HOBOware installed in $2" >> ~/HOBOwareInstall.txt
echo "Mountpoint of destination volume is $3" >> ~/HOBOwareInstall.txt
echo "Root directory for current System folder is $4" >> ~/HOBOwareInstall.txt
echo "Scratchpad area used by installer at $INSTALLER_TEMP" >> ~/HOBOwareInstall.txt
echo "" >> ~/HOBOwareInstall.txt

# 02SEP2009 jed, OS X 10.6 (Snow Leopard) seems to only send 3 parameters. For now, I'm
#                assuming the fourth parameter is the root of the System and it is
#                being forced to be "/" for now.
if (( $# != 4 ))
then
	echo "Only $# arguments received from Install.app. Adding System root argument." >> ~/HOBOwareInstall.txt
	echo "" >> ~/HOBOwareInstall.txt
	source "${1%/}/Contents/Resources/OnsetPostFunctions" "$@" "/" "$INSTALLER_TEMP"
else
	echo "All 4 arguments received from Installer.app." >> ~/HOBOwareInstall.txt
	echo "" >> ~/HOBOwareInstall.txt
	source "${1%/}/Contents/Resources/OnsetPostFunctions" "$@" "$INSTALLER_TEMP"
fi

exit $?
