1 diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
2 index eba81fef..134024e2 100644
3 --- a/common/flatpak-dir.c
4 +++ b/common/flatpak-dir.c
5 @@ -7532,8 +7532,13 @@ export_desktop_file (const char *app,
6 g_key_file_remove_key (keyfile, groups[i], "X-GNOME-Bugzilla-ExtraInfoScript", NULL);
8 new_exec = g_string_new ("");
9 - if ((flatpak = g_getenv ("FLATPAK_BINARY")) == NULL)
10 - flatpak = FLATPAK_BINDIR "/flatpak";
11 + if (g_str_has_suffix (name, ".service"))
13 + flatpak = "/run/current-system/sw/bin/flatpak";
15 + if ((flatpak = g_getenv ("FLATPAK_BINARY")) == NULL)
16 + flatpak = "flatpak";
19 g_string_append_printf (new_exec,
20 "%s run --branch=%s --arch=%s",
21 @@ -8867,7 +8872,7 @@ flatpak_dir_deploy (FlatpakDir *self,
24 if ((flatpak = g_getenv ("FLATPAK_BINARY")) == NULL)
25 - flatpak = FLATPAK_BINDIR "/flatpak";
26 + flatpak = "flatpak";
28 bin_data = g_strdup_printf ("#!/bin/sh\nexec %s run --branch=%s --arch=%s %s \"$@\"\n",
29 flatpak, escaped_branch, escaped_arch, escaped_app);