Files
NebulaLauncher/Nebula.SharedModels/LauncherRuntimeInfo.cs
2026-01-25 12:01:08 +03:00

23 lines
763 B
C#

using System.Text.Json.Serialization;
namespace Nebula.SharedModels;
public record struct LauncherRuntimeInfo(
[property: JsonPropertyName("version")] string RuntimeVersion,
[property: JsonPropertyName("runtimes")] Dictionary<string, string> DotnetRuntimes);
public static class LauncherManifestEntryHelper
{
public static string GetFullPath(this LauncherRuntimeInfo runtimeInfo)
{
return Path.Join(AppDataPath.RootPath,
$"dotnet.{runtimeInfo.RuntimeVersion}",
DotnetUrlHelper.GetRuntimeIdentifier());
}
public static string GetExecutePath(this LauncherRuntimeInfo runtimeInfo )
{
return Path.Join(GetFullPath(runtimeInfo),
$"dotnet{DotnetUrlHelper.GetExtension()}");
}
}