home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2008 February / MAC_easy_02_08.iso / Software / Top-Ten-Programme / NeoOffice-2.2.3-Intel.dmg / NeoOffice-2.2.3-Intel.pkg / Contents / Resources / installutils < prev    next >
Encoding:
Text File  |  2008-03-14  |  2.0 KB  |  75 lines

  1. #!/bin/bash -x
  2. ##########################################################################
  3. #   $RCSfile: installutils,v $
  4. #   $Revision: 1.21 $
  5. #   last change: $Author: pluby $ $Date: 2007/11/12 19:34:49 $
  6. #   The Contents of this file are made available subject to the terms of
  7. #   either of the following licenses
  8. #          - GNU General Public License Version 2.1
  9. #   Patrick Luby, June 2003
  10. #   GNU General Public License Version 2.1
  11. #   =============================================
  12. #   Copyright 2003 Planamesa Inc.
  13. #   This library is free software; you can redistribute it and/or
  14. #   modify it under the terms of the GNU General Public
  15. #   License version 2.1, as published by the Free Software Foundation.
  16. #   This library is distributed in the hope that it will be useful,
  17. #   but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  19. #   General Public License for more details.
  20. #   You should have received a copy of the GNU General Public
  21. #   License along with this library; if not, write to the Free Software
  22. #   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. #   MA  02111-1307  USA
  24. ##########################################################################
  25.  
  26. userinstall="$HOME/Library/Preferences/NeoOffice-2.2"
  27. target_file_type="Mach-O executable i386"
  28.  
  29. check_installation() {
  30.  
  31.     if [ -z "$1" ] ; then
  32.         return 1;
  33.     fi
  34.  
  35.     file_type=`file "$1/Contents/MacOS/soffice.bin" | sed 's#^.*: ##'`
  36.     if [ "$file_type" != "$target_file_type" ] ; then
  37.         return 1
  38.     fi
  39.  
  40.     if [ -f "$1/Contents/MacOS/bootstraprc" ] ; then
  41.         # Allow a product family match
  42.         productnameversion="NeoOffice 2.2"
  43.         productkey=`grep "^ProductKey=$productnameversion" "$1/Contents/MacOS/bootstraprc"`
  44.         if [ ! -z "$productkey" ] ; then
  45.             return 0;
  46.         fi
  47.     fi
  48.  
  49.     return 1
  50.  
  51. }
  52.  
  53. check_running() {
  54.  
  55.     productname=`echo "$1" | grep "/NeoOffice\.app\$"`
  56.  
  57.     if [ -z "$productname" ] ; then
  58.         return 1;
  59.     fi
  60.  
  61.     return 0;
  62.  
  63. }
  64.