v1.2
This commit is contained in:
24
FSI.BT.Tools/Global/Utilities/ExtractEmbeddedZip.cs
Normal file
24
FSI.BT.Tools/Global/Utilities/ExtractEmbeddedZip.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FSI.BT.Tools.Global.Utilities
|
||||
{
|
||||
internal static class ExtractEmbeddedZip
|
||||
{
|
||||
internal static void Extract(string zipName, string destPath)
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(destPath); // Erstellt alle fehlenden Verzeichnisse
|
||||
using Stream _pluginZipResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(zipName);
|
||||
using ZipArchive zip = new(_pluginZipResourceStream);
|
||||
zip.ExtractToDirectory(destPath, true);
|
||||
Vars.Log.Info("Externes Tool \"{0}\" wurde in das Verzeichnis \"{1}\" entpackt", zipName, destPath);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user