Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (64 sloc) 3.14 KB
From 65db555c42f4f114cba9f22fbec969f971e853ef Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 24 Sep 2014 21:13:59 +0200
Subject: [PATCH] winemenubuilder: Create desktop shortcuts with absolute wine
path.
When having multiple wine versions installed (for example regular wine and wine staging), the desktop
shortcuts will always run regular wine, even if the app was installed with wine staging. This patch
changes the behaviour to use the absolute wine path in desktop shortcuts. The patch only modifies the
behaviour on Linux, because some other distros are a bit special (FreeBSD requires a wrapper to start
wine, and so on ...).
---
programs/winemenubuilder/Makefile.in | 1 +
programs/winemenubuilder/winemenubuilder.c | 15 ++++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/programs/winemenubuilder/Makefile.in b/programs/winemenubuilder/Makefile.in
index 07e2702843..a4e28adc4b 100644
--- a/programs/winemenubuilder/Makefile.in
+++ b/programs/winemenubuilder/Makefile.in
@@ -1,6 +1,7 @@
MODULE = winemenubuilder.exe
APPMODE = -mwindows -municode
IMPORTS = uuid windowscodecs shell32 shlwapi ole32 user32 advapi32
+EXTRADEFS = -DBINDIR="\"${bindir}\""
C_SRCS = \
winemenubuilder.c
diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c
index 26710e9e92..c0834e54af 100644
--- a/programs/winemenubuilder/winemenubuilder.c
+++ b/programs/winemenubuilder/winemenubuilder.c
@@ -107,6 +107,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(menubuilder);
#define IS_OPTION_TRUE(ch) \
((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
+/* On linux we create all menu item entries with an absolute path to wine,
+ * in order to allow using multiple wine versions at the same time. */
+#ifdef __linux__
+ static const char wine_path[] = BINDIR "/wine";
+#else
+ static const char wine_path[] = "wine";
+#endif
+
/* link file formats */
#include "pshpack1.h"
@@ -1464,8 +1472,8 @@ static BOOL write_desktop_entry(const char *unix_link, const char *location, con
fprintf(file, "[Desktop Entry]\n");
fprintf(file, "Name=%s\n", linkname);
- fprintf(file, "Exec=env WINEPREFIX=\"%s\" wine %s %s\n",
- wine_get_config_dir(), path, args);
+ fprintf(file, "Exec=env WINEPREFIX=\"%s\" %s %s %s\n",
+ wine_get_config_dir(), wine_path, path, args);
fprintf(file, "Type=Application\n");
fprintf(file, "StartupNotify=true\n");
if (descr && *descr)
@@ -2505,7 +2513,8 @@ static BOOL write_freedesktop_association_entry(const char *desktopPath, const c
fprintf(desktop, "Type=Application\n");
fprintf(desktop, "Name=%s\n", friendlyAppName);
fprintf(desktop, "MimeType=%s;\n", mimeType);
- fprintf(desktop, "Exec=env WINEPREFIX=\"%s\" wine start /ProgIDOpen %s %%f\n", wine_get_config_dir(), progId);
+ fprintf(desktop, "Exec=env WINEPREFIX=\"%s\" %s start /ProgIDOpen %s %%f\n",
+ wine_get_config_dir(), wine_path, progId);
fprintf(desktop, "NoDisplay=true\n");
fprintf(desktop, "StartupNotify=true\n");
if (openWithIcon)
--
2.19.1
You can’t perform that action at this time.