Updated
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -94,7 +93,7 @@ public class Program
|
||||
await StartNoGui();
|
||||
try
|
||||
{
|
||||
internalActionManager = new InternalActionManager("./Data/Plugins", "*.dll");
|
||||
internalActionManager = new InternalActionManager(AppSettings["PluginFolder"], "*.dll");
|
||||
NoGUI();
|
||||
}
|
||||
catch (IOException ex)
|
||||
|
||||
@@ -40,6 +40,8 @@ public class Config
|
||||
|
||||
AppSettings["PluginDatabase"] = "./Data/Resources/plugins.json";
|
||||
|
||||
ArchiveManager.Initialize();
|
||||
|
||||
if (!File.Exists(AppSettings["PluginDatabase"]))
|
||||
{
|
||||
List<PluginInfo> plugins = new();
|
||||
@@ -62,7 +64,7 @@ public class Config
|
||||
AppSettings["LogFolder"] + $"/{DateTime.Today.ToShortDateString().Replace("/", "")}.log"
|
||||
);
|
||||
|
||||
ArchiveManager.Initialize();
|
||||
|
||||
|
||||
UX.UxHandler.Init();
|
||||
_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -23,6 +23,24 @@ public static class ArchiveManager
|
||||
|
||||
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>
|
||||
/// Read a file from a zip archive. The output is a byte array
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using PluginManager.Interfaces.Logger;
|
||||
|
||||
@@ -31,6 +32,7 @@ public sealed class Logger: ILogger
|
||||
IsEnabled = true;
|
||||
LowestLogLevel = lowestLogLevel;
|
||||
OutputFile = null;
|
||||
|
||||
}
|
||||
|
||||
public event EventHandler<Log>? OnLog;
|
||||
|
||||
Reference in New Issue
Block a user