do not load extensions from startup directory

This commit is contained in:
Frank Skare
2021-05-30 12:25:57 +02:00
parent 57ae0d008b
commit f56502d8f3

View File

@@ -4,7 +4,6 @@ using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.IO;
using System.Linq;
using static mpvnet.Global;
@@ -22,25 +21,7 @@ namespace mpvnet
try
{
AggregateCatalog catalog = new AggregateCatalog();
string dir = Folder.Startup + "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";
string dir = Core.ConfigFolder + "extensions";
if (Directory.Exists(dir))
foreach (string extDir in Directory.GetDirectories(dir))