Make ZuneHost report errors on old systems

This commit is contained in:
Yoshi Askharoun
2023-04-28 18:53:00 -05:00
parent 1b5eecd837
commit 6e6a965a04
4 changed files with 58 additions and 28 deletions
+1 -1
View File
@@ -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>
+24
View File
@@ -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)
{
+7 -1
View File
@@ -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>