public bool UpdateAllPlugins(PluginItemCollection installedPlugins, bool silent = false)
        {
            var success = false;
            foreach (var plugin in installedPlugins.Items.Where(p => p.UpdateAvailable))
            {
                if (!silent) _appRef.ProgressBox("Updating " + plugin.Name + "...");
                if (InstallPlugin(new RemotePlugin
                                      {
                                          SourceFilename = plugin.ValidVersions.OrderBy(v => v.version).Last().sourceUrl,
                                          Filename = plugin.TargetFilename
                                      }))
                {
                    plugin.UpdateAvailable = false;
                    plugin.UpdatePending = true;
                    success = true;
                    WriteToUpdateLog(String.Format("Plug-in {0} Updated to version {1} by user {2}", plugin.Name, plugin.ValidVersions.OrderBy(v => v.version).Last().versionStr, Kernel.CurrentUser.Name));
                }
                if (!silent) _appRef.ShowMessage = false;
            }

            installedPlugins.ResetUpdatesAvailable();
            return success;
        }
Example #2
0
        public bool UpdateAllPlugins(PluginItemCollection installedPlugins)
        {
            var success = false;
            foreach (var plugin in installedPlugins.Items.Where(p => p.UpdateAvailable))
            {
                _appRef.ProgressBox("Updating " + plugin.Name + "...");
                if (InstallPlugin(new RemotePlugin
                                      {
                                          SourceFilename = plugin.Versions.OrderBy(v => v.version).Last().sourceUrl,
                                          Filename = plugin.TargetFilename
                                      }))
                {
                    plugin.UpdateAvailable = false;
                    plugin.UpdatePending = true;
                    success = true;
                }
                _appRef.ShowMessage = false;
            }

            installedPlugins.ResetUpdatesAvailable();
            return success;
        }