source: zero-lliurex-arasuite/trunk/fuentes/zero-lliurex-arasuite.zmd @ 817

Last change on this file since 817 was 817, checked in by joamuran, 4 years ago

Using zero-lliurex-wget instead of zero-lliurex-axel

File size: 7.2 KB
Line 
1#!/bin/bash
2
3export TEXTDOMAIN="zero-lliurex-arasuite"
4
5MSG_BAJAR=$(gettext "AraSuite will now be downloaded (Aprox. Size 30MB) and installed (Aprox. Size 120MB)")
6MSG_NO_INTERNET=$(gettext "No Internet Connection has been detected. Please, check it")
7MSG_MINUTOS=$(gettext "This operation can take a few minutes. Please wait")
8MSG_BAJANDO_FICHEROS=$(gettext "Necessary files are being downloaded")
9MSG_GENERANDO_PAQUETE=$(gettext "AraSuite package is being built up")
10MSG_COPIAR=$(gettext "Would you like to save a copy of *.sh for a future installation")
11MSG_GUARDAR=$(gettext "Choose a directory for saving the file copy")
12MSG_INSTALAR=$(gettext "Would you like to install AraSuite?")
13MSG_INSTALL_COMPLETA=$(gettext "Installation has been completed. You can access AraSuite throught Applications.")
14MSG_DESCARGA_COMPLETA=$(gettext "AraSuite has been successfully downloaded in /tmp, but not installed")
15MSG_ASK_DIR=$(gettext "In which folder has been installed AraSuite? \n(Ask Cancel if you don't want to create Menu Entries)")
16MSG_ASK_DIR_TITLE=$(gettext "Creating Menu Entries")
17MSG_NOT_ACCESIBLE=$(gettext "file isn\'t accesible at the moment, because you cancel the download or other reasons. You can retry to install it again or report your problem to Lliurex Team in http://mestreacasa.gva.es/web/lliurex/forums")
18
19current_version="arasuite_unix_2_2.sh"
20url="http://sourceforge.net/projects/arasuite/files/"
21temp="/tmp/arasuite"
22
23# Funcions per a crear els desktops
24
25function CreateTicoDesktop {
26    echo "[Desktop Entry]" > /usr/share/applications/tico.desktop
27    echo "Version=1.0" >> /usr/share/applications/tico.desktop
28    echo "Encoding=UTF-8" >> /usr/share/applications/tico.desktop
29    echo "Name=Tico" >> /usr/share/applications/tico.desktop
30    echo "Comment=Interactive Grid Editor" >> /usr/share/applications/tico.desktop
31    echo "Comment[es]=Editor de tableros interactivos" >> /usr/share/applications/tico.desktop
32    echo "Comment[qcv]=Editor de taulers interactius" >> /usr/share/applications/tico.desktop
33    echo "Comment[ca]=Editor de taulers interactius" >> /usr/share/applications/tico.desktop
34    echo "Path=$1/TICO" >> /usr/share/applications/tico.desktop
35    echo "TryExec=$1/TICO/TICOApp" >> /usr/share/applications/tico.desktop
36    echo "Exec=$1/TICO/TICOApp" >> /usr/share/applications/tico.desktop
37    echo "Terminal=false" >> /usr/share/applications/tico.desktop
38    echo "Icon=tico" >> /usr/share/applications/tico.desktop
39    echo "Type=Application" >> /usr/share/applications/tico.desktop
40    echo "GenericName=Tico" >> /usr/share/applications/tico.desktop
41    echo "Categories=Education;" >> /usr/share/applications/tico.desktop
42}
43
44function CreateAraWordDesktop {
45    echo "[Desktop Entry]" > /usr/share/applications/araword.desktop
46    echo "Version=1.0" >> /usr/share/applications/araword.desktop
47    echo "Encoding=UTF-8" >> /usr/share/applications/araword.desktop
48    echo "Name=AraWord" >> /usr/share/applications/araword.desktop
49    echo "Comment=Pictogram Text Editor" >> /usr/share/applications/araword.desktop
50    echo "Comment[es]=Editor de textos con pictogramas" >> /usr/share/applications/araword.desktop
51    echo "Comment[qcv]=Editor de textos amb pictogrames" >> /usr/share/applications/araword.desktop
52    echo "Comment[ca]=Editor de textos amb pictogrames" >> /usr/share/applications/araword.desktop
53    echo "Path=$1/AraWord" >> /usr/share/applications/araword.desktop
54    echo "TryExec=$1/AraWord/AraWordApp" >> /usr/share/applications/araword.desktop
55    echo "Exec=$1/AraWord/AraWordApp" >> /usr/share/applications/araword.desktop
56    echo "Terminal=false" >> /usr/share/applications/araword.desktop
57    echo "Icon=araword" >> /usr/share/applications/araword.desktop
58    echo "Type=Application" >> /usr/share/applications/araword.desktop
59    echo "GenericName=AraWord" >> /usr/share/applications/araword.desktop
60    echo "Categories=Education;" >> /usr/share/applications/araword.desktop
61
62}
63
64function CreateGalleryManagerDesktop {
65    echo "[Desktop Entry]" > /usr/share/applications/gallerymanager.desktop
66    echo "Version=1.0" >> /usr/share/applications/gallerymanager.desktop
67    echo "Encoding=UTF-8" >> /usr/share/applications/gallerymanager.desktop
68    echo "Name=GalleryManager" >> /usr/share/applications/gallerymanager.desktop
69    echo "Comment=Pictogram Gallery Manager" >> /usr/share/applications/gallerymanager.desktop
70    echo "Comment[es]=Admiministra la galeria de pictogramas" >> /usr/share/applications/gallerymanager.desktop
71    echo "Comment[qcv]=Administra la galeria de pictogrames" >> /usr/share/applications/gallerymanager.desktop
72    echo "Comment[ca]=Administra la galeriad de pictogrames" >> /usr/share/applications/gallerymanager.desktop
73    echo "Path=$1/GalleryManager" >> /usr/share/applications/gallerymanager.desktop
74    echo "TryExec=$1/GalleryManager/GalleryManagerApp" >> /usr/share/applications/gallerymanager.desktop
75    echo "Exec=$1/GalleryManager/GalleryManagerApp" >> /usr/share/applications/gallerymanager.desktop
76    echo "Terminal=false" >> /usr/share/applications/gallerymanager.desktop
77    echo "Icon=arasuite" >> /usr/share/applications/gallerymanager.desktop
78    echo "Type=Application" >> /usr/share/applications/gallerymanager.desktop
79    echo "GenericName=GalleryManager" >> /usr/share/applications/gallerymanager.desktop
80    echo "Categories=Education;" >> /usr/share/applications/gallerymanager.desktop
81
82}
83
84
85
86
87
88
89#COMPROBAMOS CONEXION A INTERNET
90zero-center add-pulsating-color zero-lliurex-arasuite
91rc=0
92zero-testnet || rc=1
93$(rm -R "$temp") || echo "Starting Arasuite script for donwload and install it.........."
94if [ $rc -eq 0 ]
95        then
96                #zenity --info --timeout 3 --text="$MSG_BAJAR" > /dev/null 2>&1 &
97                #axel -o $temp $url$current_version/download
98                zero-lliurex-wget $url$current_version $temp
99                #COMPRUEBO QUE EL FICHERO FUE DESCARGADO, ABORTANDO LA INSTALACION EN CASO CONTRARIO
100                if [ ! -f $temp/$current_version ] ; then
101                        zenity --info --text="$current_version $MSG_NOT_ACCESIBLE" > /dev/null 2>&1 &
102                        zero-center remove-pulsating-color zero-lliurex-arasuite
103                        exit 1
104                fi
105                                       
106               
107        else
108                zenity --error --text="$MSG_NO_INTERNET"> /dev/null 2>&1 &
109                zero-center remove-pulsating-color zero-lliurex-arasuite
110                exit 1
111fi
112
113#DESCARGAMOS FICHERO sh (.sh)
114flag=0
115
116lliurex-version | grep server
117if [ $? -eq 0 ]; then
118        flag=1
119else
120        host proxy
121        if [ $? -ne 0 ]; then
122                flag=1
123        fi
124fi
125if [ $flag -eq 0 ]; then
126         export http_proxy="proxy:3128"
127fi
128
129
130## PREGUNTAR SI LO QUIERE GUARDAR
131#if zenity --question --text="$MSG_COPIAR"; then
132#       RUTA=$(zenity --file-selection --directory  --text="$MSG_GUARDAR" )
133#       cp $temp $RUTA
134#fi
135
136# PREGUNTAR SI LO QUIERE INSTALAR
137if zenity --question --text="$MSG_INSTALAR" > /dev/null 2>&1; then
138        chmod +x $temp/$current_version
139        eval $temp/$current_version
140
141        base_dir=`zenity --entry --entry-text '/opt/AraSuite' --text "${MSG_ASK_DIR}" --title "${MSG_ASK_DIR_TITLE}"`
142
143        if [ $? -eq 0 ]; then
144                CreateTicoDesktop ${base_dir}
145                CreateAraWordDesktop ${base_dir}
146                CreateGalleryManagerDesktop ${base_dir}
147        fi
148
149        zenity --info --text="$MSG_INSTALL_COMPLETA" > /dev/null 2>&1 &
150        rm -R $temp
151else
152        zenity --info --text="$MSG_DESCARGA_COMPLETA" > /dev/null 2>&1 &
153fi
154
155##LIMPIA Y DA ESPLENDOR
156##rm -f $temp
157zero-center remove-pulsating-color zero-lliurex-arasuite
158zero-center set-configured zero-lliurex-arasuite
159exit 0
Note: See TracBrowser for help on using the repository browser.