#!/bin/sh

# The full path to the installation package.
PackagePath=$1
# The full path to the installation destination.
DestPath=$2
# The mountpoint of the destination volume.
DestVolMPPath=$3
# The root directory for the current System folder.
RootPath=$4

cd "${RootPath}" || exit `expr 96 + 0 + 3`	# Cancel with the system message #3

if [ \! -f usr/local/clamXav/sbin/clamd ]; then
	# Cancel with the message #16
	exit `expr 96 + 16 + 0`
fi
if [ \! -x usr/local/clamXav/sbin/clamd ]; then
	# Cancel with the message #17
	exit `expr 96 + 16 + 1`
fi
if [ \! -f usr/local/clamXav/etc/clamd.conf ]; then
	# Cancel with the message #18
	exit `expr 96 + 16 + 2`
fi
if /usr/bin/grep '^[:space:]*Example[:space:]*' usr/local/clamXav/etc/clamd.conf > /dev/null; then
	# Cancel with the message #19
	exit `expr 96 + 16 + 3`
fi

if [ -f Library/StartupItems/ClamAntiVirusDaemon/ClamAntiVirusDaemon ]; then
	if [ -f Library/StartupItems/ClamAntiVirusDaemon/StartupParameters.plist ]; then
		# Warning with the message #20
		exit `expr 32 + 16 + 4`
	fi
	# Warning with the message #21
	exit `expr 32 + 16 + 5`
fi
if [ -f Library/StartupItems/ClamAntiVirusDaemon/StartupParameters.plist ]; then
	# Warning with the message #22
	exit `expr 32 + 16 + 6`
fi

exit 0
