diff packaging/linux-installer.inc.in @ 1066:febd195c0301

(issue109) Add summary after installation.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 10 Sep 2014 15:54:51 +0200
parents 52c68a773194
children 4e93a87d89eb
line wrap: on
line diff
--- a/packaging/linux-installer.inc.in	Wed Sep 10 11:52:55 2014 +0200
+++ b/packaging/linux-installer.inc.in	Wed Sep 10 15:54:51 2014 +0200
@@ -45,6 +45,8 @@
 FORCE=0
 SYSINST=0
 DEINSTALL=0
+UPDATE=0
+SHOWAFTERUPDATE=0
 BINNAMES="###BINNAMES###"
 ICONNAME="###ICONNAME###"
 HELPNAMES="###HELPNAMES###"
@@ -154,7 +156,7 @@
 parse_args()
 {
   OPTS=`getopt \
-      -l deinstall,force,help,prefix:,system,version \
+      -l deinstall,update,show-after-update,force,help,prefix:,system,version \
       -o d,f,p:,s -n "$ME" -- "$@"`
   [ $? -eq 0 ] || usage 23
 
@@ -178,6 +180,14 @@
         DEINSTALL=1
         shift 1
         ;;
+      --update)
+        UPDATE=1
+        shift 1
+        ;;
+      --show-after-update)
+        SHOWAFTERUPDATE=1
+        shift 1
+        ;;
       --help)
         usage 0
         ;;
@@ -194,6 +204,11 @@
 
 init_vars()
 {
+  if [ -n "${SUDO_USER-}" ] ; then
+    # Default to system wide installation when running with sudo
+    SYSINST=1
+  fi
+
   if [ $SYSINST -eq 1 ] ; then
       inst_default_prefix="$SYSDEFAULT_PREFIX"
       instcfg_path="${SYSCFGPATH}"
@@ -222,6 +237,44 @@
   HOST_ARCH=$(uname -m)
 }
 
+finished()
+{
+  echo
+  echo "#################################################################################"
+  if [ $SYSINST -eq 1 ]; then
+    getxt "System wide installation successful.\n"
+  else
+    getxt "Single user installation successful.\n"
+  fi
+  getxt "TrustBridge has been installed to: '%s'\n\n" "${instcfg[PREFIX]}"
+
+  if [ $SYSINST -eq 1 ]; then
+    getxt "If you do not want to change the certificates of other users\n"
+    getxt "uninstall it with:\n"
+    echo "      'sudo $0 -d'"
+    getxt "And install it again without sudo:\n"
+    echo "       $0"
+  else
+    getxt "If you want to change the certificates of all users\n"
+    getxt "uninstall it with:\n"
+    echo "      '$0 -d'"
+    getxt "And install it again using sudo:\n"
+    echo "       sudo $0"
+  fi
+  echo "#################################################################################"
+  getxt "Press enter to launch '%s'\n" "${instcfg[PREFIX]}/bin/trustbridge"
+  if [ $UPDATE -eq 0 ]; then
+    read
+    "${instcfg[PREFIX]}/bin/trustbridge" &
+  else
+    if [ $SHOWAFTERUPDATE -eq 0 ]; then
+      "${instcfg[PREFIX]}/bin/trustbridge" --tray &
+    else
+      "${instcfg[PREFIX]}/bin/trustbridge" &
+    fi
+  fi
+}
+
 cleanup()
 {
   getxt "Cleaning up temporary stuff ...\n"
@@ -629,6 +682,8 @@
 getxt "Writing installation configuration to: %s ...\n" "$instcfg_file"
 write_instcfg
 
+finished
+
 # cleanup
 # is called implicitly at exit via trap...
 exit 0

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