Damjan Jovanovic : winemenubuilder: Launch .lnk files directly from menus.

Alexandre Julliard julliard at winehq.org
Fri May 7 09:41:14 CDT 2010


Module: wine
Branch: master
Commit: 55e4eba2ec5657f2cac0591f0323897a1ad848a3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=55e4eba2ec5657f2cac0591f0323897a1ad848a3

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Fri May  7 08:29:02 2010 +0200

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.

---

 programs/winemenubuilder/winemenubuilder.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c
index 4884d7e..6569c0d 100644
--- a/programs/winemenubuilder/winemenubuilder.c
+++ b/programs/winemenubuilder/winemenubuilder.c
@@ -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 );
 




More information about the wine-cvs mailing list