mirror of
https://github.com/ZuneDev/ZuneShell.dll.git
synced 2026-07-27 13:11:51 -07:00
Make ZuneHost report errors on old systems
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<startup useLegacyV2RuntimeActivationPolicy="true">
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
|
||||
</startup>
|
||||
</configuration>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
namespace ZuneHost
|
||||
@@ -13,6 +15,12 @@ namespace ZuneHost
|
||||
{
|
||||
string strArgs = string.Join(" ", args);
|
||||
|
||||
#if NETFRAMEWORK
|
||||
Console.WriteLine("Running legacy build on .NET Framework. If your OS supports .NET Core, please use OpenZune.");
|
||||
#endif
|
||||
|
||||
if (args.Contains("--copyFiles", StringComparer.InvariantCultureIgnoreCase))
|
||||
{
|
||||
// Make sure that ZuneDBApi can find all the Zune native libraries
|
||||
Console.WriteLine("Copying Zune files...");
|
||||
_zuneProgramDir = new(Path.Combine(
|
||||
@@ -38,11 +46,27 @@ namespace ZuneHost
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Starting Zune...");
|
||||
|
||||
try
|
||||
{
|
||||
return Microsoft.Zune.Shell.ZuneApplication.Launch(strArgs, IntPtr.Zero);
|
||||
}
|
||||
catch (FileNotFoundException ex)
|
||||
{
|
||||
Console.WriteLine(ex.FileName);
|
||||
throw;
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debugger.Launch();
|
||||
Debugger.Break();
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void CopyAll(DirectoryInfo source, DirectoryInfo target)
|
||||
{
|
||||
|
||||
@@ -2,11 +2,17 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>net6.0-windows10.0.22000;net6.0;net40</TargetFrameworks>
|
||||
<TargetFrameworks>net40;net6.0-windows10.0.22000;net6.0;</TargetFrameworks>
|
||||
<Platforms>AnyCPU;x64;x86;ARM32</Platforms>
|
||||
<LangVersion>11.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="build\**" />
|
||||
<EmbeddedResource Remove="build\**" />
|
||||
<None Remove="build\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ZuneShell\ZuneShell.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user