1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
#!/bin/bash MACHINE_TYPE=`uname -m` # Checks that the script is running as root, if not # it will ask for permissions # Source: http://unix.stackexchange.com/a/28796 if (($EUID != 0)); then if [[ -t 1 ]]; then sudo "$0" "$@" else exec 1>output_file gksu "$0 $@" fi exit fi echo "Downloading Aptana Studio 3" cd /tmp if [ ${MACHINE_TYPE} == 'x86_64' ]; then wget http://download.aptana.com/studio3/standalone/3.4.1/linux/Aptana_Studio_3_Setup_Linux_x86_64_3.4.1.zip -O AptanaStudio.zip else wget http://download.aptana.com/studio3/standalone/3.4.1/linux/Aptana_Studio_3_Setup_Linux_x86_3.4.1.zip -O AptanaStudio.zip fi # Create the /opt dir if it doesn't exist if [ ! -d /opt/ ]; then mkdir /opt/ fi echo "Extracting Aptana Studio 3 to /opt" unzip -q AptanaStudio.zip -d /opt/ echo "Adding Aptana Studio 3 desktop entry" # Create the /usr/local/share/icons dir if it doesn't exist if [ ! -d /usr/local/share/icons/ ]; then mkdir /usr/local/share/icons/ fi # Fix for large icon problem cp /opt/Aptana_Studio_3/icon.xpm /usr/local/share/icons/aptanastudio3.xpm echo "#!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Encoding=UTF-8 Name=Aptana Studio 3 GenericName=Integrated Development Environment Comment=Aptana Strudio 3 Integrated Development Environment Exec=/opt/Aptana_Studio_3/AptanaStudio3 %F TryExec=/opt/Aptana_Studio_3/AptanaStudio3 Icon=aptanastudio3 StartupNotify=true StartupWMClass=\"Aptana Studio 3\" Terminal=false Type=Application MimeType=text/xml;application/xhtml+xml;application/x-javascript;application/x-php;application/x-java;text/x-javascript;text/html;text/plain Categories=GNOME;Development;IDE;" >> /tmp/SC-AptanaStudio.desktop xdg-desktop-menu install /tmp/SC-AptanaStudio.desktop echo "Aptana Studio 3 has been installed" |