Reply
Thread Tools
Posts: 254 | Thanked: 509 times | Joined on Nov 2011 @ Canada
#1
I'm trying to create an icon for a game I'm packaging up, but for some reason when I try to launch the game from the icon, it opens and closes immediately. Launching from terminal as user works fine. The game is using SDL in full-screen.

The desktop file is pretty straight-forward, but I've tried all sorts of things without success.

Code:
[Desktop Entry]
Encoding=UTF-8
Version=1.2.0
Type=Application
Name=Curse of War
Exec=/opt/curseofwar/curseofwar-sdl
Icon=curseofwar
X-Window-Icon=curseofwar
X-Osso-Type=application/x-executable
Terminal=false
Anyone seen this before and know the solution? I've attached the deb installer for the game, which will install into /opt/ with desktop file and icon. Install it and try to launch from the desktop icon... just opens and closes almost immediately. I'd like to release this to extras but want to fix this desktop icon issue first.

The game is Curse of War, and the SDL version works fairly well on the n900. Running it from terminal as user works fine. Upstream is here: http://a-nikolaev.github.io/curseofwar/

Edit: Ok, solved it. The images were in the /opt/curseofwar/ directory and when launched from the desktop shortcut, the current directory isn't /opt/curseofwar, so moving the images to ~/.curseofwar is the solution. I'll upload to extras and do a proper announce thread!

Last edited by shawnjefferson; 2014-05-27 at 06:36.
 

The Following User Says Thank You to shawnjefferson For This Useful Post:
Posts: 254 | Thanked: 509 times | Joined on Nov 2011 @ Canada
#2
Solved! Package going to autobuilder/extras soon.

Last edited by shawnjefferson; 2014-05-27 at 06:37.
 

The Following User Says Thank You to shawnjefferson For This Useful Post:
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#3
Originally Posted by shawnjefferson View Post
Edit: Ok, solved it. The images were in the /opt/curseofwar/ directory and when launched from the desktop shortcut, the current directory isn't /opt/curseofwar, so moving the images to ~/.curseofwar is the solution.
I would rather call it a workaround than a solution. I would not put static (read: not to be changed by the user, such as config files) parts of the app under ~. I think /opt/curseofwar was the right place and the proper fix would be changing the code to look for the images not in the current but in the install directory.

Unless I am missing something of course.

Another workaround might be changing the exec line in the desktop file to something like 'cd foo && foo' but I have not tried that yet to see if that works.
__________________
Русский военный корабль, иди нахуй!
 
Posts: 254 | Thanked: 509 times | Joined on Nov 2011 @ Canada
#4
The game is coded to look for the resource data (images) in specific places:

1../ (Your current directory)
2.$XDG_DATA_HOME/curseofwar (Defaults to ~/.local/share/curseofwar)
3.~/.curseofwar (If possible, use ~/.local/share/curseofwar)
4./usr/local/share/curseofwar
5./usr/share/curseofwar
6./usr/share/curseofwar-sdl
7./usr/share/curseofwar-common

To me, ~/.curseofwar seemed like the lesser of all evils on the n900. I will take a look at the code and see if the current directory piece can be fixed, or maybe just hardcode /opt/curseofwar/images in that list too. Should be an easy fix...

PS. The game "Brogue" seems to have a similar issue... the desktop icon I tried to create for it has the same behavior, maybe why the maintainer of that package did not include one.
 
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#5
I would make /usr/share/curseofwar a symlink to /opt/usr/share/curseofwar
__________________
Русский военный корабль, иди нахуй!
 
Reply


 
Forum Jump


All times are GMT. The time now is 01:38.