Skip to content

Commit

Permalink
Add install script and desktop entry for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbata committed Aug 15, 2023
1 parent 2e1ace0 commit 3c89745
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/main/dist/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh

# JPass installation script for Linux

# check if java executable exists
if [ -d "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
JAVACMD="$JAVA_HOME/bin/java"
else
JAVACMD=java
fi

$JAVACMD -version >/dev/null 2>&1
if [ "$?" != "0" ]; then
echo "Install Java (JDK or JRE) if you do not already have. JPass will not work without it."
echo "Please make sure PATH, or JAVA_HOME environment variables point to a valid Java installation."
echo "Could not execute JPass (exit: $?)"
exit
fi

# detect the absolute path of jpass
JPASS_HOME=`dirname "$0"`

# detect cygwin
cygwin=false;
case "`uname -s`" in
CYGWIN*)
cygwin=true
;;
esac

if $cygwin ; then
JPASS_PATH=`cygpath "$JPASS_HOME"`
else
JPASS_PATH="$JPASS_HOME"
fi

echo "Install application to /opt/jpass..."
if [ ! -d "/opt" ]; then
echo "ERROR: /opt folder does not exists"
exit
fi

mkdir -p "/opt/jpass"
cp -R "$JPASS_PATH" "/opt/jpass"

echo "Add JPass desktop entry..."
if [ ! -d "/usr/share/applications" ]; then
echo "ERROR: Could not create desktop entry: /usr/share/applications is missing"
exit
fi

cp "$JPASS_PATH/jpass.desktop" "/usr/share/applications"

8 changes: 8 additions & 0 deletions src/main/dist/jpass.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=JPass
Comment=Password manager with strong encryption
Exec=/opt/jpass/jpass.sh
Icon=/opt/jpass/jpass.png
Terminal=False

0 comments on commit 3c89745

Please sign in to comment.