Gate non-core compatible includes

This commit is contained in:
Matt Nadareski
2020-10-31 23:17:03 -07:00
parent 8624350b82
commit 64e67b8daa
3 changed files with 19 additions and 5 deletions

View File

@@ -21,15 +21,18 @@
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'!='netcoreapp3.1'">
<DefineConstants>NET_FRAMEWORK</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LessIO" Version="0.6.16" />
<PackageReference Include="libmspack4n" Version="0.9.10" />
<PackageReference Include="LessIO" Version="1.0.34" Condition="'$(TargetFramework)'!='netcoreapp3.1'" />
<PackageReference Include="libmspack4n" Version="0.9.10" Condition="'$(TargetFramework)'!='netcoreapp3.1'" />
<PackageReference Include="SharpCompress" Version="0.26.0" />
<PackageReference Include="UnshieldSharp" Version="1.4.2.3" />
<PackageReference Include="WiseUnpacker" Version="1.0.1" />
<PackageReference Include="wix-libs" Version="3.11.1" />
<PackageReference Include="zlib.net" Version="1.0.4" />
<PackageReference Include="wix-libs" Version="3.11.1" Condition="'$(TargetFramework)'!='netcoreapp3.1'" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
#if NET_FRAMEWORK
using Microsoft.Deployment.WindowsInstaller;
#endif
namespace BurnOutSharp.FileType
{
@@ -9,8 +11,10 @@ namespace BurnOutSharp.FileType
{
public static bool ShouldScan(byte[] magic)
{
#if NET_FRAMEWORK
if (magic.StartsWith(new byte[] { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }))
return true;
#endif
return false;
}
@@ -18,6 +22,7 @@ namespace BurnOutSharp.FileType
// TODO: Add stream opening support
public static Dictionary<string, List<string>> Scan(Scanner scanner, string file)
{
#if NET_FRAMEWORK
// If the MSI file itself fails
try
{
@@ -45,6 +50,7 @@ namespace BurnOutSharp.FileType
return protections;
}
catch { }
#endif
return null;
}

View File

@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
#if NET_FRAMEWORK
using LibMSPackN;
#endif
namespace BurnOutSharp.FileType
{
@@ -9,8 +11,10 @@ namespace BurnOutSharp.FileType
{
public static bool ShouldScan(byte[] magic)
{
#if NET_FRAMEWORK
if (magic.StartsWith(new byte[] { 0x4d, 0x53, 0x43, 0x46 }))
return true;
#endif
return false;
}
@@ -18,6 +22,7 @@ namespace BurnOutSharp.FileType
// TODO: Add stream opening support
public static Dictionary<string, List<string>> Scan(Scanner scanner, string file)
{
#if NET_FRAMEWORK
// If the cab file itself fails
try
{
@@ -54,7 +59,7 @@ namespace BurnOutSharp.FileType
return protections;
}
catch { }
#endif
return null;
}
}