Launch issues on Ubuntu

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

Post Reply
Fr0sT
Posts: 4
Joined: Fri Apr 02, 2010 6:27 am

Launch issues on Ubuntu

Post by Fr0sT »

Hello all!
I encounter issues trying to run Xn on Ubuntu. I created package as decribed here (btw, shouldn't that topic be sticky?), and installed it. Everything is fine, and Xn's icon appeared on desktop, but I couldn't launch it neither by icon nor by clicking on executable. Only with .sh file I managed to launch Xn, but it's not the option: it shows terminal with lots of unneeded stuff. So, how can I have Xn working?
Old version (I believe, 0-21) installed from package downloaded from this site worked fine.

And 2nd question, is it necessary to carry QT libs with Xn if I already have them installed?

Thanks in advance. I really wish to use Xn on *nix, 'cause there's no other such powerful viewer/editor.
Spread your wings and fly away
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Launch issues on Ubuntu

Post by oops66 »

Hello,
I have seen a script than create a deb file and install the latest version of XnViewMP (but in french), so if you want to install automatically XnViewMP via a .deb package on Ubuntu, maybe you can use this french script.sh and translate it ?
see here:
http://forum.ubuntu-fr.org/viewtopic.php?id=387143

dependency package : "links"

Code: Select all

#! /bin/bash
# Variables pour les couleurs
FUSHIA="\033[1;35m"
NOIR="\033[1;0m"
BLEUFONCE="\033[1;34m"
VERT="\033[1;32m"
ROUGE="\033[1;31m"

# Version du net
xnviewmp_net=$(links -dump "http://newsgroup.xnview.com/viewforum.php?f=60&sid=cd7112513755712e2212c4331191d5de" | sed -n "/Announcement: XnViewMP / s/.*XnViewMP beta //p" | sort | tail -1)

# Version installée
xnviewmp_local=$(apt-cache show xnviewmp | grep "^Version" | sed "s/.* // ; s/-.*// ; s/b//")

# Comparaison des 2 versions
if [[ ${xnviewmp_net} == ${xnviewmp_local} ]]
then
    echo -e "\n${BLEUFONCE}XnViewMP est ${FUSHIA}à jour.${NOIR}"
    exit
fi

echo -e "${BLEUFONCE}Les versions de XnViewMP sont ${FUSHIA}différentes${BLEUFONCE} :
 - Version du net : ${FUSHIA}${xnviewmp_net}${BLEUFONCE}
 - Version locale : ${FUSHIA}${xnviewmp_local:-Non installé}\n${NOIR}"

# Création de l'arborescence deb
echo -e "${BLEUFONCE}Création de l'arborescence${NOIR}.\n"
mkdir -p xnviewmp/{DEBIAN,opt,usr/{sbin,share/applications}}

# téléchargement du fichier : 
echo -e "${BLEUFONCE}Téléchargement de la derniere version${NOIR}...\n"
wget http://download.xnview.com/XnViewMP-linux.tgz

# Extraction du fichier tar
echo -e "${BLEUFONCE}Extraction du fichier tar${NOIR}.\n"
tar -xzf XnViewMP-linux.tgz -C xnviewmp/opt

# Renommage dossier
mv xnviewmp/opt/XnViewMP* xnviewmp/opt/XnViewMP

# Suppression du fichier tar
echo -e "${BLEUFONCE}Suppression du fichier tar${NOIR}.\n"
rm XnViewMP-linux.tgz

# Taille du dossier xnviewp
taille=($(du xnviewmp | tail -1))
taille=${taille[0]}

# Détéction de l'architecture
architecture=$(uname -m)

case "${architecture}" in
    *64*) # Creation du fichier control du deb
        echo "Package: xnviewmp
Version: ${xnviewmp_net}
Architecture: amd64
Installed-Size: ${taille}
Depends: ia32-libs (>= 2.7ubuntu17)
Section: graphics
Priority: optional
Maintainer: None <none@none.com>
Homepage: http://www.xnview.com
Description: XnViewMP lecteur et convertisseur de fichier graphique" > xnviewmp/DEBIAN/control ;;

    *) # Creation du fichier control du deb
        echo "Package: xnviewmp
