Commit 55e4eba2 authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

winemenubuilder: Launch .lnk files directly from menus.

The arguments of a .lnk file are complex, with quoting and escaping rules and %windir%-style variable expansion, so winemenubuilder cannot always convert them accurately to a .desktop file. But start.exe and shell32 on the other hand can parse the .lnk file and run it themselves, so use them instead.
parent 61493dee
......@@ -2340,7 +2340,24 @@ static BOOL InvokeShellLinker( IShellLinkW *sl, LPCWSTR link, BOOL bWait )
}
}
else
r = !write_menu_entry(unix_link, link_name, escaped_path, escaped_args, escaped_description, work_dir, icon_name);
{
char *arg = heap_printf("/Unix \"%s\"", unix_link);
if (arg)
{
WCHAR *warg = utf8_chars_to_wchars(arg);
if (warg)
{
char *menuarg = escape(warg);
if (menuarg)
{
r = !write_menu_entry(unix_link, link_name, "start", menuarg, escaped_description, work_dir, icon_name);
HeapFree(GetProcessHeap(), 0, menuarg);
}
HeapFree(GetProcessHeap(), 0, warg);
}
HeapFree(GetProcessHeap(), 0, arg);
}
}
ReleaseSemaphore( hsem, 1, NULL );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment