Disable StormLibSharp for .NET 6.0

This commit is contained in:
Matt Nadareski
2022-12-22 21:58:26 -08:00
parent 609c30da38
commit e2098f6f71
3 changed files with 11 additions and 4 deletions

View File

@@ -49,7 +49,7 @@
</ItemGroup>
<ItemGroup>
<None Include="*.dll" Pack="true">
<None Include="*.dll" Pack="true" Condition="'$(TargetFramework)' != 'net6.0'">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>

View File

@@ -2,7 +2,9 @@
using System.Collections.Concurrent;
using System.IO;
using BurnOutSharp.Interfaces;
#if NETSTANDARD2_0
using StormLibSharp;
#endif
using static BurnOutSharp.Utilities.Dictionary;
namespace BurnOutSharp.FileType
@@ -28,7 +30,11 @@ namespace BurnOutSharp.FileType
/// <inheritdoc/>
public ConcurrentDictionary<string, ConcurrentQueue<string>> Scan(Scanner scanner, Stream stream, string file)
{
// If the mpq file itself fails
#if NET6_0_OR_GREATER
// Not supported for .NET 6.0 due to Windows DLL requirements
return null;
#else
// If the MPQ file itself fails
try
{
string tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
@@ -94,6 +100,7 @@ namespace BurnOutSharp.FileType
}
return null;
#endif
}
}
}

View File

@@ -11,10 +11,10 @@ In addition to the original BurnOut code, the following libraries (or ports ther
- [openmcdf](https://github.com/ironfede/openmcdf) - MSI extraction
- [psxt001z](https://github.com/Dremora/psxt001z) - PS1 LibCrypt detection [Ported to C#]
- [SharpCompress](https://github.com/adamhathcock/sharpcompress) - 7zip/GZip/RAR/PKZIP extraction
- [StormLibSharp](https://github.com/robpaveza/stormlibsharp) - MPQ extraction
- [StormLibSharp](https://github.com/robpaveza/stormlibsharp) - MPQ extraction [Unused in .NET 6.0 builds due to Windows-specific libraries]
- [UnshieldSharp](https://github.com/mnadareski/UnshieldSharp) - InstallShield CAB extraction
- [WiseUnpacker](https://github.com/mnadareski/WiseUnpacker) - Wise Installer extraction
- [WixToolset.Dtf](https://github.com/wixtoolset/Dtf) - Microsoft CAB extraction [Unused in .NET 6.0 builds]
- [WixToolset.Dtf](https://github.com/wixtoolset/Dtf) - Microsoft CAB extraction [Unused in .NET 6.0 builds due to Windows-specific libraries]
Please note that due to current library limitations, the functionality of StormLibSharp is locked to Windows only.