From 8e9cdc1579df7dce26ccb796157d654faf4065f8 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Sat, 27 Feb 2010 13:55:01 +0100 Subject: [PATCH] Launch the installer after download --- src/misc/update.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/misc/update.c b/src/misc/update.c index eea3663101..315223a5f3 100644 --- a/src/misc/update.c +++ b/src/misc/update.c @@ -48,10 +48,13 @@ #include #include #include +#include #include #include +#include + #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 ); -- 2.39.2