Version: ${xnviewmp_net}
Architecture: i386
Installed-Size: ${taille}
Section: graphics
Priority: optional
Maintainer: None <none@none.com>
Homepage: http://www.xnview.com
Description: XnViewMP lecteur et convertisseur de fichier graphique" > xnviewmp/DEBIAN/control ;;
esac

echo

# Création de la commande de lancement du logiciel
ln -s /opt/XnViewMP/xnview.sh xnviewmp/usr/sbin/xnviewmp

# Modification du script de lancement du logiciel
echo '#!/bin/bash

if [[ -n $1 && -e "$1" ]]
then
    fichier=$1
else
    fichier=${HOME}
fi
LD_LIBRARY_PATH=/opt/XnViewMP/lib
export LD_LIBRARY_PATH
QT_PLUGIN_PATH=/opt/XnViewMP/lib
export QT_PLUGIN_PATH
/opt/XnViewMP/xnview "${fichier}"' > xnviewmp/opt/XnViewMP/xnview.sh

# Création du raccourci
echo "[Desktop Entry]
Version=1.0
Type=Application
Name=XnViewMP
GenericName=Lecteur/convertisseur graphique
Comment=lecteur et convertisseur de fichier graphique
Exec=xnviewmp %f
Icon=/opt/XnViewMP/xnview.png
Categories=Graphics;

MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-fits;image/x-png;image/x-psd;image/x-xbitmap;application/dicom;" > xnviewmp/usr/share/applications/xnviewmp.desktop

echo

# Création du deb
dpkg --build xnviewmp xnviewmp_${architecture}.deb

# Suppression des dossiers
rm -r xnviewmp

# Installation du deb
sudo dpkg -i xnviewmp_${architecture}.deb
XnViewMP Linux X64 - Debian - X64
Fr0sT
Posts: 4
Joined: Fri Apr 02, 2010 6:27 am

Re: Launch issues on Ubuntu

Post by Fr0sT »

oops66, thanks =)
As far as I see, this script just automates actions described in "How to create deb package", but I'll take a closer look.
And still I wonder, what's the reason for not launching Xn... do you have everything working?
Spread your wings and fly away
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Launch issues on Ubuntu

Post by oops66 »

Fr0sT wrote:...And still I wonder, what's the reason for not launching Xn... do you have everything working?
I don't know, your problem may come from several things.
Personally (and for the moment) I don't use a .deb file to install XnViewMP, I just decompress the .tgz Linux file, and create a desktop shortcut from the default xnview.sh file bellow:
#!/bin/sh
dirname=`dirname $0`
LD_LIBRARY_PATH=$dirname/lib
export LD_LIBRARY_PATH
QT_PLUGIN_PATH=$dirname/lib
export QT_PLUGIN_PATH
$dirname/xnview "$@"
XnViewMP Linux X64 - Debian - X64
Fr0sT
Posts: 4
Joined: Fri Apr 02, 2010 6:27 am

Re: Launch issues on Ubuntu

Post by Fr0sT »

Aaah, that's it! .sh file is the one by which Xn must be launched! But I can't realize why it is required, why executable itself isn't working? And more, will file assotiations work?
Spread your wings and fly away
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Launch issues on Ubuntu

Post by marsh »

With v.0.26, you can choose 'open with' (in most file-managers), browse and select xnview.sh for an image type.
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Launch issues on Ubuntu

Post by oops66 »

Hello,
... You also can use "Ubuntu Tweak" for customization (files assotiations, ...)
XnViewMP Linux X64 - Debian - X64
Fr0sT
Posts: 4
Joined: Fri Apr 02, 2010 6:27 am

Re: Launch issues on Ubuntu

Post by Fr0sT »

marsh, oops66, I'll try, but I'd rather like to have file types associated from Xn's GUI, as it always been in Windows
Spread your wings and fly away
Post Reply