Permalink
Browse files

Linux/Installer : Disable system wide install of nidium

  • Loading branch information...
efyx committed Apr 28, 2017
1 parent e62986f commit b38398717e7e9cc05d01f8d3a22175403bf8ce1f
Showing with 24 additions and 24 deletions.
  1. +24 −24 resources/linux/installer.sh
@@ -2,16 +2,16 @@
IS_ROOT=0
BASE_INSTALL_DIR="${HOME}/nidium"
if [ "$(id -u)" = "0" ]
then
IS_ROOT=1
BASE_INSTALL_DIR="/usr/local/nidium"
else
echo "------------"
echo "NOTE : You are running this script as \"$(whoami)\". Nidium will only be installed for this user."
echo "If you want to install nidium system wide, run this script with administrator privileges."
echo "------------"
fi
#if [ "$(id -u)" = "0" ]
#then
# IS_ROOT=1
# BASE_INSTALL_DIR="/usr/local/nidium"
#else
# echo "------------"
# echo "NOTE : You are running this script as \"$(whoami)\". Nidium will only be installed for this user."
# echo "If you want to install nidium system wide, run this script with administrator privileges."
# echo "------------"
#fi
xdg-mime --version >/dev/null 2>&1
if [ $? != 0 ]
@@ -80,24 +80,24 @@ printf "%s" "- Registering Nidium file association : *.nml;*.npa "
echo "Exec=$INSTALL_DIR/nidium %F" >> resources/nidium.desktop
if [ $IS_ROOT = 1 ]
then
printf "(System wide)\n"
xdg-mime install --novendor --mode system resources/x-application-nidium.xml
if [ ! -d "/usr/share/applications/" ]
then
printf "Directory /usr/share/applications/ not found. Installing for user only\n"
desktop-file-install resources/nidium.desktop --dir ~/.local/share/applications/ --rebuild-mime-info-cache
else
desktop-file-install resources/nidium.desktop --rebuild-mime-info-cache
fi
xdg-icon-resource install --mode system --novendor --context mimetypes --size 48 resources/nidium.png x-application-nidium
else
#if [ $IS_ROOT = 1 ]
#then
# printf "(System wide)\n"
# xdg-mime install --novendor --mode system resources/x-application-nidium.xml
# if [ ! -d "/usr/share/applications/" ]
# then
# printf "Directory /usr/share/applications/ not found. Installing for user only\n"
# desktop-file-install resources/nidium.desktop --dir ~/.local/share/applications/ --rebuild-mime-info-cache
# else
# desktop-file-install resources/nidium.desktop --rebuild-mime-info-cache
# fi
# xdg-icon-resource install --mode system --novendor --context mimetypes --size 48 resources/nidium.png x-application-nidium
#else
printf "(Current user only)\n"
xdg-mime install --novendor resources/x-application-nidium.xml
desktop-file-install resources/nidium.desktop --dir ~/.local/share/applications/ --rebuild-mime-info-cache
xdg-icon-resource install --novendor --context mimetypes --size 48 resources/nidium.png x-application-nidium
fi
#fi
xdg-mime default nidium.desktop application/nidium

0 comments on commit b383987

Please sign in to comment.