annotate packaging/linux-installer.inc @ 1306:845048d4a69f

(issue159) Use user specific appdata directory for nss list with simple rights. Using the ProgramData folder with resticted access rights failed in case the process was not elevated.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 13 Oct 2014 12:31:37 +0200
parents 34c92dbfee7e
children 77c9e35657ab
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:
1189
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
3 # 1. Prüfen Sie, ob Sie dieser Datei genügend vertrauen, um ihr die
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
4 # Kontrolle über diesen Rechner zu übergeben. Beispielsweise
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
5 # durch Vergleich mit einer starken Prüfsumme aus einer zweiten,
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
6 # unabhängigen Quelle.
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
7 # 2. Öffnen Sie eine Kommandozeile (Anwendung "Terminal").
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
8 # 3. Wechseln Sie in das Verzeichnis, in dem diese Datei gespeichert
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
9 # ist (z.B. per Kommandozeile mit: "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
10 # 4. Starten Sie die Anwendung auf der Kommandozeile, beispielsweise
1189
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
11 # als Installation nur für den aktuellen Nutzer, indem Sie
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
12 # eingeben:
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
13 # bash TrustBridge-1.0.0-amd64.sh
1048
7bd1d723414d (issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents: 1040
diff changeset
14 # 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
15 #
1189
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
16 # Übrigens, wir konnten kein übliches .deb-Paket verwenden, da
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
17 # TrustBridge Ihnen auch die Installation als reiner Nutzer ohne
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
18 # Admin-Rechte ermöglichen soll.
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
19 #
1048
7bd1d723414d (issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents: 1040
diff changeset
20 #
7bd1d723414d (issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents: 1040
diff changeset
21 # To install TrustBridge:
1189
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
22 # 1. Verify that you trust this specific file far enough, that you
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
23 # are willing to hand over the control of your computer to it. For
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
24 # example compare a strong checksum of the file to one from a
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
25 # second, independent source.
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
26 # 2. Open a command line (application "Terminal").
1048
7bd1d723414d (issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents: 1040
diff changeset
27 # 3. Change your working directory to where this file is stored.
1189
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
28 # (e.g. type "cd ~/Desktop" on your command line).
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
29 # 4. Start the installation on the command line, e.g. for the current
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
30 # user only by typing something like:
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
31 # bash TrustBridge-1.0.0-amd64.sh
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
32 # Hint: If you press the tab-key after "Tr" it may complete the
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
33 # filename.
1048
7bd1d723414d (issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents: 1040
diff changeset
34 #
1189
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
35 # By the way: We could not have used a .deb package, because the
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
36 # installation must also work without without adminstrator
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
37 # priviledges.
1048
7bd1d723414d (issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents: 1040
diff changeset
38 #
7bd1d723414d (issue84) Ubuntu Installer: Add installation howto.
Bernhard Reiter <bernhard@intevation.de>
parents: 1040
diff changeset
39 #
1200
7b24109c1a55 Added linebreak in header text of linux-installer.in
Emanuel Schuetze <emanuel@intevation.de>
parents: 1194
diff changeset
40 # Copyright (C) 2014
7b24109c1a55 Added linebreak in header text of linux-installer.in
Emanuel Schuetze <emanuel@intevation.de>
parents: 1194
diff changeset
41 # by Bundesamt für Sicherheit in der Informationstechnik (BSI).
7b24109c1a55 Added linebreak in header text of linux-installer.in
Emanuel Schuetze <emanuel@intevation.de>
parents: 1194
diff changeset
42 # Software engineering by Intevation GmbH.
1165
d51ae656cfd6 Added copyright/license header [m13/issue101].
Sascha Wilde <wilde@intevation.de>
parents: 1161
diff changeset
43 #
d51ae656cfd6 Added copyright/license header [m13/issue101].
Sascha Wilde <wilde@intevation.de>
parents: 1161
diff changeset
44 # This file is Free Software under the GNU GPL (v>=2)
d51ae656cfd6 Added copyright/license header [m13/issue101].
Sascha Wilde <wilde@intevation.de>
parents: 1161
diff changeset
45 # and comes with ABSOLUTELY NO WARRANTY!
1229
6154d554b3af (issue101) Text improved, pointing to local dir and the online repo.:
Bernhard Reiter <bernhard@intevation.de>
parents: 1200
diff changeset
46 # For details and the license of TrustBridge
6154d554b3af (issue101) Text improved, pointing to local dir and the online repo.:
Bernhard Reiter <bernhard@intevation.de>
parents: 1200
diff changeset
47 # see the folder "licenses" after installation
6154d554b3af (issue101) Text improved, pointing to local dir and the online repo.:
Bernhard Reiter <bernhard@intevation.de>
parents: 1200
diff changeset
48 # check the corresponding revision of it online at
6154d554b3af (issue101) Text improved, pointing to local dir and the online repo.:
Bernhard Reiter <bernhard@intevation.de>
parents: 1200
diff changeset
49 # https://wald.intevation.org/hg/trustbridge/file/tip/licenses
1165
d51ae656cfd6 Added copyright/license header [m13/issue101].
Sascha Wilde <wilde@intevation.de>
parents: 1161
diff changeset
50
707
37899f717fa5 Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents: 705
diff changeset
51 set -u
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
52
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents: 1134
diff changeset
53 ###INCLUDE:linux-installer-common.inc
1150
a72d59f8c3ea Create uninstaller.
Sascha Wilde <wilde@intevation.de>
parents: 1140
diff changeset
54 ###INCLUDE:linux-installer.l10n-de
795
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
55
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents: 1134
diff changeset
56 ###INCLUDE:linux-installer-uninstall.inc
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
57
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
58 usage()
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
59 {
799
933860224d1e l10n for usage text.
Sascha Wilde <wilde@intevation.de>
parents: 795
diff changeset
60 getxt "Usage: %s [OPTION]...\n" "$ME"
933860224d1e l10n for usage text.
Sascha Wilde <wilde@intevation.de>
parents: 795
diff changeset
61 getxt "Install TrustBridge.\n\n"
933860224d1e l10n for usage text.
Sascha Wilde <wilde@intevation.de>
parents: 795
diff changeset
62 getxt "Options:\n"
933860224d1e l10n for usage text.
Sascha Wilde <wilde@intevation.de>
parents: 795
diff changeset
63 getxt " -p, --prefix=PATH install files in PATH\n"
933860224d1e l10n for usage text.
Sascha Wilde <wilde@intevation.de>
parents: 795
diff changeset
64 getxt " -f, --force install to given prefix, even when a current\n"
933860224d1e l10n for usage text.
Sascha Wilde <wilde@intevation.de>
parents: 795
diff changeset
65 getxt " installation with different prefix exists.\n"
1177
53a02fbe2fc9 (issue112) Rename deinstaller to uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1173
diff changeset
66 getxt " -u, --uninstall uninstall files from current installation\n"
799
933860224d1e l10n for usage text.
Sascha Wilde <wilde@intevation.de>
parents: 795
diff changeset
67 getxt " -s, --system create a system wide (de)installation\n"
933860224d1e l10n for usage text.
Sascha Wilde <wilde@intevation.de>
parents: 795
diff changeset
68 getxt " --help display this help and exit\n"
933860224d1e l10n for usage text.
Sascha Wilde <wilde@intevation.de>
parents: 795
diff changeset
69 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
70 exit $1
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
71 }
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
72
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
73 parse_args()
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
74 {
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
75 OPTS=`getopt \
1257
551b274ec4d1 Remove no longer existing option show-after-update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1251
diff changeset
76 -l uninstall,update,force,help,prefix:,system,version \
1273
5e0c338552b4 (issue150) Make -u work as an option
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1258
diff changeset
77 -o u,f,p:,s -n "$ME" -- "$@"`
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
78 [ $? -eq 0 ] || usage 23
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
79
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
80 eval set -- "$OPTS"
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
81
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
82 while true ; do
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
83 case "$1" in
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
84 --prefix|-p)
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
85 instcfg[PREFIX]="$2"
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
86 shift 2
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
87 ;;
707
37899f717fa5 Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents: 705
diff changeset
88 --system|-s)
37899f717fa5 Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents: 705
diff changeset
89 SYSINST=1
37899f717fa5 Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents: 705
diff changeset
90 shift 1
37899f717fa5 Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents: 705
diff changeset
91 ;;
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
92 --force|-f)
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
93 FORCE=1
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
94 shift 1
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
95 ;;
1177
53a02fbe2fc9 (issue112) Rename deinstaller to uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1173
diff changeset
96 --uninstall|-u)
711
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
97 DEINSTALL=1
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
98 shift 1
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
99 ;;
1066
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
100 --update)
1136
e82c440c2727 Add small comment about update option.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1134
diff changeset
101 # 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
102 # the installer to install an update.
1066
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
103 UPDATE=1
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
104 shift 1
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
105 ;;
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
106 --help)
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
107 usage 0
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
108 ;;
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
109 --version)
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
110 version
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
111 ;;
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
112 --)
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
113 shift
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
114 break
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
115 ;;
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
116 esac
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
117 done
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
118 }
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
119
1066
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
120 finished()
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
121 {
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
122 echo
1189
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
123 echo "################################################################################"
1066
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
124 if [ $SYSINST -eq 1 ]; then
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
125 getxt "System wide installation successful.\n"
1193
ec16e3d81278 Correctly print sudo or not sudo for the uninstaller runcommand
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1189
diff changeset
126 UN_RUNCMD="sudo "
1066
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
127 else
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
128 getxt "Single user installation successful.\n"
1193
ec16e3d81278 Correctly print sudo or not sudo for the uninstaller runcommand
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1189
diff changeset
129 UN_RUNCMD=""
1066
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
130 fi
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
131 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
132
1112
d619507d9e9f linux-installer: (issue109) Text slightly improved.
Bernhard Reiter <bernhard@intevation.de>
parents: 1075
diff changeset
133 getxt "To remove the application and the root certificates it has inserted,\n"
1177
53a02fbe2fc9 (issue112) Rename deinstaller to uninstaller
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1173
diff changeset
134 getxt "call the uninstall command:\n"
1193
ec16e3d81278 Correctly print sudo or not sudo for the uninstaller runcommand
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1189
diff changeset
135 echo " $UN_RUNCMD ${instcfg[PREFIX]}/bin/trustbridge-uninstall.sh"
1075
7e1fd6d96714 (issue109) Feedback improved. Shell translation updated.
Bernhard Reiter <bernhard@intevation.de>
parents: 1069
diff changeset
136
1189
969970a83b6d Updated linux installer help text and translation.
Emanuel Schuetze <emanuel@intevation.de>
parents: 1177
diff changeset
137 echo "################################################################################"
1289
34c92dbfee7e (issue44) Do not ask the user to confirm start on update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1273
diff changeset
138 if [ $UPDATE -eq 0 ]; then
34c92dbfee7e (issue44) Do not ask the user to confirm start on update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1273
diff changeset
139 if ! [ $(id -u) -eq 0 ]; then
34c92dbfee7e (issue44) Do not ask the user to confirm start on update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1273
diff changeset
140 getxt "Press enter to launch '%s'\n" "${instcfg[PREFIX]}/bin/trustbridge"
34c92dbfee7e (issue44) Do not ask the user to confirm start on update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1273
diff changeset
141 getxt "or press Control-C to quit the installer.\n"
34c92dbfee7e (issue44) Do not ask the user to confirm start on update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1273
diff changeset
142 read
34c92dbfee7e (issue44) Do not ask the user to confirm start on update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1273
diff changeset
143 "${instcfg[PREFIX]}/bin/trustbridge" &
34c92dbfee7e (issue44) Do not ask the user to confirm start on update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1273
diff changeset
144 else
34c92dbfee7e (issue44) Do not ask the user to confirm start on update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1273
diff changeset
145 getxt "You can now launch '%s'\n" "${instcfg[PREFIX]}/bin/trustbridge"
34c92dbfee7e (issue44) Do not ask the user to confirm start on update
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1273
diff changeset
146 fi
1066
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
147 fi
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
148 }
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
149
873
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
150 cleanup()
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
151 {
935
e977f7a0e8fd Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents: 916
diff changeset
152 getxt "Cleaning up temporary stuff ...\n"
1132
db43c9a62935 Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents: 1112
diff changeset
153
db43c9a62935 Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents: 1112
diff changeset
154 # remove temporary directories:
db43c9a62935 Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents: 1112
diff changeset
155 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
156 if [ "${lock_dir:-}" ]; then
1132
db43c9a62935 Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents: 1112
diff changeset
157 # $lock_dir is generate by the shar
db43c9a62935 Fixed cleanup of temporary directories.
Sascha Wilde <wilde@intevation.de>
parents: 1112
diff changeset
158 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
159 fi
1258
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
160 if [ "${TMPEXTRACT_DIR:-}" ]; then
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
161 temp_dirs+=("$TMPEXTRACT_DIR")
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
162 fi
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
163
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents: 1134
diff changeset
164 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
165 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
166 fi
1133
54a6fa9e44cf Deleted trailing white space.
Sascha Wilde <wilde@intevation.de>
parents: 1132
diff changeset
167
1139
1c9001db6ea2 Split up linux installer in to be able to create a uninstaller (TODO).
Sascha Wilde <wilde@intevation.de>
parents: 1134
diff changeset
168 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
169 [ -d "$dir" ] &&
e977f7a0e8fd Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents: 916
diff changeset
170 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
171 done
707
37899f717fa5 Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents: 705
diff changeset
172 }
37899f717fa5 Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents: 705
diff changeset
173
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
174 write_instcfg()
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
175 {
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
176 install -d `dirname "$instcfg_file"`
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
177 echo "# Created by TrustBridge-Installer, don't touch!" >"$instcfg_file"
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
178 for key in "${!instcfg[@]}" ; do
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
179 echo "${key}=${instcfg[$key]}" >>"$instcfg_file"
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
180 done
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
181 }
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
182
777
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
183 write_autostart()
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
184 {
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
185 cat > "$1" << EOF
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
186 [Desktop Entry]
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
187 Type=Application
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
188 Name=TrustBridge
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
189 Exec="${instcfg[PREFIX]}/bin/trustbridge" --tray
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
190 EOF
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
191 chown "${SUDO_USER:-${USER}}" "$1"
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
192 chmod 700 "$1"
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
193 }
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
194
872
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
195 write_startmenu()
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
196 {
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
197 cat > "$1" << EOF
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
198 [Desktop Entry]
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
199 Type=Application
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
200 Name=TrustBridge
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
201 Comment=Install and update trusted root certificates
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
202 Comment[de]=Vertrauenswürdige Wurzelzertifikate installieren und aktualisieren
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
203 Exec=${instcfg[PREFIX]}/bin/trustbridge
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
204 Icon=${instcfg[PREFIX]}/share/pixmaps/trustbridge/trustbridge.png
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
205 Terminal=false
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
206 Categories=Network;Qt;
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
207 StartupNotify=false
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
208 EOF
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
209 }
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
210
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
211 setup_startmenu()
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
212 {
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
213 # Supported desktop environments: Unity, GNOME, XFCE, LXDE, KDE
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
214 # 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
215 # respected with regards to autostart.
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
216 if [ ! -d "${startmenu_path}" ]; then
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
217 install -d "${startmenu_path}" || \
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
218 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
219 fi
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
220
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
221 write_startmenu "${startmenu_path}/trustbridge.desktop"
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
222 update-desktop-database 2>&1 || true
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
223 }
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
224
777
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
225 setup_autostart()
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
226 {
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
227 # 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
228 # 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
229 # 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
230 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
231 install -d "${autostart_path}" || \
795
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
232 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
233 fi
777
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
234
854
adf7481291a4 Fixed typo in ubuntu desktop file.
Emanuel Schuetze <emanuel@intevation.de>
parents: 799
diff changeset
235 write_autostart "${autostart_path}/trustbridge.desktop"
777
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
236 }
707
37899f717fa5 Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents: 705
diff changeset
237
873
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
238 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
239 {
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
240 # 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
241 # 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
242 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
243 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
244 else
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
245 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
246 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
247 #!/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
248 import os
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
249 import sys
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
250 import uu
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
251 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
252 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
253 try:
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
254 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
255 except OSError:
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
256 pass
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
257 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
258 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
259 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
260 else:
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
261 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
262 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
263 EOF
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
264 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
265 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
266 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
267 fi
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
268 }
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
269
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
270 #======================================================================
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
271 # main()
935
e977f7a0e8fd Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents: 916
diff changeset
272 trap cleanup EXIT
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
273
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
274 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
275 check_priv
707
37899f717fa5 Added system wide installation.
Sascha Wilde <wilde@intevation.de>
parents: 705
diff changeset
276 init_vars
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
277 read_oldinstcfg
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
278
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
279 cat <<EOF
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
280 ------------------------------------------------------------------------
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
281
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
282 TrustBridge - Installer
972
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
283 Version ${instcfg[VERSION]} - ${ARCH} (Testversion)
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
284
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
285 ------------------------------------------------------------------------
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
286 EOF
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
287
972
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
288 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
289 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
290 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
291 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
292 yorn || exit 0
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
293 fi
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
294
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
295 if [ "$ARCH" == "i386" ]; then
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
296 if [[ "$HOST_ARCH" != *86 ]]; then
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
297 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
298 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
299 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
300 yorn || exit 0
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
301 fi
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
302 fi
8be2f510adbf (issue91) Make installer architecture aware.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 938
diff changeset
303
711
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
304 if [ $DEINSTALL -eq 1 ] ; then
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
305 deinstall
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
306 # Stop after deinstallation:
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
307 exit 0
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
308 fi
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
309
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
310 if [ -z "${instcfg[PREFIX]}" ] ; then
1194
292a25c34aff (issue110) Remove installation_prefix dialog
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1193
diff changeset
311 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
312 else
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
313 # Prefix was given on invocation:
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
314 if [ "${oldinstcfg[PREFIX]}" -a \
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
315 "${instcfg[PREFIX]}" != "${oldinstcfg[PREFIX]}" -a \
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
316 $FORCE -ne 1 ] ; then
795
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
317 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
318 fi
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
319 fi
682
578860edde53 Use default path.
Sascha Wilde <wilde@intevation.de>
parents: 680
diff changeset
320
795
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
321 getxt "Installing to '%s':\n" "${instcfg[PREFIX]}"
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
322
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
323 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
324 getxt "creating installation directory ...\n"
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
325 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
326 fi
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
327
873
78096ad6f418 Provide own, python based uudecode if none is found in the system.
Sascha Wilde <wilde@intevation.de>
parents: 872
diff changeset
328 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
329 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
330
795
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
331 getxt "unpacking files ...\n"
1161
b67681a61e3e Fixed installation with relative destination path.
Sascha Wilde <wilde@intevation.de>
parents: 1152
diff changeset
332 OLDWD="$PWD"
1258
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
333
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
334 if [ $UPDATE -eq 1 ]; then
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
335 # Trustbridge might be running. Install into temporary dir
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
336 # and move the directory into the installation prefix afterwards
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
337 TMPEXTRACT_DIR=$(mktemp -d)
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
338 cd "$TMPEXTRACT_DIR"
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
339 else
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
340 cd "${instcfg[PREFIX]}"
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
341 fi
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
342
711
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 707
diff changeset
343 set +u
753
7c1f34115ede Force the shar to overwrite existing files.
Sascha Wilde <wilde@intevation.de>
parents: 752
diff changeset
344 set -- '-c'
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
345 # ----------------------------------------------------------------------
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
346 # regular shar archive inserted here:
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
347 ###SHAR###
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
348 # ----------------------------------------------------------------------
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
349
1258
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
350 if [ $UPDATE -eq 1 ]; then
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
351 cp -fr "$TMPEXTRACT_DIR/bin" "${instcfg[PREFIX]}"
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
352 cp -fr "$TMPEXTRACT_DIR/share" "${instcfg[PREFIX]}"
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
353 fi
469c1a04b678 (issue54) On update copy and remove the updated files instead of extracting
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1257
diff changeset
354
1161
b67681a61e3e Fixed installation with relative destination path.
Sascha Wilde <wilde@intevation.de>
parents: 1152
diff changeset
355 cd "$OLDWD"
b67681a61e3e Fixed installation with relative destination path.
Sascha Wilde <wilde@intevation.de>
parents: 1152
diff changeset
356
795
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
357 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
358 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
359 "${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
360
795
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
361 getxt "Setting up cronjob ...\n"
749
778382342802 Added installation of cron job.
Sascha Wilde <wilde@intevation.de>
parents: 738
diff changeset
362 setup_cronjob
778382342802 Added installation of cron job.
Sascha Wilde <wilde@intevation.de>
parents: 738
diff changeset
363
795
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
364 getxt "Setting up autostart ...\n"
777
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
365 setup_autostart
ca149bad8195 (issue51) Set up autostart on installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 776
diff changeset
366
872
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
367 getxt "Setting up start menu entries ...\n"
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
368 setup_startmenu
02e357826417 (issue81) Add desktop file
Andre Heinecke <andre.heinecke@intevation.de>
parents: 863
diff changeset
369
795
3a9b0c75f5a6 Added i18n code and german l10n to linux installer.
Sascha Wilde <wilde@intevation.de>
parents: 785
diff changeset
370 getxt "Writing installation configuration to: %s ...\n" "$instcfg_file"
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
371 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
372
1066
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
373 finished
febd195c0301 (issue109) Add summary after installation.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1049
diff changeset
374
935
e977f7a0e8fd Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents: 916
diff changeset
375 # cleanup
e977f7a0e8fd Cleanup temporary stuff (like shar lockdir) always (even when interrupted) on exit.
Sascha Wilde <wilde@intevation.de>
parents: 916
diff changeset
376 # is called implicitly at exit via trap...
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
377 exit 0

http://wald.intevation.org/projects/trustbridge/