root/pbibuild/modules/basket/overlay-dir/PBI.FirstRun.sh

Revision 1020, 1.8 KB (checked in by gonzalo, 12 months ago)

BasKet? added

  • Property svn:executable set to *
Line 
1#!/bin/sh
2# Filename: PBI.FirstRun.sh
3# Place any custom installation code here.
4# This script will be run before your program is extracted into
5# /Programs/<ProgNameVer>/
6# Available variables:
7# $PROGDIR - Directory where the files will be extracted to.
8# $USERNAME - Username of who started the installation.
9# $INSTALLMODE - Set to 'TEXT' or 'GUI', depending on which installer is running.
10#
11# Return a '2' to halt the PBI installation
12# TIP: 'kdialog' should be used for user interaction.
13# To interact with the progress dialog echo these flags:
14# echo 'TOTALSTEPS: <num>' # Set the total steps of the progress bar
15# echo 'SETSTEPS: <num>' # Set the current progress of the progress bar
16# echo 'MSG: <text>' # Display this text above progress bar
17#########################################
18
19if [ -e "/usr/local/bin/basket" ]
20then
21    # Looks like FF is installed, ask if they want to remove the old one
22    ls -al /usr/local/bin/basket | grep Programs 2>/dev/null
23    if [ "$?" = "0" ]
24    then
25      kdialog --yesno "BasKet is already installed, do you wish to uninstall it?" 
26      if [ "$?" = "0" ]
27      then
28        FF="`ls -al /usr/local/bin/basket | cut -d '>' -f 2 | cut -d "/" -f 3`"
29        echo $FF | grep BasKet 2>/dev/null
30        if [ "$?" = "0" ]
31        then
32          PBIdelete -remove ${FF}
33          sleep 2
34        else
35          kdialog --sorry "BasKet could not be automatically removed... Please remove it in Add / Remove Programs and try again."
36          return 2
37        fi
38      else
39        kdialog --sorry "BasKet is already installed, it must be uninstalled before loading this PBI"
40        return 2
41      fi
42     
43    else
44      # Could not find a link to PBI folder
45      kdialog --sorry "BasKet is already installed, it must be uninstalled before loading this PBI"
46      return 2
47    fi
48fi 
Note: See TracBrowser for help on using the browser.