0

Note that this is an issue under Ubuntu 14.04. It is not an issue with any other Linux distribution. There is no good reason for this to be closed...


I first wrote my game under Magia Linux, and then tested it on Ubuntu 14.04 LTS to be sure that it works correctly. You can find the Debian packages here: http://tuer.sourceforge.net/en/play/

When I enter "tuer" in command line, it runs my game as expected but when I click on the icon, it doesn't run my game. Setting the "Terminal" attribute to "true" in tuer.desktop just shows the terminal very quickly but no error message appears. The desktop file is really simple: http://sourceforge.net/p/tuer/code/HEAD/tree/pre_beta/jndt.xml#l952

There is a symbolic link /usr/bin/tuer (in the path) to /usr/share/tuer/tuer. I don't get why it works only in command line under Ubuntu. Maybe the problem comes from the script: http://sourceforge.net/p/tuer/code/HEAD/tree/pre_beta/jndt.xml#l637

I assume that it's possible to open the desktop file the same way the desktop manager does with gtk-launch, xdg-open or gvfs-open.

What is the issue here?

Update: I have driven the .desktop files executable in order to eliminate a possible root cause as Serg suggested. I've just uploaded the new Debian packages (obviously compatible with Ubuntu).

21
  • Anywhere under home directory you must make links and .desktop filea executable with chmod 755. Your question is a duplicate, just need to find a link Oct 29, 2015 at 12:37
  • 1
    Possible duplicate of Untrusted Application Launcher Oct 29, 2015 at 12:40
  • @Serg The target of the link is executable for sure: sourceforge.net/p/tuer/code/HEAD/tree/pre_beta/jndt.xml#l1114 but not the .desktop file. I'm going to give it a try, thank you. It's weird to drive a .desktop file executable.
    – gouessej
    Oct 29, 2015 at 12:56
  • 2
    @ThomasW. completely un true - it's fine to ask on behalf of someone, and I'm not sure why you think it isn't... Jeff even wrote a blog post on it, and he does it himself...
    – Tim
    Oct 29, 2015 at 13:57
  • 1
    For now, Serg's suggestion isn't enough to solve the problem but as it seems plausible, I'll update my packages, it will still eliminate one possible root cause. The upload takes age on Sourceforge, sorry.
    – gouessej
    Oct 29, 2015 at 14:50

1 Answer 1

0

I had to replace the following script:

#!/usr/bin/bash
#code snippet written by Dave Dopson: http://stackoverflow.com/a/246128
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
    APP_LAUNCHER_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
    SOURCE="$(readlink "$SOURCE")"
    [[ $SOURCE != /* ]] && SOURCE="$APP_LAUNCHER_DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
APP_LAUNCHER_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
$APP_LAUNCHER_DIR/jre/bin/java -server -Xmx256m -XX:MaxDirectMemorySize=128M -Djava.ext.dirs= -jar $APP_LAUNCHER_DIR/tuer.jar

by

/usr/share/tuer/jre/bin/java -server -Xmx256m -XX:MaxDirectMemorySize=128M -Djava.ext.dirs= -jar /usr/share/tuer/tuer.jar

because unlike the terminal, Unity ignores the first line and tries to interpret my bash script as a dash script. It showed once " 5: Bad substitution", another time "** (gtk-launch:27745): WARNING **: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.", another time "no such file or directory" and it claimed that the execution of the child process "tuer" had been interrupted without any detailed explanations.

I'll upload some fixed Debian packages in about ten hours.

Conclusion: Use a common Posix subset of Bash and Dash if you want to avoid any trouble under Ubuntu even though the script works in command line.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .