#!/bin/sh
#
# $Id: synce-install-cab.in,v 1.1 2002/11/27 09:15:23 twogood Exp $
#
# Script to install a .cab file
#
prefix=/usr/pkg
exec_prefix=${prefix}

if [ ! -f "$1" ]; then
	echo "Enter .cab file as parameter"
	exit 1
fi

#
# First, make sure that these directories exist
#
set +e
${exec_prefix}/bin/pmkdir /Windows/AppMgr 2>/dev/null
${exec_prefix}/bin/pmkdir /Windows/AppMgr/Install 2>/dev/null

set -e

# copy the file to a special directory
echo "Copying file '$1' to device..."
${exec_prefix}/bin/pcp "$1" ":/Windows/AppMgr/Install/synce-install.cab"

# run program that installs cab file in /Windows/AppMgr/Install
echo "Installing '$1'..."
${exec_prefix}/bin/prun wceload.exe

