Changeset 7516 for trunk/Bui_Core/resources/packaging/lin/install.sh
- Timestamp:
- 11/27/06 12:17:45 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Bui_Core/resources/packaging/lin/install.sh
r6964 r7516 38 38 39 39 # Init variables 40 appName="##app.name##" 41 appClientName="##app.clientName##" 40 appName="SCENARIclient" 41 appNameFull="SCENARIclient 3.3" 42 appVersion="3.3" 43 appVersionFull="3.3.0" 44 appPublisher="SCENARI" 45 appClientName="scChain" 42 46 appPrefixDefaultRoot="/opt" 43 47 linkPrefixDefaultRoot="/usr" 44 48 appPrefixDefaultUser=$HOME 45 49 linkPrefixDefaultUser=$HOME 46 logFile="/tmp/"$appName "-install_"$(date +%Y.%m.%d-%H.%M.%S)".log"50 logFile="/tmp/"$appName$appVersionFull"-install_"$(date +%Y.%m.%d-%H.%M.%S)".log" 47 51 ecoLine="" 48 52 # Start... 49 echo "$appName installer log" >> $logFile53 echo "$appName$appVersionFull installer log" >> $logFile 50 54 echo " _______________________________________________________________________________" 51 55 echo "|" 52 echo "| Welcome to the $appName installer"56 echo "| Welcome to the $appNameFull installer" 53 57 echo "|" 54 58 … … 56 60 if [ "$UID" -ne "0" ] 57 61 then 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." 60 64 installType="user" 61 65 appPrefixDefault=$appPrefixDefaultUser … … 63 67 else 64 68 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" 66 71 installType="root" 67 72 appPrefixDefault=$appPrefixDefaultRoot … … 74 79 if [ -f "license.txt" ] ; then 75 80 echo "Please read and accept the following end user license before" 76 echo "installing $appName ."81 echo "installing $appNameFull." 77 82 echo -n "Press Enter to continue" 78 83 read userRes … … 82 87 userRes=`echo $userRes | tr 'A-Z' 'a-z'` 83 88 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." 86 91 exit 1 87 92 fi … … 108 113 echo 109 114 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." 112 117 echo "It is therefore advisable to install OpenOffice (www.openoffice.org)." 113 118 fi 114 119 115 120 # 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 121 appPathDefault=$appPrefixDefault"/"$appPublisher"/"$appName$appVersion 122 echo 123 echo -n "Please give the installation location [$appPathDefault]: " 124 read appPath 125 if [ "$appPath" = "" ]; then 126 appPath=$appPathDefault 127 fi 128 129 # Delete previous installation if folder exists 130 130 if [ -d $appPath ]; then 131 131 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." 134 139 echo -n "Do you want to continue? [Y/n]: " 135 140 read userRes 136 141 if [ "$userRes" = "N" ] || [ "$userRes" = "n" ]; then 137 echo "Installation aborted, $appName was not installed."142 echo "Installation aborted, $appNameFull was not installed." 138 143 exit 1 139 144 fi … … 141 146 rm -Rf $appPath >> $logFile 2>&1 142 147 echo "OK" >> $logFile 143 fi 148 echo 149 fi 150 151 mkdir -p $appPath 152 if [ ! -w $appPath ]; then 153 echo "You do not have write permission for $appPath." 154 echo "Installation aborted, $appNameFull was not installed." 155 exit 1 156 fi 157 144 158 145 159 #============================================================================== … … 147 161 #============================================================================== 148 162 #Unpack SCx to the right location in appPrefix 149 echo -n "Unpacking $appName ..."150 echo -n "Unpack $appName to $appPath..." >> $logFile163 echo -n "Unpacking $appNameFull..." 164 echo -n "Unpack $appNameFull to $appPath..." >> $logFile 151 165 mkdir -p $appPath >> $logFile 2>&1 152 166 tar -x -z --no-same-owner --no-same-permissions -f $appName".tar.gz" -C $appPath >> $logFile 2>&1 … … 196 210 echo "OK" >> $logFile 197 211 198 echo "$appName has been installed in $appPath"212 echo "$appNameFull has been installed in $appPath" 199 213 200 214 #============================================================================== … … 204 218 echo "Enviroment integration..." >> $logFile 205 219 echo 206 echo -n "Do you want incorprate $appName into your enviroment? [Y/n]: "220 echo -n "Do you want incorprate $appNameFull into your enviroment? [Y/n]: " 207 221 read userRes 208 222 if [ "$userRes" = "" ] || [ "$userRes" = "y" ] || [ "$userRes" = "Y" ] ; then … … 217 231 linkPrefix=$linkPrefixDefault 218 232 fi 219 rm -f $linkPrefix"/bin/"$appName >> $logFile 2>&1220 ln -s $appPath"/"$appName $linkPrefix"/bin/"$appName >> $logFile 2>&1221 echo "The link $linkPrefix/bin/$appName has been added"222 echo "The link $linkPrefix/bin/$appName has been added" >> $logFile233 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 223 237 224 238 # Add menu item if possible (root and existing menu structure)... 225 239 if [ "$installType" = "root" ] && [ -d $linkPrefix"/share/applications" ]; then 226 appDesktopFilePath=$linkPrefix"/share/applications/"$appName ".desktop"240 appDesktopFilePath=$linkPrefix"/share/applications/"$appName$appVersion".desktop" 227 241 echo "[Desktop Entry]" > $appDesktopFilePath 228 echo "Name=$appName " >> $appDesktopFilePath242 echo "Name=$appNameFull" >> $appDesktopFilePath 229 243 echo "Encoding=UTF-8" >> $appDesktopFilePath 230 echo "Exec=$appName " >> $appDesktopFilePath244 echo "Exec=$appName$appVersion" >> $appDesktopFilePath 231 245 echo "Terminal=false" >> $appDesktopFilePath 232 246 echo "StartupNotify=true" >> $appDesktopFilePath … … 236 250 chmod 644 $appDesktopFilePath >> $logFile 2>&1 237 251 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." 239 253 echo "The file $appDesktopFilePath has been created" >> $logFile 240 254 fi 241 255 else 242 echo "$appName has not been incorporated into your enviroment"243 fi 244 echo 245 echo "$appName installation finished"246 echo "$appName installation finished" >> $logFile256 echo "$appNameFull has not been incorporated into your enviroment" 257 fi 258 echo 259 echo "$appNameFull installation finished" 260 echo "$appNameFull installation finished" >> $logFile
Note: See TracChangeset
for help on using the changeset viewer.