diff options
| author | Rusty Wagner <rusty@vector35.com> | 2017-12-26 17:14:16 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2017-12-26 17:14:16 -0500 |
| commit | 9fc4766a507d5299cd4de78170c5798b02bb9698 (patch) | |
| tree | a4589f36a46e662cc16613db88f1c83c69512181 /scripts/linux-setup.sh | |
| parent | 06b97009b2a09dc7816f6ace2d6a4bff66cb3f26 (diff) | |
| parent | 26edabfdd7211012c7c8a03186d3025eea9aa345 (diff) | |
Merge branch 'dev' into fpu
Diffstat (limited to 'scripts/linux-setup.sh')
| -rwxr-xr-x | scripts/linux-setup.sh | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/scripts/linux-setup.sh b/scripts/linux-setup.sh index f1650b7f..bb1e0f28 100755 --- a/scripts/linux-setup.sh +++ b/scripts/linux-setup.sh @@ -14,7 +14,7 @@ setvars() APP="binaryninja" FILECOMMENT="Binary Ninja Analysis Database" APPCOMMENT="Binary Ninja: A Reverse Engineering Platform" - BNPATH=$(dirname $(readlink -f "$0")) + BNPATH="$(dirname $(readlink -f "$0"))/.." EXEC="${BNPATH}/binaryninja" PNG="${BNPATH}/docs/images/logo.png" EXT="bndb" @@ -54,6 +54,10 @@ lastrun() then echo lastrun already exists, remove to create a new one else + if [ ! -d ${HOME}/.binaryninja ] + then + mkdir ${HOME}/.binaryninja + fi echo ${BNPATH} > ${HOME}/.binaryninja/lastrun fi } @@ -61,7 +65,12 @@ lastrun() pythonpath() { echo Configuring python path - ${SUDO}python ${BNPATH}/install_api.py $ROOT + if [[ $(python -V) == "Python 3."* ]] + then + ${SUDO}python2 ${BNPATH}/scripts/install_api.py $ROOT + else + ${SUDO}python ${BNPATH}/scripts/install_api.py $ROOT + fi } createdesktopfile() @@ -81,14 +90,9 @@ Type=Application Categories=Utility; Comment=${APPCOMMENT} EOF - if [ "${ROOT}" == "root" ] - then - echo ${DESKTOP} | $SUDO tee ${DESKTOPFILE} >/dev/null - $SUDO chmod +x ${DESKTOPFILE} - $SUDO update-desktop-database ${SHARE}/applications - else - echo ${DESKTOP} > ${HOME}/Desktop/${APP}.desktop - fi + echo "${DESKTOP}" | $SUDO tee ${DESKTOPFILE} >/dev/null + $SUDO chmod +x ${DESKTOPFILE} + $SUDO update-desktop-database ${SHARE}/applications } createmime() @@ -112,12 +116,8 @@ createmime() #echo Copying icon #$SUDO cp $PNG $IMAGEFILE - if [ "${ROOT}" == "root" ] - then - $SUDO cp ${PNG} ${IMAGEFILE} - $SUDO update-mime-database ${SHARE}/mime - fi - + $SUDO cp ${PNG} ${IMAGEFILE} + $SUDO update-mime-database ${SHARE}/mime } addtodesktop() @@ -127,11 +127,8 @@ addtodesktop() uninstall() { - rm -i -r $DESKTOPFILE $MIMEFILE $IMAGEFILE - if [ "$ROOT" == "root" ] - then - $SUDO update-mime-database ${SHARE}/mime - fi + rm -i -r $DESKTOPFILE $MIMEFILE $IMAGEFILE ${HOME}/Desktop/${APP}.desktop + $SUDO update-mime-database ${SHARE}/mime exit 0 } |
