Update: Install Plugin (or Update)

Check to update the plugin when installing to avoid
uninstall->wait->install cycle.
This commit is contained in:
Gary Sharp
2013-10-21 20:50:31 +11:00
parent 401ae029f1
commit cc218a08e4
4 changed files with 29 additions and 6 deletions
@@ -51,7 +51,7 @@ namespace Disco.Services.Plugins
}
this.Status.Finished("Restarting Disco, please wait...", "/Config/Plugins");
Plugins.RestartApp(1500);
Plugins.RestartApp(2500);
}
public static ScheduledTaskStatus UninstallPlugin(PluginManifest Manifest, bool UninstallData)
+3 -3
View File
@@ -79,7 +79,7 @@ namespace Disco.Services.Plugins
ExecuteTaskInternal(this.Status, pluginPackagesLocation, updatePlugins);
this.Status.Finished("Restarting Disco, please wait...", "/Config/Plugins");
Plugins.RestartApp(1500);
Plugins.RestartApp(2500);
}
public static List<PluginManifest> OfflineInstalledPlugins(DiscoDataContext Database)
@@ -226,8 +226,8 @@ namespace Disco.Services.Plugins
// Ensure not already installed
if (existingManifest != null)
if (updateManifest.Version <= existingManifest.Version)
throw new InvalidOperationException("Only newer versions can be used to update a plugin");
if (updateManifest.Version < existingManifest.Version)
throw new InvalidOperationException("Older versions cannot update existing plugins");
Status.UpdateStatus(20, string.Format("{0} [{1} v{2}] by {3}", updateManifest.Name, updateManifest.Id, updateManifest.Version.ToString(4), updateManifest.Author), "Initializing Update Environment");
@@ -32,7 +32,7 @@ namespace Disco.Services.Plugins
// Restart
this.Status.Finished("Restarting Disco, please wait...", "/");
Plugins.RestartApp(1500);
Plugins.RestartApp(2500);
}
public static ScheduledTaskStatus UpdateDiscoPlugins(bool ReturnExistingStatusIfRunning)