do not load extensions from startup directory
This commit is contained in:
@@ -4,7 +4,6 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel.Composition;
|
using System.ComponentModel.Composition;
|
||||||
using System.ComponentModel.Composition.Hosting;
|
using System.ComponentModel.Composition.Hosting;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
using static mpvnet.Global;
|
using static mpvnet.Global;
|
||||||
|
|
||||||
@@ -22,25 +21,7 @@ namespace mpvnet
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
AggregateCatalog catalog = new AggregateCatalog();
|
AggregateCatalog catalog = new AggregateCatalog();
|
||||||
string dir = Folder.Startup + "Extensions";
|
string dir = Core.ConfigFolder + "extensions";
|
||||||
|
|
||||||
if (Directory.Exists(dir))
|
|
||||||
{
|
|
||||||
string[] knownExtensions = { "RatingExtension", "ScriptingExtension" };
|
|
||||||
|
|
||||||
foreach (string extDir in Directory.GetDirectories(dir))
|
|
||||||
{
|
|
||||||
if (knownExtensions.Contains(Path.GetFileName(extDir)))
|
|
||||||
catalog.Catalogs.Add(new DirectoryCatalog(extDir, Path.GetFileName(extDir) + ".dll"));
|
|
||||||
else
|
|
||||||
Terminal.WriteError("Failed to load extension:" + BR2 + extDir +
|
|
||||||
BR2 + "Only extensions that ship with mpv.net are allowed in <startup>\\extensions" +
|
|
||||||
BR2 + "User extensions have to use <config folder>\\extensions" +
|
|
||||||
BR2 + "Never copy or install a new mpv.net version over a old mpv.net version.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dir = Core.ConfigFolder + "extensions";
|
|
||||||
|
|
||||||
if (Directory.Exists(dir))
|
if (Directory.Exists(dir))
|
||||||
foreach (string extDir in Directory.GetDirectories(dir))
|
foreach (string extDir in Directory.GetDirectories(dir))
|
||||||
|
|||||||
Reference in New Issue
Block a user