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).

gouessej
  • 117

1 Answers1

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.

gouessej
  • 117