diff --git a/libnautilus-private/nautilus-directory-async.c b/libnautilus-private/nautilus-directory-async.c
index ae52ed9..87aa29c 100644
--- a/libnautilus-private/nautilus-directory-async.c
+++ b/libnautilus-private/nautilus-directory-async.c
@@ -33,6 +33,7 @@
 #include "nautilus-global-preferences.h"
 #include "nautilus-link.h"
 #include "nautilus-marshal.h"
+#include "nautilus-metadata.h"
 #include <eel/eel-glib-extensions.h>
 #include <eel/eel-string.h>
 #include <gtk/gtk.h>
@@ -3512,12 +3513,16 @@ is_link_trusted (NautilusFile *file,
 {
 	GFile *location;
 	gboolean res;
-	
+    gchar* trusted = NULL;
+
 	if (!is_launcher) {
 		return TRUE;
 	}
-	
-	if (nautilus_file_can_execute (file)) {
+    trusted = nautilus_file_get_metadata (file,
+                                          NAUTILUS_METADATA_KEY_DESKTOP_FILE_TRUSTED,
+                                          NULL);
+    if (nautilus_file_can_execute (file) && trusted != NULL)
+    {
 		return TRUE;
 	}
 
@@ -3529,6 +3534,7 @@ is_link_trusted (NautilusFile *file,
 		g_object_unref (location);
 	}
 	
+    g_free (trusted);
 	return res;
 }
 
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index 20bd3b0..802c89c 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -192,7 +192,7 @@ typedef struct {
 #define MERGE_ALL _("Merge _All")
 
 static void
-mark_desktop_file_trusted (CommonJob *common,
+mark_desktop_file_executable (CommonJob *common,
 			   GCancellable *cancellable,
 			   GFile *file,
 			   gboolean interactive);
@@ -3975,7 +3975,7 @@ copy_move_file (CopyMoveJob *copy_job,
 		if (copy_job->desktop_location != NULL &&
 		    g_file_equal (copy_job->desktop_location, dest_dir) &&
 		    is_trusted_desktop_file (src, job->cancellable)) {
-			mark_desktop_file_trusted (job,
+            mark_desktop_file_executable (job,
 						   job->cancellable,
 						   dest,
 						   FALSE);
@@ -6150,7 +6150,7 @@ nautilus_file_operations_empty_trash (GtkWidget *parent_view)
 }
 
 static gboolean
-mark_trusted_job_done (gpointer user_data)
+mark_executable_job_done (gpointer user_data)
 {
 	MarkTrustedJob *job = user_data;
 	
@@ -6167,92 +6167,19 @@ mark_trusted_job_done (gpointer user_data)
 #define TRUSTED_SHEBANG "#!/usr/bin/env xdg-open\n"
 
 static void
-mark_desktop_file_trusted (CommonJob *common,
+mark_desktop_file_executable (CommonJob *common,
 			   GCancellable *cancellable,
 			   GFile *file,
 			   gboolean interactive)
 {
-	char *contents, *new_contents;
-	gsize length, new_length;
 	GError *error;
 	guint32 current_perms, new_perms;
 	int response;
 	GFileInfo *info;
 	
  retry:
-	error = NULL;
-	if (!g_file_load_contents (file,
-				  cancellable,
-				  &contents, &length,
-				  NULL, &error)) {
-		if (interactive) {
-			response = run_error (common,
-					      g_strdup (_("Unable to mark launcher trusted (executable)")),
-					      error->message,
-					      NULL,
-					      FALSE,
-					      GTK_STOCK_CANCEL, RETRY,
-					      NULL);
-		} else {
-			response = 0;
-		}
-		
 
-		if (response == 0 || response == GTK_RESPONSE_DELETE_EVENT) {
-			abort_job (common);
-		} else if (response == 1) {
-			goto retry;
-		} else {
-			g_assert_not_reached ();
-		}
-
-		goto out;
-	}
-
-	if (!g_str_has_prefix (contents, "#!")) {
-		new_length = length + strlen (TRUSTED_SHEBANG);
-		new_contents = g_malloc (new_length);
-		
-		strcpy (new_contents, TRUSTED_SHEBANG);
-		memcpy (new_contents + strlen (TRUSTED_SHEBANG),
-			contents, length);
-		
-		if (!g_file_replace_contents (file,
-					      new_contents,
-					      new_length,
-					      NULL,
-					      FALSE, 0,
-					      NULL, cancellable, &error)) {
-			g_free (contents);
-			g_free (new_contents);
-			
-			if (interactive) {
-				response = run_error (common,
-						      g_strdup (_("Unable to mark launcher trusted (executable)")),
-						      error->message,
-						      NULL,
-						      FALSE,
-						      GTK_STOCK_CANCEL, RETRY,
-						      NULL);
-			} else {
-				response = 0;
-			}
-
-			if (response == 0 || response == GTK_RESPONSE_DELETE_EVENT) {
-				abort_job (common);
-			} else if (response == 1) {
-				goto retry;
-			} else {
-				g_assert_not_reached ();
-			}
-			
-			goto out;
-		}
-		g_free (new_contents);
-		
-	}
-	g_free (contents);
-	
+    error = NULL;
 	info = g_file_query_info (file,
 				  G_FILE_ATTRIBUTE_STANDARD_TYPE","
 				  G_FILE_ATTRIBUTE_UNIX_MODE,
@@ -6325,7 +6252,7 @@ mark_desktop_file_trusted (CommonJob *common,
 }
 
 static gboolean
-mark_trusted_job (GIOSchedulerJob *io_job,
+mark_executable_job (GIOSchedulerJob *io_job,
 		  GCancellable *cancellable,
 		  gpointer user_data)
 {
@@ -6337,13 +6264,13 @@ mark_trusted_job (GIOSchedulerJob *io_job,
 	
 	nautilus_progress_info_start (job->common.progress);
 
-	mark_desktop_file_trusted (common,
+    mark_desktop_file_executable (common,
 				   cancellable,
 				   job->file,
 				   job->interactive);
 	
 	g_io_scheduler_job_send_to_mainloop_async (io_job,
-						   mark_trusted_job_done,
+                           mark_executable_job_done,
 						   job,
 						   NULL);
 
@@ -6351,7 +6278,7 @@ mark_trusted_job (GIOSchedulerJob *io_job,
 }
 
 void
-nautilus_file_mark_desktop_file_trusted (GFile *file,
+nautilus_file_mark_desktop_file_executable (GFile *file,
 					 GtkWindow *parent_window,
 					 gboolean interactive,
 					 NautilusOpCallback done_callback,
@@ -6365,7 +6292,7 @@ nautilus_file_mark_desktop_file_trusted (GFile *file,
 	job->done_callback = done_callback;
 	job->done_callback_data = done_callback_data;
 	
-	g_io_scheduler_push_job (mark_trusted_job,
+    g_io_scheduler_push_job (mark_executable_job,
 				 job,
 				 NULL,
 				 0,
diff --git a/libnautilus-private/nautilus-file-operations.h b/libnautilus-private/nautilus-file-operations.h
index 9d1410e..f9efd17 100644
--- a/libnautilus-private/nautilus-file-operations.h
+++ b/libnautilus-private/nautilus-file-operations.h
@@ -124,7 +124,7 @@ void nautilus_file_operations_link      (GList                *files,
 					 GtkWindow            *parent_window,
 					 NautilusCopyCallback  done_callback,
 					 gpointer              done_callback_data);
-void nautilus_file_mark_desktop_file_trusted (GFile           *file,
+void nautilus_file_mark_desktop_file_executable (GFile           *file,
 					      GtkWindow        *parent_window,
 					      gboolean          interactive,
 					      NautilusOpCallback done_callback,
diff --git a/libnautilus-private/nautilus-metadata.c b/libnautilus-private/nautilus-metadata.c
index cc56094..94262a6 100644
--- a/libnautilus-private/nautilus-metadata.c
+++ b/libnautilus-private/nautilus-metadata.c
@@ -57,6 +57,7 @@ static char *used_metadata_names[] = {
   NAUTILUS_METADATA_KEY_CUSTOM_ICON,
   NAUTILUS_METADATA_KEY_SCREEN,
   NAUTILUS_METADATA_KEY_EMBLEMS,
+  NAUTILUS_METADATA_KEY_DESKTOP_FILE_TRUSTED,
   NULL
 };
 
diff --git a/libnautilus-private/nautilus-metadata.h b/libnautilus-private/nautilus-metadata.h
index 830a826..de06b99 100644
--- a/libnautilus-private/nautilus-metadata.h
+++ b/libnautilus-private/nautilus-metadata.h
@@ -73,6 +73,7 @@
 #define NAUTILUS_METADATA_KEY_CUSTOM_ICON                	"custom-icon"
 #define NAUTILUS_METADATA_KEY_SCREEN				"screen"
 #define NAUTILUS_METADATA_KEY_EMBLEMS				"emblems"
+#define NAUTILUS_METADATA_KEY_DESKTOP_FILE_TRUSTED  "trusted"
 
 /* This is where desktop item metadata are stored in gconf */
 #define NAUTILUS_DESKTOP_METADATA_GCONF_PATH "/apps/nautilus/desktop-metadata"
diff --git a/libnautilus-private/nautilus-mime-actions.c b/libnautilus-private/nautilus-mime-actions.c
index 45701c3..26b4bc6 100644
--- a/libnautilus-private/nautilus-mime-actions.c
+++ b/libnautilus-private/nautilus-mime-actions.c
@@ -90,7 +90,6 @@ typedef struct {
 #define RESPONSE_RUN 1000
 #define RESPONSE_DISPLAY 1001
 #define RESPONSE_RUN_IN_TERMINAL 1002
-#define RESPONSE_MARK_TRUSTED 1003
 
 #define SILENT_WINDOW_OPEN_LIMIT 5
 
@@ -1490,7 +1489,28 @@ untrusted_launcher_response_callback (GtkDialog *dialog,
 	GFile *file;
 	
 	switch (response_id) {
-	case RESPONSE_RUN:
+    case GTK_RESPONSE_OK:
+        file = nautilus_file_get_location (parameters->file);
+
+        /* We need to do this in order to prevent malicious desktop files
+         * with the executable bit already set.
+         * See https://bugzilla.gnome.org/show_bug.cgi?id=777991
+         */
+        nautilus_file_set_metadata (parameters->file, NAUTILUS_METADATA_KEY_DESKTOP_FILE_TRUSTED,
+                                    NULL,
+                                    "yes");
+
+        nautilus_file_mark_desktop_file_executable (file,
+                                                    parameters->parent_window,
+                                                    TRUE,
+                                                    NULL, NULL);
+
+        /* Need to force a reload of the attributes so is_trusted is marked
+         * correctly. Not sure why the general monitor doesn't fire in this
+         * case when setting the metadata
+         */
+        nautilus_file_invalidate_all_attributes (parameters->file);
+
 		screen = gtk_widget_get_screen (GTK_WIDGET (parameters->parent_window));
 		uri = nautilus_file_get_uri (parameters->file);
 		nautilus_debug_log (FALSE, NAUTILUS_DEBUG_LOG_DOMAIN_USER,
@@ -1499,13 +1519,6 @@ untrusted_launcher_response_callback (GtkDialog *dialog,
 		nautilus_launch_desktop_file (screen, uri, NULL,
 					      parameters->parent_window);
 		g_free (uri);
-		break;
-	case RESPONSE_MARK_TRUSTED:
-		file = nautilus_file_get_location (parameters->file);
-		nautilus_file_mark_desktop_file_trusted (file,
-							 parameters->parent_window,
-							 TRUE, 
-							 NULL, NULL);
 		g_object_unref (file);
 		break;
 	default:
@@ -1553,14 +1566,11 @@ activate_desktop_file (ActivateParameters *parameters,
 					       primary,
 					       secondary);
 		gtk_dialog_add_button (GTK_DIALOG (dialog),
-				       _("_Launch Anyway"), RESPONSE_RUN);
+                       _("_Cancel"), GTK_RESPONSE_CANCEL);
 		if (nautilus_file_can_set_permissions (file)) {
 			gtk_dialog_add_button (GTK_DIALOG (dialog),
-					       _("Mark as _Trusted"), RESPONSE_MARK_TRUSTED);
+                           _("Trust and _Launch"), GTK_RESPONSE_OK);
 		}
-		gtk_dialog_add_button (GTK_DIALOG (dialog),
-				       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-		gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
 
 		g_signal_connect (dialog, "response",
 				  G_CALLBACK (untrusted_launcher_response_callback),
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 8221432..d6e1b4d 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -481,59 +481,6 @@ automount_all_volumes_idle_cb (gpointer data)
 	return FALSE;
 }
 
-static void
-mark_desktop_files_trusted (void)
-{
-	char *do_once_file;
-	GFile *f, *c;
-	GFileEnumerator *e;
-	GFileInfo *info;
-	const char *name;
-	int fd;
-	
-	do_once_file = g_build_filename (g_get_user_data_dir (),
-					 ".converted-launchers", NULL);
-
-	if (g_file_test (do_once_file, G_FILE_TEST_EXISTS)) {
-		goto out;
-	}
-
-	f = nautilus_get_desktop_location ();
-	e = g_file_enumerate_children (f,
-				       G_FILE_ATTRIBUTE_STANDARD_TYPE ","
-				       G_FILE_ATTRIBUTE_STANDARD_NAME ","
-				       G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE
-				       ,
-				       G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
-				       NULL, NULL);
-	if (e == NULL) {
-		goto out2;
-	}
-	
-	while ((info = g_file_enumerator_next_file (e, NULL, NULL)) != NULL) {
-		name = g_file_info_get_name (info);
-		
-		if (g_str_has_suffix (name, ".desktop") &&
-		    !g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE)) {
-			c = g_file_get_child (f, name);
-			nautilus_file_mark_desktop_file_trusted (c,
-								 NULL, FALSE,
-								 NULL, NULL);
-			g_object_unref (c);
-		}
-		g_object_unref (info);
-	}
-	
-	g_object_unref (e);
- out2:
-	fd = g_creat (do_once_file, 0666);
-	close (fd);
-	
-	g_object_unref (f);
- out:	
-	g_free (do_once_file);
-}
-
 #define CK_NAME "org.freedesktop.ConsoleKit"
 #define CK_PATH "/org/freedesktop/ConsoleKit"
 
@@ -635,10 +582,6 @@ do_upgrades_once (NautilusApplication *application,
 	char *metafile_dir, *updated;
 	int fd;
 
-	if (!no_desktop) {
-		mark_desktop_files_trusted ();
-	}
-
 	metafile_dir = g_build_filename (g_get_home_dir (),
 					 ".nautilus/metafiles", NULL);
 	if (g_file_test (metafile_dir, G_FILE_TEST_IS_DIR)) {
@@ -661,7 +604,7 @@ finish_startup (NautilusApplication *application,
 {
 	GList *drives;
 
-	do_upgrades_once (application, no_desktop);
+    do_upgrades_once (application, no_desktop);
 	
 	/* initialize nautilus modules */
 	nautilus_module_setup ();
