home *** CD-ROM | disk | FTP | other *** search
- #!/bin/bash -x
- ##########################################################################
- #
- # $RCSfile: installutils,v $
- #
- # $Revision: 1.21 $
- #
- # last change: $Author: pluby $ $Date: 2007/11/12 19:34:49 $
- #
- # The Contents of this file are made available subject to the terms of
- # either of the following licenses
- #
- # - GNU General Public License Version 2.1
- #
- # Patrick Luby, June 2003
- #
- # GNU General Public License Version 2.1
- # =============================================
- # Copyright 2003 Planamesa Inc.
- #
- # This library is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public
- # License version 2.1, as published by the Free Software Foundation.
- #
- # This library is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- # General Public License for more details.
- #
- # You should have received a copy of the GNU General Public
- # License along with this library; if not, write to the Free Software
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- # MA 02111-1307 USA
- #
- ##########################################################################
-
- userinstall="$HOME/Library/Preferences/NeoOffice-2.2"
- target_file_type="Mach-O executable i386"
-
- check_installation() {
-
- if [ -z "$1" ] ; then
- return 1;
- fi
-
- file_type=`file "$1/Contents/MacOS/soffice.bin" | sed 's#^.*: ##'`
- if [ "$file_type" != "$target_file_type" ] ; then
- return 1
- fi
-
- if [ -f "$1/Contents/MacOS/bootstraprc" ] ; then
- # Allow a product family match
- productnameversion="NeoOffice 2.2"
- productkey=`grep "^ProductKey=$productnameversion" "$1/Contents/MacOS/bootstraprc"`
- if [ ! -z "$productkey" ] ; then
- return 0;
- fi
- fi
-
- return 1
-
- }
-
- check_running() {
-
- productname=`echo "$1" | grep "/NeoOffice\.app\$"`
-
- if [ -z "$productname" ] ; then
- return 1;
- fi
-
- return 0;
-
- }
-