From 1a3b85a5bda240ef96a678781ef1a98e595932dd Mon Sep 17 00:00:00 2001 From: Per Johansson Date: Thu, 11 Aug 2011 20:21:25 +0200 Subject: [PATCH] winemenubuilder: Use start.exe to open URLs to respect URL handlers in registry. --- programs/winemenubuilder/winemenubuilder.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 6d627cbe7a1..e6dc504d8fc 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -2962,6 +2962,7 @@ static BOOL InvokeShellLinkerForURL( IUniformResourceLocatorW *url, LPCWSTR link IPropertyStorage *pPropStg; PROPSPEC ps[2]; PROPVARIANT pv[2]; + char *start_path = NULL; if ( !link ) { @@ -3004,6 +3005,13 @@ static BOOL InvokeShellLinkerForURL( IUniformResourceLocatorW *url, LPCWSTR link goto cleanup; } + start_path = get_start_exe_path(); + if (start_path == NULL) + { + WINE_ERR("out of memory\n"); + goto cleanup; + } + ps[0].ulKind = PRSPEC_PROPID; ps[0].u.propid = PID_IS_ICONFILE; ps[1].ulKind = PRSPEC_PROPID; @@ -3063,14 +3071,14 @@ static BOOL InvokeShellLinkerForURL( IUniformResourceLocatorW *url, LPCWSTR link location = heap_printf("%s/%s.desktop", xdg_desktop_dir, lastEntry); if (location) { - r = !write_desktop_entry(NULL, location, lastEntry, "winebrowser", escaped_urlPath, NULL, NULL, icon_name); + r = !write_desktop_entry(NULL, location, lastEntry, start_path, escaped_urlPath, NULL, NULL, icon_name); if (r == 0) chmod(location, 0755); HeapFree(GetProcessHeap(), 0, location); } } else - r = !write_menu_entry(unix_link, link_name, "winebrowser", escaped_urlPath, NULL, NULL, icon_name); + r = !write_menu_entry(unix_link, link_name, start_path, escaped_urlPath, NULL, NULL, icon_name); ret = (r != 0); ReleaseSemaphore(hSem, 1, NULL);