#!/bin/bash
# Kona Version of Postflight

# Remove any existing FCP preference files
"$3/bin/rm" -f ~/Library/Preferences/Final\ Cut\ Pro\ User\ Data/Final\ Cut\ Pro\ [0-9.]*\ Preferences
"$3/bin/rm" -f ~/Library/Preferences/Final\ Cut\ Pro\ User\ Data/Final\ Cut\ Pro\ [0-9.]*\ Prefs.fcset
"$3/bin/rm" -f ~/Library/Preferences/Final\ Cut\ Pro\ User\ Data/Final\ Cut\ Pro\ Obj\ Cache.fcmch
"$3/bin/rm" -f ~/Library/Preferences/Final\ Cut\ Pro\ User\ Data/Final\ Cut\ Pro\ Prof\ Cache.fcpch
"$3/bin/rm" -f ~/Library/Preferences/Final\ Cut\ Pro\ User\ Data/Final\ Cut\ Pro\ MOA\ Cache
"$3/bin/rm" -f ~/Library/Preferences/Final\ Cut\ Pro\ User\ Data/Final\ Cut\ Pro\ POA\ Cache

# Remove old User Presets and Control Panel folder from prior 2.0 installs if they even exist
"$3/bin/mv" -f $3/Applications/Kona\ ControlPanel/User\ Presets/* $3/Library/Application\ Support/AJA/Kona\ Presets
"$3/bin/rm" -rf $3/Applications/Kona\ ControlPanel

#copy the version plist to disk
"$3/bin/cp" "$1/Contents/Resources/com.aja.driver.plist" "$3/Library/Preferences/"
/bin/chmod 664 "$3/Library/Preferences/com.aja.driver.plist"

# Force a cache miss on the kext cache
"$3/usr/bin/touch" $3/System/Library/Extensions

