#!/bin/sh
#BK may 2011
PWD="`pwd`"
SETDEFAULT='no'
if [ "$PWD" = "/" ];then #installing in a running puppy.
if [ "`cat /root/.packages/woof-installed-packages /root/.packages/user-installed-packages | grep 'gecko\-mediaplayer'`" = "" ];then
EXTRAMSG="
"
fi
export ASKDIALOG="
${EXTRAMSG}
"
RETVAL="`gtkdialog3 --program=ASKDIALOG`"
echo "$RETVAL"
[ "`echo "$RETVAL" | grep 'SetDefault'`" != "" ] && SETDEFAULT='yes'
fi
if [ "$PWD" != "/" -o "$SETDEFAULT" = "yes" ];then
echo '#!/bin/sh' > ./usr/local/bin/defaultmediaplayer
echo 'exec gnomemplayershell "$@"' >> ./usr/local/bin/defaultmediaplayer
chmod 755 ./usr/local/bin/defaultmediaplayer
echo '#!/bin/sh' > ./usr/local/bin/defaultvideoplayer
echo 'exec gnomemplayershell "$@"' >> ./usr/local/bin/defaultvideoplayer
chmod 755 ./usr/local/bin/defaultvideoplayer
fi