Mercurial > trustbridge
annotate packaging/linux-installer.inc @ 1141:05d4e882fe18
Merged
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Wed, 17 Sep 2014 18:56:29 +0200 |
parents | packaging/linux-installer.inc.in@1110d0017bad packaging/linux-installer.inc.in@f67a6873d9c1 |
children | 22b3daa4e464 |
rev | line source |
---|---|
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
1 #!/bin/bash |
1048
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
2 # Um TrustBridge zu installieren: |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
3 # 1. Prüfen Sie ob Sie dieser Datei genügend vertrauen, um ihr die Kontrolle |
1133
54a6fa9e44cf
Deleted trailing white space.
Sascha Wilde <wilde@intevation.de>
parents:
1132
diff
changeset
|
4 # über diesen Rechner zu übergeben. Beispielsweise durch Vergleich mit |
1048
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
5 # einer starken Prüfsumme aus einer zweiten, unabhängigen Quelle. |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
6 # 2. Öffnen Sie eine Kommandozeile, z.B. klicken Sie auf das "Terminal"-Symbol. |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
7 # 3. Wechseln Sie in das Verzeichnis, in welchem diese Datei gespeichert ist. |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
8 # Geben Sie Z.B. in die Kommandozeile ein: cd ~/Schreibtisch |
1049
52c68a773194
Ubuntu Installer, short instruction with explicit mention that this example is for one user only.
Bernhard Reiter <bernhard@intevation.de>
parents:
1048
diff
changeset
|
9 # 4. Starten Sie die Anwendung auf der Kommandozeile, beispielsweise |
52c68a773194
Ubuntu Installer, short instruction with explicit mention that this example is for one user only.
Bernhard Reiter <bernhard@intevation.de>
parents:
1048
diff
changeset
|
10 # als Installation nur für den aktuellen Nutzer, indem Sie eingeben: |
52c68a773194
Ubuntu Installer, short instruction with explicit mention that this example is for one user only.
Bernhard Reiter <bernhard@intevation.de>
parents:
1048
diff
changeset
|
11 # bash TrustBridge-1.0.0-i386.sh |
1048
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
12 # Tipp: Die Tab-Taste nach dem "Tr" ergänzt oft den ganzen Namen. |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
13 # |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
14 # NB: Wir konnten kein übliches .deb Paket verwenden, da wir Ihnen |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
15 # auch die Installation als reiner Nutzer ohne Admin-Rechte ermöglichen. |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
16 # |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
17 # To install TrustBridge: |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
18 # 1. Verify that you trust this specific file far enough, that you are willing |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
19 # to hand over the control of your computer to it. For example compare |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
20 # a strong checksum of the file to one from a second, independent source. |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
21 # 2. Open a command line, e.g. click on the "Terminal"-Symbol. |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
22 # 3. Change your working directory to where this file is stored. |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
23 # For example type "cd ~/Desktop" on your command line. |
1049
52c68a773194
Ubuntu Installer, short instruction with explicit mention that this example is for one user only.
Bernhard Reiter <bernhard@intevation.de>
parents:
1048
diff
changeset
|
24 # 4. Start the installation on the command line, e.g. for the current user |
1133
54a6fa9e44cf
Deleted trailing white space.
Sascha Wilde <wilde@intevation.de>
parents:
1132
diff
changeset
|
25 # only by typing something like "bash TrustBridge-1.0.0-i386.sh". |
1049
52c68a773194
Ubuntu Installer, short instruction with explicit mention that this example is for one user only.
Bernhard Reiter <bernhard@intevation.de>
parents:
1048
diff
changeset
|
26 # Hint: If you press the tab-key after "Tr" it may complete the filename. |
1048
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
27 # |
1133
54a6fa9e44cf
Deleted trailing white space.
Sascha Wilde <wilde@intevation.de>
parents:
1132
diff
changeset
|
28 # N.B. We could not have used a .deb package, because the installation must |
1048
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
29 # also work without without adminstrator priviledges. |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
30 # |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
31 # |
7bd1d723414d
(issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents:
1040
diff
changeset
|
32 # Search the file for 'version()' to find the license information. |
707
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
33 set -u |
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
34 |
1139
1c9001db6ea2
Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
1134
diff
changeset
|
35 ###INCLUDE:linux-installer-common.inc |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
36 |
1139
1c9001db6ea2
Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
1134
diff
changeset
|
37 ###INCLUDE:linux-installer-uninstall.inc |
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
38 |
698
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
39 usage() |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
40 { |
799 | 41 getxt "Usage: %s [OPTION]...\n" "$ME" |
42 getxt "Install TrustBridge.\n\n" | |
43 getxt "Options:\n" | |
44 getxt " -p, --prefix=PATH install files in PATH\n" | |
45 getxt " -f, --force install to given prefix, even when a current\n" | |
46 getxt " installation with different prefix exists.\n" | |
47 getxt " -d, --deinstall deinstall files from current installation\n" | |
48 getxt " -s, --system create a system wide (de)installation\n" | |
49 getxt " --help display this help and exit\n" | |
50 getxt " --version output version information and exit\n" | |
698
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
51 exit $1 |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
52 } |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
53 |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
54 parse_args() |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
55 { |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
56 OPTS=`getopt \ |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
57 -l deinstall,update,show-after-update,force,help,prefix:,system,version \ |
711
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
58 -o d,f,p:,s -n "$ME" -- "$@"` |
698
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
59 [ $? -eq 0 ] || usage 23 |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
60 |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
61 eval set -- "$OPTS" |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
62 |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
63 while true ; do |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
64 case "$1" in |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
65 --prefix|-p) |
700
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
66 instcfg[PREFIX]="$2" |
698
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
67 shift 2 |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
68 ;; |
707
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
69 --system|-s) |
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
70 SYSINST=1 |
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
71 shift 1 |
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
72 ;; |
705
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
73 --force|-f) |
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
74 FORCE=1 |
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
75 shift 1 |
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
76 ;; |
711
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
77 --deinstall|-d) |
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
78 DEINSTALL=1 |
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
79 shift 1 |
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
80 ;; |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
81 --update) |
1136
e82c440c2727
Add small comment about update option.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1134
diff
changeset
|
82 # Update is an internal option that is used when the application calls |
e82c440c2727
Add small comment about update option.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1134
diff
changeset
|
83 # the installer to install an update. |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
84 UPDATE=1 |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
85 shift 1 |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
86 ;; |
698
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
87 --help) |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
88 usage 0 |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
89 ;; |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
90 --version) |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
91 version |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
92 ;; |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
93 --) |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
94 shift |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
95 break |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
96 ;; |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
97 esac |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
98 done |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
99 } |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
100 |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
101 finished() |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
102 { |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
103 echo |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
104 echo "#################################################################################" |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
105 if [ $SYSINST -eq 1 ]; then |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
106 getxt "System wide installation successful.\n" |
1075
7e1fd6d96714
(issue109) Feedback improved. Shell translation updated.
Bernhard Reiter <bernhard@intevation.de>
parents:
1069
diff
changeset
|
107 RUNCMD="su -l $SUDO_USER -c " |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
108 else |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
109 getxt "Single user installation successful.\n" |
1075
7e1fd6d96714
(issue109) Feedback improved. Shell translation updated.
Bernhard Reiter <bernhard@intevation.de>
parents:
1069
diff
changeset
|
110 RUNCMD="" |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
111 fi |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
112 getxt "TrustBridge has been installed to: '%s'\n\n" "${instcfg[PREFIX]}" |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
113 |
1112
d619507d9e9f
linux-installer: (issue109) Text slightly improved.
Bernhard Reiter <bernhard@intevation.de>
parents:
1075
diff
changeset
|
114 getxt "To remove the application and the root certificates it has inserted,\n" |
d619507d9e9f
linux-installer: (issue109) Text slightly improved.
Bernhard Reiter <bernhard@intevation.de>
parents:
1075
diff
changeset
|
115 getxt "call the deinstall command:\n" |
1075
7e1fd6d96714
(issue109) Feedback improved. Shell translation updated.
Bernhard Reiter <bernhard@intevation.de>
parents:
1069
diff
changeset
|
116 echo " $RUNCMD ${instcfg[PREFIX]}/bin/trustbridge-deinstall-TODO.sh" |
7e1fd6d96714
(issue109) Feedback improved. Shell translation updated.
Bernhard Reiter <bernhard@intevation.de>
parents:
1069
diff
changeset
|
117 |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
118 echo "#################################################################################" |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
119 getxt "Press enter to launch '%s'\n" "${instcfg[PREFIX]}/bin/trustbridge" |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
120 if [ $UPDATE -eq 0 ]; then |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
121 read |
1068
4e93a87d89eb
(issue54) use su to launch application as user after system wide installation
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1066
diff
changeset
|
122 $RUNCMD "${instcfg[PREFIX]}/bin/trustbridge" & |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
123 else |
1123
425a9a861d17
(issue54) Remove showafterupdate option from linux installer
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1112
diff
changeset
|
124 $RUNCMD "${instcfg[PREFIX]}/bin/trustbridge" --tray & |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
125 fi |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
126 } |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
127 |
873
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
128 cleanup() |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
129 { |
935
e977f7a0e8fd
Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents:
916
diff
changeset
|
130 getxt "Cleaning up temporary stuff ...\n" |
1132
db43c9a62935
Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents:
1112
diff
changeset
|
131 |
db43c9a62935
Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents:
1112
diff
changeset
|
132 # remove temporary directories: |
db43c9a62935
Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents:
1112
diff
changeset
|
133 local -a temp_dirs |
1139
1c9001db6ea2
Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
1134
diff
changeset
|
134 if [ "${lock_dir:-}" ]; then |
1132
db43c9a62935
Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents:
1112
diff
changeset
|
135 # $lock_dir is generate by the shar |
db43c9a62935
Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents:
1112
diff
changeset
|
136 temp_dirs+=("${instcfg[PREFIX]}/$lock_dir") |
937
f6b52f60f643
Check if lock_dir is set before using it in an rm -rf
Andre Heinecke <andre.heinecke@intevation.de>
parents:
935
diff
changeset
|
137 fi |
1139
1c9001db6ea2
Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
1134
diff
changeset
|
138 if [ "${lock_dir:-}" ]; then |
1c9001db6ea2
Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
1134
diff
changeset
|
139 temp_dirs+=("$extra_bin_path") |
1c9001db6ea2
Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
1134
diff
changeset
|
140 fi |
1133
54a6fa9e44cf
Deleted trailing white space.
Sascha Wilde <wilde@intevation.de>
parents:
1132
diff
changeset
|
141 |
1139
1c9001db6ea2
Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents:
1134
diff
changeset
|
142 for dir in "${temp_dirs[@]-}" ; do |
935
e977f7a0e8fd
Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents:
916
diff
changeset
|
143 [ -d "$dir" ] && |
e977f7a0e8fd
Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents:
916
diff
changeset
|
144 rm -rf "$dir" |
e977f7a0e8fd
Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents:
916
diff
changeset
|
145 done |
707
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
146 } |
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
147 |
700
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
148 write_instcfg() |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
149 { |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
150 install -d `dirname "$instcfg_file"` |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
151 echo "# Created by TrustBridge-Installer, don't touch!" >"$instcfg_file" |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
152 for key in "${!instcfg[@]}" ; do |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
153 echo "${key}=${instcfg[$key]}" >>"$instcfg_file" |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
154 done |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
155 } |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
156 |
777
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
157 write_autostart() |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
158 { |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
159 cat > "$1" << EOF |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
160 [Desktop Entry] |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
161 Type=Application |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
162 Name=TrustBridge |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
163 Exec="${instcfg[PREFIX]}/bin/trustbridge" --tray |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
164 EOF |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
165 chown "${SUDO_USER:-${USER}}" "$1" |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
166 chmod 700 "$1" |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
167 } |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
168 |
872
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
169 write_startmenu() |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
170 { |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
171 cat > "$1" << EOF |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
172 [Desktop Entry] |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
173 Type=Application |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
174 Name=TrustBridge |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
175 Comment=Install and update trusted root certificates |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
176 Comment[de]=Vertrauenswürdige Wurzelzertifikate installieren und aktualisieren |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
177 Exec=${instcfg[PREFIX]}/bin/trustbridge |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
178 Icon=${instcfg[PREFIX]}/share/pixmaps/trustbridge/trustbridge.png |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
179 Terminal=false |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
180 Categories=Network;Qt; |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
181 StartupNotify=false |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
182 EOF |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
183 } |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
184 |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
185 setup_startmenu() |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
186 { |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
187 # Supported desktop environments: Unity, GNOME, XFCE, LXDE, KDE |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
188 # System wide installation with a nonstandard XDG_DATA_HOME is not |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
189 # respected with regards to autostart. |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
190 if [ ! -d "${startmenu_path}" ]; then |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
191 install -d "${startmenu_path}" || \ |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
192 fatal "Failed to create startmenu directory: '%s'\n" "$startmenu_path" |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
193 fi |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
194 |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
195 write_startmenu "${startmenu_path}/trustbridge.desktop" |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
196 update-desktop-database 2>&1 || true |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
197 } |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
198 |
777
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
199 setup_autostart() |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
200 { |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
201 # Supported desktop environments: Unity, GNOME, XFCE, LXDE, KDE |
785
2fb539d4b1ff
Simply autostart creation by initializing the path in init_vars
Andre Heinecke <andre.heinecke@intevation.de>
parents:
777
diff
changeset
|
202 # System wide installation with a nonstandard XDG_CONFIG_HOME or KDEHOME is not |
2fb539d4b1ff
Simply autostart creation by initializing the path in init_vars
Andre Heinecke <andre.heinecke@intevation.de>
parents:
777
diff
changeset
|
203 # respected with regards to autostart. |
2fb539d4b1ff
Simply autostart creation by initializing the path in init_vars
Andre Heinecke <andre.heinecke@intevation.de>
parents:
777
diff
changeset
|
204 if [ ! -d "${autostart_path}" ]; then |
2fb539d4b1ff
Simply autostart creation by initializing the path in init_vars
Andre Heinecke <andre.heinecke@intevation.de>
parents:
777
diff
changeset
|
205 install -d "${autostart_path}" || \ |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
206 fatal "Failed to create autostart directory: '%s'\n" "$autostart_path" |
785
2fb539d4b1ff
Simply autostart creation by initializing the path in init_vars
Andre Heinecke <andre.heinecke@intevation.de>
parents:
777
diff
changeset
|
207 fi |
777
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
208 |
854
adf7481291a4
Fixed typo in ubuntu desktop file.
Emanuel Schuetze <emanuel@intevation.de>
parents:
799
diff
changeset
|
209 write_autostart "${autostart_path}/trustbridge.desktop" |
777
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
210 } |
707
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
211 |
873
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
212 provide_uudecode_maybe() |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
213 { |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
214 # The shar needs uudecode, which might not be installed. If its not |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
215 # available we will provide our own python based implementation. |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
216 if which uudecode >/dev/null 2>&1 ; then |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
217 getxt "Found system uudecode.\n" |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
218 else |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
219 local myuudecode="$extra_bin_path/uudecode" |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
220 cat >"$myuudecode" <<EOF |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
221 #!/usr/bin/python2 |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
222 import os |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
223 import sys |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
224 import uu |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
225 os.path.chmod = os.chmod |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
226 def rm_if_exists(file): |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
227 try: |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
228 os.remove(file) |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
229 except OSError: |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
230 pass |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
231 os.path.exists = rm_if_exists |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
232 if len(sys.argv) > 1: |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
233 f = open(sys.argv[1], 'r') |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
234 else: |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
235 f = sys.stdin |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
236 uu.decode(f, None, None, 1) |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
237 EOF |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
238 chmod 755 "$myuudecode" |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
239 PATH="${extra_bin_path}:$PATH" |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
240 getxt "Using python uudecode provided by installer.\n" |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
241 fi |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
242 } |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
243 |
698
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
244 #====================================================================== |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
245 # main() |
935
e977f7a0e8fd
Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents:
916
diff
changeset
|
246 trap cleanup EXIT |
698
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
247 |
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
248 parse_args "$@" |
1040
43734932e2ea
(issue100) Fall back to system wide deinstallation when no local installation is found
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1038
diff
changeset
|
249 check_priv |
707
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
250 init_vars |
705
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
251 read_oldinstcfg |
698
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
252 |
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
253 cat <<EOF |
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
254 ------------------------------------------------------------------------ |
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
255 |
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
256 TrustBridge - Installer |
972
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
257 Version ${instcfg[VERSION]} - ${ARCH} (Testversion) |
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
258 |
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
259 ------------------------------------------------------------------------ |
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
260 EOF |
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
261 |
972
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
262 if [ "$ARCH" == "x86_64" -a "$ARCH" != "$HOST_ARCH" ]; then |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
263 getxt "It appears your system architecture is %s.\n" "$HOST_ARCH" |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
264 getxt "This installer is for 64 bit systems.\n" |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
265 getxt "Really install TrustBridge for '%s' systems? [y/n]\n" "${ARCH}" |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
266 yorn || exit 0 |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
267 fi |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
268 |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
269 if [ "$ARCH" == "i386" ]; then |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
270 if [[ "$HOST_ARCH" != *86 ]]; then |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
271 getxt "It appears your system architecture is %s.\n" "$HOST_ARCH" |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
272 getxt "This installer is for 32 bit systems.\n" |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
273 getxt "Really install TrustBridge for '%s' systems? [y/n]\n" "${ARCH}" |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
274 yorn || exit 0 |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
275 fi |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
276 fi |
8be2f510adbf
(issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
938
diff
changeset
|
277 |
711
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
278 if [ $DEINSTALL -eq 1 ] ; then |
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
279 deinstall |
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
280 # Stop after deinstallation: |
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
281 exit 0 |
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
282 fi |
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
283 |
700
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
284 if [ -z "${instcfg[PREFIX]}" ] ; then |
705
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
285 |
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
286 if [ "${oldinstcfg[PREFIX]}" ] ; then |
707
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
287 inst_default_prefix="${oldinstcfg[PREFIX]}" |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
288 getxt "An existing installation (v%s) was detected!\n" "${oldinstcfg[VERSION]}" |
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
289 getxt "It is HIGHLY RECOMMENDED to accept the default prefix\n" |
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
290 getxt "to update the current installation.\n" |
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
291 getxt "For a new prefix you should deinstall first!\n" |
705
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
292 fi |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
293 getxt "Select installation prefix for TrustBridge [%s]: " "${inst_default_prefix}" |
700
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
294 read -e instcfg[PREFIX] |
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
295 |
707
37899f717fa5
Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents:
705
diff
changeset
|
296 [ -z "${instcfg[PREFIX]}" ] && instcfg[PREFIX]="${inst_default_prefix}" |
705
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
297 else |
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
298 # Prefix was given on invocation: |
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
299 if [ "${oldinstcfg[PREFIX]}" -a \ |
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
300 "${instcfg[PREFIX]}" != "${oldinstcfg[PREFIX]}" -a \ |
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
301 $FORCE -ne 1 ] ; then |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
302 fatal "Prefix differs from current installation (%s). Aborting!\n" "${oldinstcfg[PREFIX]}" |
705
ff2efc1cb8fa
Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents:
704
diff
changeset
|
303 fi |
698
b55d49150e36
Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents:
682
diff
changeset
|
304 fi |
682 | 305 |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
306 getxt "Installing to '%s':\n" "${instcfg[PREFIX]}" |
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
307 |
700
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
308 if [ ! -d "${instcfg[PREFIX]}" ] ; then |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
309 getxt "creating installation directory ...\n" |
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
310 install -d "${instcfg[PREFIX]}" || fatal "Could not create '%s'!\n" "${instcfg[PREFIX]}" |
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
311 fi |
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
312 |
873
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
313 getxt "checking for uudecode ...\n" |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
314 provide_uudecode_maybe |
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
315 |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
316 getxt "unpacking files ...\n" |
700
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
317 cd "${instcfg[PREFIX]}" |
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
318 |
711
acbe75423283
Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents:
707
diff
changeset
|
319 set +u |
753
7c1f34115ede
Force the shar to overwrite existing files.
Sascha Wilde <wilde@intevation.de>
parents:
752
diff
changeset
|
320 set -- '-c' |
680
a5a709c6ce93
Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
321 # ---------------------------------------------------------------------- |
700
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
322 # regular shar archive inserted here: |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
323 ###SHAR### |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
324 # ---------------------------------------------------------------------- |
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
325 |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
326 getxt "Preparing trustbridge-tray-starter ...\n" |
738
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
730
diff
changeset
|
327 sed -i "/^PREFIX=/c\PREFIX='${instcfg[PREFIX]}'" \ |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
730
diff
changeset
|
328 "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
730
diff
changeset
|
329 |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
330 getxt "Setting up cronjob ...\n" |
749
778382342802
Added installation of cron job.
Sascha Wilde <wilde@intevation.de>
parents:
738
diff
changeset
|
331 setup_cronjob |
778382342802
Added installation of cron job.
Sascha Wilde <wilde@intevation.de>
parents:
738
diff
changeset
|
332 |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
333 getxt "Setting up autostart ...\n" |
777
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
334 setup_autostart |
ca149bad8195
(issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
776
diff
changeset
|
335 |
872
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
336 getxt "Setting up start menu entries ...\n" |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
337 setup_startmenu |
02e357826417
(issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents:
863
diff
changeset
|
338 |
795
3a9b0c75f5a6
Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents:
785
diff
changeset
|
339 getxt "Writing installation configuration to: %s ...\n" "$instcfg_file" |
700
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
340 write_instcfg |
873
78096ad6f418
Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents:
872
diff
changeset
|
341 |
1066
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
342 finished |
febd195c0301
(issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1049
diff
changeset
|
343 |
935
e977f7a0e8fd
Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents:
916
diff
changeset
|
344 # cleanup |
e977f7a0e8fd
Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents:
916
diff
changeset
|
345 # is called implicitly at exit via trap... |
700
bf87feccb26c
Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents:
698
diff
changeset
|
346 exit 0 |