Ignore:
Timestamp:
11/27/06 12:17:45 (5 years ago)
Author:
sam
Message:

Mise à jour BUI Linux => 3.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bui_Core/resources/packaging/lin/install.sh

    r6964 r7516  
    3838 
    3939# Init variables 
    40 appName="##app.name##" 
    41 appClientName="##app.clientName##" 
     40appName="SCENARIclient" 
     41appNameFull="SCENARIclient 3.3" 
     42appVersion="3.3" 
     43appVersionFull="3.3.0" 
     44appPublisher="SCENARI" 
     45appClientName="scChain" 
    4246appPrefixDefaultRoot="/opt" 
    4347linkPrefixDefaultRoot="/usr" 
    4448appPrefixDefaultUser=$HOME 
    4549linkPrefixDefaultUser=$HOME 
    46 logFile="/tmp/"$appName"-install_"$(date +%Y.%m.%d-%H.%M.%S)".log" 
     50logFile="/tmp/"$appName$appVersionFull"-install_"$(date +%Y.%m.%d-%H.%M.%S)".log" 
    4751ecoLine="" 
    4852# Start... 
    49 echo "$appName installer log" >> $logFile 
     53echo "$appName$appVersionFull installer log" >> $logFile 
    5054echo " _______________________________________________________________________________" 
    5155echo "|" 
    52 echo "| Welcome to the $appName installer" 
     56echo "| Welcome to the $appNameFull installer" 
    5357echo "|" 
    5458 
     
    5660if [ "$UID" -ne "0" ] 
    5761then 
    58         echo "| You do not have root access. $appName will be installed in your" 
    59         echo "| home directory by default." 
     62        echo "| You do not have root access." 
     63        echo "| $appNameFull will be installed in your home directory by default." 
    6064        installType="user" 
    6165        appPrefixDefault=$appPrefixDefaultUser 
     
    6367else 
    6468        echo "|" 
    65         echo "| You have root access. $appName will be installed system wide by default" 
     69        echo "| You have root access." 
     70        echo "| $appNameFull will be installed system wide by default" 
    6671        installType="root" 
    6772        appPrefixDefault=$appPrefixDefaultRoot 
     
    7479if [ -f "license.txt" ] ; then  
    7580        echo "Please read and accept the following end user license before" 
    76         echo "installing $appName." 
     81        echo "installing $appNameFull." 
    7782        echo -n "Press Enter to continue" 
    7883        read userRes 
     
    8287        userRes=`echo $userRes | tr 'A-Z' 'a-z'` 
    8388        if [ "$userRes" != "y" ] && [ "$userRes" != "yes" ] ; then  
    84                 echo "If you don't agree to the license you can't install $appName." 
    85                 echo "Installation aborted, $appName was not installed." 
     89                echo "If you don't agree to the license you can't install $appNameFull." 
     90                echo "Installation aborted, $appNameFull was not installed." 
    8691                exit 1 
    8792        fi 
     
    108113        echo 
    109114        echo "WARNING: The installer cannot find OpenOffice on this system." 
    110         echo "Although OpenOffice is not mandatory in order to use $appName," 
    111         echo "certain features may be affected." 
     115        echo "Although OpenOffice is not mandatory in order to use $appNameFull," 
     116        echo "certain features may be affected if it is not present." 
    112117        echo "It is therefore advisable to install OpenOffice (www.openoffice.org)." 
    113118fi 
    114119 
    115120# Prompt for install location. 
    116 echo 
    117 echo -n "Please give the installation location [$appPrefixDefault]: " 
    118 read appPrefix 
    119 if [ "$appPrefix" = "" ]; then 
    120         appPrefix=$appPrefixDefault 
    121 fi 
    122 if [ ! -w $appPrefix ]; then 
    123         echo "You do not have write permission for $appPrefix." 
    124         echo "Installation aborted, $appName was not installed." 
    125         exit 1 
    126 fi 
    127 appPath=$appPrefix"/"$appName 
    128  
    129 # Delete previous installation if it exists 
     121appPathDefault=$appPrefixDefault"/"$appPublisher"/"$appName$appVersion 
     122echo 
     123echo -n "Please give the installation location [$appPathDefault]: " 
     124read appPath 
     125if [ "$appPath" = "" ]; then 
     126        appPath=$appPathDefault 
     127fi 
     128 
     129# Delete previous installation if folder exists 
    130130if [ -d $appPath ]; then 
    131131        echo 
    132         echo "WARNING: $appName is already installed in $appPrefix." 
    133         echo "This previous intallation will be deleted before proceding." 
     132        if [ ! -w $appPath ]; then 
     133                echo "You do not have write permission for $appPath." 
     134                echo "Installation aborted, $appNameFull was not installed." 
     135                exit 1 
     136        fi 
     137        echo "WARNING: $appPath. in not empty." 
     138        echo "This folder will be deleted before proceding." 
    134139        echo -n "Do you want to continue? [Y/n]: " 
    135140        read userRes 
    136141        if [ "$userRes" = "N" ] || [ "$userRes" = "n" ]; then  
    137                 echo "Installation aborted, $appName was not installed." 
     142                echo "Installation aborted, $appNameFull was not installed." 
    138143                exit 1 
    139144        fi 
     
    141146        rm -Rf $appPath >> $logFile 2>&1 
    142147        echo "OK" >> $logFile 
    143 fi 
     148        echo 
     149fi 
     150 
     151mkdir -p $appPath 
     152if [ ! -w $appPath ]; then 
     153        echo "You do not have write permission for $appPath." 
     154        echo "Installation aborted, $appNameFull was not installed." 
     155        exit 1 
     156fi 
     157 
    144158 
    145159#============================================================================== 
     
    147161#============================================================================== 
    148162#Unpack SCx to the right location in appPrefix 
    149 echo -n "Unpacking  $appName..." 
    150 echo -n "Unpack $appName to $appPath..." >> $logFile 
     163echo -n "Unpacking  $appNameFull..." 
     164echo -n "Unpack $appNameFull to $appPath..." >> $logFile 
    151165mkdir -p $appPath >> $logFile 2>&1 
    152166tar -x -z --no-same-owner --no-same-permissions -f $appName".tar.gz"  -C $appPath >> $logFile 2>&1 
     
    196210echo "OK" >> $logFile 
    197211 
    198 echo "$appName has been installed in $appPath" 
     212echo "$appNameFull has been installed in $appPath" 
    199213 
    200214#============================================================================== 
     
    204218echo "Enviroment integration..." >> $logFile 
    205219echo 
    206 echo -n "Do you want incorprate $appName into your enviroment? [Y/n]: " 
     220echo -n "Do you want incorprate $appNameFull into your enviroment? [Y/n]: " 
    207221read userRes 
    208222if [ "$userRes" = "" ] || [ "$userRes" = "y" ] || [ "$userRes" = "Y" ] ; then  
     
    217231                linkPrefix=$linkPrefixDefault  
    218232        fi 
    219         rm -f $linkPrefix"/bin/"$appName >> $logFile 2>&1 
    220         ln -s $appPath"/"$appName $linkPrefix"/bin/"$appName >> $logFile 2>&1 
    221         echo "The link $linkPrefix/bin/$appName has been added" 
    222         echo "The link $linkPrefix/bin/$appName has been added" >> $logFile 
     233        rm -f $linkPrefix"/bin/"$appName$appVersion >> $logFile 2>&1 
     234        ln -s $appPath"/"$appName $linkPrefix"/bin/"$appName$appVersion >> $logFile 2>&1 
     235        echo "The link $linkPrefix/bin/$appName$appVersion has been added" 
     236        echo "The link $linkPrefix/bin/$appName$appVersion has been added" >> $logFile 
    223237 
    224238        # Add menu item if possible (root and existing menu structure)... 
    225239        if [ "$installType" = "root" ] && [ -d $linkPrefix"/share/applications" ]; then 
    226                 appDesktopFilePath=$linkPrefix"/share/applications/"$appName".desktop" 
     240                appDesktopFilePath=$linkPrefix"/share/applications/"$appName$appVersion".desktop" 
    227241                echo "[Desktop Entry]" > $appDesktopFilePath 
    228                 echo "Name=$appName" >> $appDesktopFilePath 
     242                echo "Name=$appNameFull" >> $appDesktopFilePath 
    229243                echo "Encoding=UTF-8" >> $appDesktopFilePath 
    230                 echo "Exec=$appName" >> $appDesktopFilePath 
     244                echo "Exec=$appName$appVersion" >> $appDesktopFilePath 
    231245                echo "Terminal=false" >> $appDesktopFilePath 
    232246                echo "StartupNotify=true" >> $appDesktopFilePath 
     
    236250                chmod 644 $appDesktopFilePath  >> $logFile 2>&1 
    237251 
    238                 echo "$appName has been added to the Office sub-menu of the Applications menu." 
     252                echo "$appNameFull has been added to the Office sub-menu of the Applications menu." 
    239253                echo "The file $appDesktopFilePath has been created" >> $logFile 
    240254        fi 
    241255else 
    242         echo "$appName has not been incorporated into your enviroment" 
    243 fi 
    244 echo 
    245 echo "$appName installation finished" 
    246 echo "$appName installation finished" >> $logFile 
     256        echo "$appNameFull has not been incorporated into your enviroment" 
     257fi 
     258echo 
     259echo "$appNameFull installation finished" 
     260echo "$appNameFull installation finished" >> $logFile 
Note: See TracChangeset for help on using the changeset viewer.