winemenubuilder: Use start.exe to open URLs to respect URL handlers in registry.
Pelle Johansson
morth at morth.org
Fri Aug 12 08:21:21 CDT 2011
Fixes http://bugs.winehq.org/show_bug.cgi?id=25481 and http://bugs.winehq.org/show_bug.cgi?id=26487
---
programs/winemenubuilder/winemenubuilder.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c
index 6d627cb..e6dc504 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);
--
1.7.5.4
More information about the wine-patches
mailing list