Bug Fix #53: Plugin install fails when dll loaded
This commit is contained in:
@@ -1,14 +1,11 @@
|
|||||||
using System;
|
using Disco.Data.Repository;
|
||||||
using System.Collections.Generic;
|
using Disco.Services.Tasks;
|
||||||
|
using Quartz;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Disco.Data.Repository;
|
|
||||||
using Disco.Services.Tasks;
|
|
||||||
using Quartz;
|
|
||||||
|
|
||||||
namespace Disco.Services.Plugins
|
namespace Disco.Services.Plugins
|
||||||
{
|
{
|
||||||
@@ -109,7 +106,14 @@ namespace Disco.Services.Plugins
|
|||||||
if (Directory.Exists(packagePath))
|
if (Directory.Exists(packagePath))
|
||||||
{
|
{
|
||||||
this.Status.UpdateStatus(25, "Removing Existing Files");
|
this.Status.UpdateStatus(25, "Removing Existing Files");
|
||||||
Directory.Delete(packagePath, true);
|
try
|
||||||
|
{
|
||||||
|
Directory.Delete(packagePath, true);
|
||||||
|
}
|
||||||
|
catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Unable to delete existing plugin files, they may be locked by another process. Please restart Disco ICT and try installing the plugin again.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Directory.CreateDirectory(packagePath);
|
Directory.CreateDirectory(packagePath);
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
using System;
|
using Disco.Data.Repository;
|
||||||
|
using Disco.Models.BI.Interop.Community;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Disco.Data.Repository;
|
|
||||||
using System.IO.Compression;
|
|
||||||
using Disco.Models.BI.Interop.Community;
|
|
||||||
using System.Web;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
namespace Disco.Services.Plugins
|
namespace Disco.Services.Plugins
|
||||||
{
|
{
|
||||||
@@ -482,12 +480,6 @@ namespace Disco.Services.Plugins
|
|||||||
packageManifest = PluginManifest.FromPluginManifestFile(packageManifestStream);
|
packageManifest = PluginManifest.FromPluginManifestFile(packageManifestStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ExistingManifest.Version == packageManifest.Version)
|
|
||||||
{
|
|
||||||
// Skip Update if already installed
|
|
||||||
PluginsLog.LogInitializeWarning(string.Format("This plugin [{0}] version [{1}] is already installed, skipping Update", ExistingManifest.Id, ExistingManifest.Version));
|
|
||||||
return ExistingManifest;
|
|
||||||
}
|
|
||||||
if (ExistingManifest.Version > packageManifest.Version)
|
if (ExistingManifest.Version > packageManifest.Version)
|
||||||
{
|
{
|
||||||
throw new InvalidDataException("A newer version of this plugin is already installed");
|
throw new InvalidDataException("A newer version of this plugin is already installed");
|
||||||
|
|||||||
Reference in New Issue
Block a user