private void BeginClean(string root)
        {
            foreach (string directory in Directory.GetDirectories(root))
            {
                BeginClean(directory);
            }

            foreach (string extention in ExtraFileExtentions)
            {
                foreach (string file in Directory.GetFiles(root, extention))
                {
                    var args = new AppVersionUpdateProgress {HasError = false, Message = string.Format("Eliminando Archivo {0}",Path.GetFileName(file))};
                    InvokeProgressChanged(args);
                    File.Delete(file);
                }
            }
        }
        public override void RunUpdate()
        {
            AppVersionUpdateProgress progress = new AppVersionUpdateProgress
            {
                CanRetry = true
            };
            int count = 0;
            while (count < KRetries && progress.CanRetry)
            {
                progress.HasError = false;
                progress.Message = string.Empty;
                try
                {
                    BeginCopy(RootDir, Environment.CurrentDirectory);
                    Directory.Delete(RootDir, true);
                    progress.Message = string.Format("Actualización a version {0} completa", Version);
                    InvokeProgressChange(progress);
                    break;
                }
                catch (Exception ex)
                {
                    progress.Message = ex.Message;
                    progress.HasError = true;
                    InvokeProgressChange(progress);
                    Trace.TraceError(ex.ToString());
                    count++;
                    Thread.Sleep(500);
                }
            }

            if ( count == KRetries || (!progress.CanRetry && progress.HasError))
            {
                Trace.TraceError(string.Format("Luego de {0} intentos, no ha sido posible actualizar la app con la version {1}", KRetries, Version));
                progress.Message = string.Format("Luego de {0} intentos, no ha sido posible actualizar la aplicación con la version {1}", KRetries, Version);
                InvokeProgressChange(progress);
            }
        }
 protected void InvokeProgressChanged(AppVersionUpdateProgress e)
 {
     EventHandler<AppVersionUpdateProgress> handler = ProgressChanged;
     if (handler != null) handler(this, e);
 }