Ubuntu – How does .desktop file EXEC field work

appmenudesktop

It's been several months I'm having this horrible problem. I'm currently using Unity 2D, and I manage my menu entries by using .desktop files, which is tiring. Is there a better way to manage them?
Anyway, the problem comes from the EXEC field. I'm so tired! I've been fighting to resolve this problem for days! It almost gave me a nervous-breakdown once. As an example, the latest entry I tried to add was an entry for a Windows game (using Wine):

[Desktop Entry]
Name=Venus Patrol 1.1
Icon=/usr/share/icons/venuspatrol.jpg
Type=Application
Categories=Game;
Exec=wine "/home/LOL/Autres/ProgramFiles/Games/Venus Patrol 1.1/VENUS PATROL.exe"
Path="/home/LOL/Autres/ProgramFiles/Games/Venus Patrol 1.1"
Keywords=game;indie;jam;
Terminal=true
GenericName=Indie game by Neil Thapen originally made for TIGSource Cockpit Competition 2009

I put directly executable programs and games (no installation needed, mainly Windows ones) in "/home/LOL/Autres/ProgramFiles" directory. I don't like messing with root folders, as I'm obliged to open the File Manager as root and go through all the system folders.

Whether the path contains spaces or not, it does not work. Whether I precise the environement WINEPREFIX path or not, it does not work. I've tried Alacarte, but it doesn't work as well. I've been reading this, but it didn't help.

Please, help me, I need some help. Do you have any ideas?

PS: … Well, yeah, I'm a fussy person

EDIT: So, after Mr. Gruber's reply, I updated my .desktop file, without success:

[Desktop Entry]
Name=Venus Patrol 1.1
Icon=/usr/share/icons/venuspatrol.jpg
Type=Application
Categories=Game;
TryExec=/home/LOL/Autres/ProgramFiles/Games/Venus\sPatrol\s1.1/VENUS\sPATROL.exe
Exec=wine "/home/LOL/Autres/ProgramFiles/Games/Venus Patrol 1.1/VENUS PATROL.exe"
Path="/home/LOL/Autres/ProgramFiles/Games/Venus Patrol 1.1"
Keywords=game;indie;jam;
Terminal=true
GenericName=Indie game by Neil Thapen originally made for TIGSource Cockpit Competition 2009.

Whether I precise the Path variable or not, as ever, it does not work. It may be related to Wine (WINEPREFIX, this kind of things), as I (supposedly) eventually had the Exec field well written.

Best Answer

If you use shell features you need to use sh -c "the command". Also, with Wine you need to set the current directory for some stuff. man wine

Related Question