desktop entry spec TryExec key

Brian J. Tarricone bjt23 at
Fri Mar 23 10:31:47 PDT 2007

Hi all,

We're revisiting our desktop menu implementation in Xfce, and I'm
looking at some old hacks I put into the old implementation to sanitise
the Exec and/or TryExec keys before using them.

Regarding the TryExec key, what can I expect to find there?  Are the
'field codes' allowed in the Exec key also allowed in TryExec (I would
think/hope not)?  How is quoting handled?  Same as Exec?

Basically my question is this: can I take the value of TryExec and
pass it unaltered to something like g_find_program_in_path() and expect
that to always work?  If not, what are the problems with that?  The
desktop entry spec says very little about TryExec.

Also, I'm realising the desktop entry spec is very ambiguous as to how
to even use TryExec:

"File name of a binary on disk used to determine if the program is
actually installed.  If not, entry may not show in menus, etc."

What does 'used to determine' mean in this context?  Was the original
intention that the TryExec program should actually be *executed* to
determine if the program is installed (my assumption is no)?  Or is
just verifying that the program exists, is in PATH, is exectuable, etc.
all that's intended here?


More information about the xdg mailing list