#!/bin/bash
#
# This postflight script echoes the values of the available 
# arguments and environmental variables.
#
echo "Start postflight script"
echo ""
echo "Arguments:"
echo ""
echo "\$1: full path to the installation package"
echo "     $1"
echo "\$2: full path to the installation destination"
echo "     $2"
echo "\$3: mountpoint of the destination volume"
echo "     $3"
echo "\$4: root directory \"/\" for the current System folder"
echo "     $4"
echo ""
echo "Environment variables available to a postflight executable:"
echo "     INSTALLER_TEMP, PACKAGE_PATH, RECEIPT_PATH, SCRIPT_NAME, and TMPDIR"
echo ""
echo "\$INSTALLER_TEMP: scratch area used by Installer for temporary work files"
echo "     $INSTALLER_TEMP"
echo ""
echo "\$PACKAGE_PATH: full path to the installation package; should be same as \$1"
echo "     $PACKAGE_PATH"
echo ""
echo "\$RECEIPT_PATH: full path to directory containing the file being executed"
echo "     $RECEIPT_PATH"
echo ""
echo "\$SCRIPT_NAME: name of the file being executed"
echo "     $SCRIPT_NAME"
echo ""
echo "\$TMPDIR: if set, a path to a location on a writable destination volume"
echo "     $TMPDIR"
echo ""
echo "End postflight script"

cp -r $2/VeescopeSignalsManual.pdf $4/Applications
$4/Applications/Preview.app/Contents/MacOS/Preview $4/Applications/VeescopeSignalsManual.pdf &
exit 0
