I tried to create a .desktop file for my 2D shooting game made with sdl2. the .desktop file looks like this
[Desktop Entry]
Version=1.0
Name=The Hunt For Red October
Comment=2D shooting game
Exec=/home/araf/Projects/The_Hunt_For_Red_October/a.out
Icon=/home/araf/Pictures/hunt for red october intro.png
Terminal=false
Type=Application
Categories=Utility;Application;
after that I checked the Allowed executing file as program & Allow launching.
but it was not executing rather a black screen popped out and instantly go away.
Later I figured out It was because that a.out
has a dependency on a folder /home/araf/Projects/The_Hunt_For_Red_October/assets
where all the media files are located so a.out
file is terminating.
So, How can I include that folder with it and make it work?
Path
specification? See for example How to create a .desktop unity launcher that starts an executable in a specific working directory – steeldriver Dec 20 '22 at 21:33