[vlc-devel] commit: Launch the installer after download (Geoffroy Couprie )

git version control git at videolan.org
Sat Feb 27 13:55:31 CET 2010


vlc | branch: master | Geoffroy Couprie <geal at videolan.org> | Sat Feb 27 13:55:01 2010 +0100| [8e9cdc1579df7dce26ccb796157d654faf4065f8] | committer: Geoffroy Couprie 

Launch the installer after download

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8e9cdc1579df7dce26ccb796157d654faf4065f8
---

 src/misc/update.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/misc/update.c b/src/misc/update.c
index eea3663..315223a 100644
--- a/src/misc/update.c
+++ b/src/misc/update.c
@@ -48,10 +48,13 @@
 #include <vlc_strings.h>
 #include <vlc_fs.h>
 #include <vlc_dialog.h>
+#include <vlc_interface.h>
 
 #include <gcrypt.h>
 #include <vlc_gcrypt.h>
 
+#include <shellapi.h>
+
 #include "update.h"
 #include "../libvlc.h"
 
@@ -729,6 +732,16 @@ static void* update_DownloadReal( vlc_object_t *p_this )
     msg_Info( p_udt, "%s authenticated", psz_destfile );
     free( p_hash );
 
+    int answer = dialog_Question( p_udt, _("Update VLC media player"),
+    _("The new version was successfully downloaded. Do you want to close VLC and install it now?"),
+    _("Install"), _("Cancel"), NULL);
+
+    if(answer == 1)
+    {
+        answer = ShellExecuteA( NULL, "open", psz_destfile, NULL, NULL, SW_SHOW);
+        if(answer > 32)
+            libvlc_Quit(p_this->p_libvlc);
+    }
 end:
     if( p_progress )
         dialog_ProgressDestroy( p_progress );




More information about the vlc-devel mailing list