Comment 7 for bug 335712

Revision history for this message
wild.ideas (wild-ideas) wrote :

AHA!!! It's NOT a bug in the 'exec' parser!!!

I found it... It's a bug in the way the menu editor & Wine create/manage/display the menus. It's not acting consistently!

Here's what's happening: I'm running 64-bit Karmic. I have an application I installed in Wine 1.1.38 called "MyApp". When "MyApp" installs, it (meaning MyApp's installer, Wine, and Ubuntu in some combination unknown to the layman) creates a menu folder entry in 'Applications / Wine / Programs' called "MyApp".

Inside the "MyApp" folder, the install process creates several '.desktop' files for MyApp.exe, a few other associated apps, and entries to run 'notepad' with arguments that are README files.

In my case, one of these 'notepad' launchers works, one doesn't. Examining the two revealed that the one that doesn't work fails only because the README file argument, which contains '\' characters, isn't quoted with double-quotes. The one that works has a quoted argument.

I.e., the 'exec' parser is working properly according to http://library.gnome.org/devel/desktop-entry-spec/ (under "The Exec key"), which states "If an argument contains a reserved character the argument must be quoted."

Here's where it gets weird: When I ran 'System / Preferences / Main Menu' and edited the Properties for the "notepad README" item, I could clearly see the change appear in THIS directory & file:

.local/share/applications/wine-Programs-MyApp-MyApp ReadMe.desktop

by cat'ing the file in a terminal window. My changes appear, and it automatically doubles my backslashes...

However, that's NOT the '.desktop' file that's launching the "notepad README" item!

It turns out that MyApp's installer / Wine / Ubuntu is creating TWO sets of '.desktop' files... And when you attempt to launch a Wine app, it uses THIS directory & file:

.local/share/applications/wine/Programs/MyApp/MyApp ReadMe.desktop

which is NOT edited by using 'System / Preferences / Main Menu'. You have to manually edit this file (using, e.g., 'vi'). And it my case, that amounted to correcting the argument to 'notepad' by enclosing it in double-quotes to meet the rules of the 'exec' key field for '.desktop' files.

Once done, it launched properly from ''Applications / Wine / Programs / MyApp', as expected.

So WHY are two sets of '.desktop' files being created / maintained? That's the bug! It's not the parser for 'exec'.

Oh, and we still need a 'help' for guidance on escaping/quoting special characters... :^)