Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/14/11 18:59:42 (14 years ago)
Author:
gkronber
Message:

#1536 implemented feature that checks for plugin updates on each application start and allows to install plugin updates easily. Removed more advanced plugin management features for all users except if it is manually reenabled in the HeuristicLab.config file.

Location:
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/AvailablePluginsView.cs

    r5445 r6413  
    117117    void updateOrInstallPluginsBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) {
    118118      UpdateOrInstallPluginsBackgroundWorkerArgument info = (UpdateOrInstallPluginsBackgroundWorkerArgument)e.Argument;
     119      bool cancelled = false;
    119120      if (info.PluginsToInstall.Count() > 0)
    120         installationManager.Install(info.PluginsToInstall);
     121        installationManager.Install(info.PluginsToInstall, out cancelled);
    121122      if (info.PluginsToUpdate.Count() > 0)
    122         installationManager.Update(info.PluginsToUpdate);
    123 
    124       if (info.PluginsToInstall.Count() > 0 || info.PluginsToUpdate.Count() > 0)
     123        installationManager.Update(info.PluginsToUpdate, out cancelled);
     124
     125      if (!cancelled && (info.PluginsToInstall.Count() > 0 || info.PluginsToUpdate.Count() > 0))
    125126        pluginManager.DiscoverAndCheckPlugins();
    126127    }
     
    176177      var pluginsToInstall = selectedProduct.Plugins.Except(pluginsToUpdate);
    177178
    178       updateOrInstallInfo.PluginsToInstall = 
     179      updateOrInstallInfo.PluginsToInstall =
    179180        pluginsToInstall
    180181        .Cast<IPluginDescription>()
    181182        .ToList();
    182       updateOrInstallInfo.PluginsToUpdate = 
     183      updateOrInstallInfo.PluginsToUpdate =
    183184        pluginsToUpdate
    184185        .Cast<IPluginDescription>()
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/BasicUpdateView.cs

    r5445 r6413  
    7979                            select remotePlugin;
    8080      if (pluginsToUpdate.Count() > 0) {
    81         installationManager.Update(pluginsToUpdate);
    82         pluginManager.DiscoverAndCheckPlugins();
     81        bool cancelled;
     82        installationManager.Update(pluginsToUpdate, out cancelled);
     83        if (!cancelled)
     84          pluginManager.DiscoverAndCheckPlugins();
    8385        e.Cancel = false;
    8486      } else {
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManager.cs

    r5445 r6413  
    9898    /// </summary>
    9999    /// <param name="plugins"></param>
    100     public void Install(IEnumerable<IPluginDescription> plugins) {
     100    public void Install(IEnumerable<IPluginDescription> plugins, out bool cancelled) {
    101101      var args = new PluginInfrastructureCancelEventArgs(plugins);
    102102      OnPreInstall(args);
    103103      if (!args.Cancel) {
     104        cancelled = false;
    104105        var client = DeploymentService.UpdateServiceClientFactory.CreateClient();
    105106        try {
     
    123124          throw new InstallationManagerException("General communication exception in connection to server.", e);
    124125        }
     126      } else {
     127        cancelled = true;
    125128      }
    126129    }
     
    130133    /// </summary>
    131134    /// <param name="plugins"></param>
    132     public void Update(IEnumerable<IPluginDescription> plugins) {
     135    public void Update(IEnumerable<IPluginDescription> plugins, out bool cancelled) {
    133136      PluginInfrastructureCancelEventArgs args = new PluginInfrastructureCancelEventArgs(plugins);
    134137      OnPreUpdate(args);
    135138      if (!args.Cancel) {
     139        cancelled = false;
    136140        var client = DeploymentService.UpdateServiceClientFactory.CreateClient();
    137141        try {
     
    155159          throw new InstallationManagerException("General communication exception in connection to server.", e);
    156160        }
     161      } else {
     162        cancelled = true;
    157163      }
    158164    }
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstalledPluginsView.cs

    r5445 r6413  
    116116                            select remotePlugin;
    117117      if (pluginsToUpdate.Count() > 0) {
    118         installationManager.Update(pluginsToUpdate);
    119       }
    120       pluginManager.DiscoverAndCheckPlugins();
     118        bool cancelled;
     119        installationManager.Update(pluginsToUpdate, out cancelled);
     120        if (!cancelled) pluginManager.DiscoverAndCheckPlugins();
     121      }
    121122    }
    122123
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/Util.cs

    r5445 r6413  
    6666    }
    6767
     68    // compares for two plugins with same major and minor version if plugin1 is newer than plugin2
     69    internal static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
     70      // newer: build version is higher, or if build version is the same revision is higher
     71      return plugin1.Version.Build > plugin2.Version.Build ||
     72        (plugin1.Version.Build == plugin2.Version.Build && plugin1.Version.Revision > plugin2.Version.Revision);
     73    }
    6874  }
    6975}
Note: See TracChangeset for help on using the changeset viewer.