From 8e0e5e0bd9fd3e699a36b6babfacab3c0f61935b Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Wed, 17 Nov 2010 15:20:53 -0800
Subject: [PATCH] CHOP-203 Deleting the update file after installer run.

---
 indra/linux_updater/linux_updater.cpp          | 18 +++++++++---------
 .../updater/scripts/linux/update_install       |  4 +++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/indra/linux_updater/linux_updater.cpp b/indra/linux_updater/linux_updater.cpp
index a7f886b389a..cbdb3ddfe03 100644
--- a/indra/linux_updater/linux_updater.cpp
+++ b/indra/linux_updater/linux_updater.cpp
@@ -403,15 +403,6 @@ gpointer worker_thread_cb(gpointer data)
 		app_state->failure = TRUE;
 	}
 
-	// FIXME: delete package file also if delete-event is raised on window
-	if(!app_state->url.empty() && !app_state->file.empty())
-	{
-		if (gDirUtilp->fileExists(app_state->file))
-		{
-			LLFile::remove(app_state->file);
-		}
-	}
-
 	gdk_threads_enter();
 	updater_app_quit(app_state);
 	gdk_threads_leave();
@@ -824,6 +815,15 @@ int main(int argc, char **argv)
 	gtk_main();
 	gdk_threads_leave();
 
+	// Delete the file only if created from url download.
+	if(!app_state->url.empty() && !app_state->file.empty())
+	{
+		if (gDirUtilp->fileExists(app_state->file))
+		{
+			LLFile::remove(app_state->file);
+		}
+	}
+
 	bool success = app_state->failure != FALSE;
 	delete app_state;
 	return success ? 0 : 1;
diff --git a/indra/viewer_components/updater/scripts/linux/update_install b/indra/viewer_components/updater/scripts/linux/update_install
index 7d8a27607c3..fef5ef7d09a 100755
--- a/indra/viewer_components/updater/scripts/linux/update_install
+++ b/indra/viewer_components/updater/scripts/linux/update_install
@@ -5,4 +5,6 @@ bin/linux-updater.bin --file "$1" --dest "$INSTALL_DIR" --name "Second Life View
 
 if [ $? -ne 0 ]
    then touch $2
-fi
\ No newline at end of file
+fi
+
+rm -f $1
-- 
GitLab