VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup/Linux
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-10 12:40:49 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-10 12:45:36 +0100
commit5012e0941a7f9fd00342513b4857969fd867cc30 (patch)
tree8d5feb40552d9ad66ea530b07b317e2bcc30767d /src/Setup/Linux
parent1eb8aec9fa1530eaec4c16d2a06b911ab2ad2c11 (diff)
downloadVeraCrypt-5012e0941a7f9fd00342513b4857969fd867cc30.tar.gz
VeraCrypt-5012e0941a7f9fd00342513b4857969fd867cc30.zip
Linux: Add graphical installer support when xterm is not available (Linux Mint case)
Diffstat (limited to 'src/Setup/Linux')
-rw-r--r--src/Setup/Linux/veracrypt_install_template.sh40
1 files changed, 36 insertions, 4 deletions
diff --git a/src/Setup/Linux/veracrypt_install_template.sh b/src/Setup/Linux/veracrypt_install_template.sh
index 305fd4ad..427f9320 100644
--- a/src/Setup/Linux/veracrypt_install_template.sh
+++ b/src/Setup/Linux/veracrypt_install_template.sh
@@ -21,6 +21,8 @@ tty >/dev/null 2>/dev/null && TTY=1
GUI=0
XMESSAGE=0
XTERM=0
+GTERM=0
+KTERM=0
case $PACKAGE_TYPE in
@@ -36,13 +38,15 @@ then
GUI=1
which xmessage >/dev/null 2>/dev/null && XMESSAGE=1
which xterm >/dev/null 2>/dev/null && XTERM=1
+ which gnome-terminal >/dev/null 2>/dev/null && GTERM=1
+ which konsole >/dev/null 2>/dev/null && KTERM=1
fi
if [ $TTY -eq 0 ]
then
[ $GUI -eq 0 ] && echo 'Error: Terminal required' >&2 && exit 1
- if [ $XMESSAGE -eq 0 ] || [ $XTERM -eq 0 ]
+ if [ $XMESSAGE -eq 0 ] || ([ $XTERM -eq 0 ] && [ $GTERM -eq 0 ] && [ $KTERM -eq 0 ])
then
which gnome-terminal && exec gnome-terminal -e "$0"
which konsole && exec konsole -e "$0"
@@ -53,11 +57,13 @@ then
fi
fi
-if [ $XMESSAGE -eq 0 ] || [ $XTERM -eq 0 ]
+if [ $XMESSAGE -eq 0 ] || ([ $XTERM -eq 0 ] && [ $GTERM -eq 0 ] && [ $KTERM -eq 0 ])
then
GUI=0
XMESSAGE=0
XTERM=0
+ GTERM=0
+ KTERM=0
fi
@@ -73,7 +79,20 @@ show_message()
then
echo "$*"
else
- xterm -T 'VeraCrypt Setup' -e sh -c "echo $*; read A"
+ if [ $XTERM -eq 1 ]
+ then
+ xterm -T 'VeraCrypt Setup' -e sh -c "echo $*; read A"
+ else
+ if [ $GTERM -eq 1 ]
+ then
+ gnome-terminal --title='VeraCrypt Setup' -e "sh -c \"echo $*; read A\""
+ else
+ if [ $KTERM -eq 1 ]
+ then
+ konsole -T 'VeraCrypt Setup' -e "sh -c \"echo $*; read A\""
+ fi
+ fi
+ fi
fi
fi
else
@@ -833,7 +852,20 @@ then
if [ $GUI -eq 1 ]
then
- exec xterm -T 'VeraCrypt Setup' -e sh -c "echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A"
+ if [ $XTERM -eq 1 ]
+ then
+ exec xterm -T 'VeraCrypt Setup' -e sh -c "echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A"
+ else
+ if [ $GTERM -eq 1 ]
+ then
+ exec gnome-terminal --title='VeraCrypt Setup' -e "sh -c \"echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A\""
+ else
+ if [ $KTERM -eq 1 ]
+ then
+ exec konsole -T 'VeraCrypt Setup' -e "sh -c \"echo Installing package...; $SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE; rm -f $PACKAGE; echo; echo Press Enter to exit...; read A\""
+ fi
+ fi
+ fi
else
echo 'Installing package...'
$SUDO $PACKAGE_INSTALLER $PACKAGE_INSTALLER_OPTS $PACKAGE && INSTALLED=1