Updated
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -94,7 +93,7 @@ public class Program
|
|||||||
await StartNoGui();
|
await StartNoGui();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
internalActionManager = new InternalActionManager("./Data/Plugins", "*.dll");
|
internalActionManager = new InternalActionManager(AppSettings["PluginFolder"], "*.dll");
|
||||||
NoGUI();
|
NoGUI();
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ public class Config
|
|||||||
|
|
||||||
AppSettings["PluginDatabase"] = "./Data/Resources/plugins.json";
|
AppSettings["PluginDatabase"] = "./Data/Resources/plugins.json";
|
||||||
|
|
||||||
|
ArchiveManager.Initialize();
|
||||||
|
|
||||||
if (!File.Exists(AppSettings["PluginDatabase"]))
|
if (!File.Exists(AppSettings["PluginDatabase"]))
|
||||||
{
|
{
|
||||||
List<PluginInfo> plugins = new();
|
List<PluginInfo> plugins = new();
|
||||||
@@ -62,7 +64,7 @@ public class Config
|
|||||||
AppSettings["LogFolder"] + $"/{DateTime.Today.ToShortDateString().Replace("/", "")}.log"
|
AppSettings["LogFolder"] + $"/{DateTime.Today.ToShortDateString().Replace("/", "")}.log"
|
||||||
);
|
);
|
||||||
|
|
||||||
ArchiveManager.Initialize();
|
|
||||||
|
|
||||||
UX.UxHandler.Init();
|
UX.UxHandler.Init();
|
||||||
_isLoaded = true;
|
_isLoaded = true;
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
using PluginManager.Interfaces.Updater;
|
|
||||||
|
|
||||||
namespace PluginManager.Online.Helpers;
|
|
||||||
|
|
||||||
public class ApplicationVersion: Version
|
|
||||||
{
|
|
||||||
|
|
||||||
public ApplicationVersion(int major, int minor, int patch): base(major, minor, patch)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public ApplicationVersion(string versionAsString): base(versionAsString)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -24,6 +24,24 @@ public static class ArchiveManager
|
|||||||
IsInitialized = true;
|
IsInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static async Task CreateFromFile(string file, string folder)
|
||||||
|
{
|
||||||
|
if(!IsInitialized) throw new Exception("ArchiveManager is not initialized");
|
||||||
|
|
||||||
|
if (!Directory.Exists(folder))
|
||||||
|
Directory.CreateDirectory(folder);
|
||||||
|
|
||||||
|
var archiveName = folder + Path.GetFileNameWithoutExtension(file) + ".zip";
|
||||||
|
if (File.Exists(archiveName))
|
||||||
|
File.Delete(archiveName);
|
||||||
|
|
||||||
|
using(ZipArchive archive = ZipFile.Open(archiveName, ZipArchiveMode.Create))
|
||||||
|
{
|
||||||
|
archive.CreateEntryFromFile(file, Path.GetFileName(file));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Read a file from a zip archive. The output is a byte array
|
/// Read a file from a zip archive. The output is a byte array
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using PluginManager.Interfaces.Logger;
|
using PluginManager.Interfaces.Logger;
|
||||||
|
|
||||||
@@ -31,6 +32,7 @@ public sealed class Logger: ILogger
|
|||||||
IsEnabled = true;
|
IsEnabled = true;
|
||||||
LowestLogLevel = lowestLogLevel;
|
LowestLogLevel = lowestLogLevel;
|
||||||
OutputFile = null;
|
OutputFile = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public event EventHandler<Log>? OnLog;
|
public event EventHandler<Log>? OnLog;
|
||||||
|
|||||||
Reference in New Issue
Block a user