#!/bin/sh

# Install the Diploma 6 Folder
su "$USER" -c "\"$PACKAGE_PATH/Contents/Resources/installerPostProcessing.app/Contents/MacOS/installerPostProcessing\" \"$PACKAGE_PATH\""
chown -R "$USER" "$HOME/Documents/Diploma 6 Folder"

# Remove the old Diploma app without the ".app" extension
rm -rf "$2/Diploma 6"
rm -rf "$2/Applications/Diploma 6"

# Remove the old Diploma app, now that the name has changed to "Wimba Diploma 6.app"
rm -rf "$2/Diploma 6.app"
rm -rf "$2/Applications/Diploma 6.app"

# Remove our receipt. It is impossible to install older versions unless we do this.
# The preflight script will take care of uninstalling any existing version.
rm -rf "/Library/Receipts/Diploma"*
rm -rf "/Library/Receipts/Wimba Diploma"*

exit 0
