0

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?

1 Answers1

0

I fixed that problem. After seeing an answer in another question here I figured out what I missing was that I have to run the executable file in the folder where the /home/araf/Projects/The_Hunt_For_Red_October/assets folder is located. To do this all I needed was to add an extra line


Path=/home/araf/Projects/The_Hunt_For_Red_October/

in the .desktop file indicating the folder where the a.out file will run. as assets folder is also in the same folder so now a.out can access the media file from assets folder and the file executes without error.