2022-03-04 18:03:16 +01:00
|
|
|
|
using Ryujinx.Common.Configuration;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Reflection;
|
2022-01-24 18:49:14 +01:00
|
|
|
|
|
|
|
|
|
namespace Ryujinx.Common
|
2022-01-22 17:56:09 +01:00
|
|
|
|
{
|
|
|
|
|
// DO NOT EDIT, filled by CI
|
|
|
|
|
public static class ReleaseInformations
|
|
|
|
|
{
|
2022-03-04 18:03:16 +01:00
|
|
|
|
private const string FlatHubChannelOwner = "flathub";
|
|
|
|
|
|
2022-01-22 17:56:09 +01:00
|
|
|
|
public static string BuildVersion = "%%RYUJINX_BUILD_VERSION%%";
|
|
|
|
|
public static string BuildGitHash = "%%RYUJINX_BUILD_GIT_HASH%%";
|
|
|
|
|
public static string ReleaseChannelName = "%%RYUJINX_TARGET_RELEASE_CHANNEL_NAME%%";
|
|
|
|
|
public static string ReleaseChannelOwner = "%%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER%%";
|
|
|
|
|
public static string ReleaseChannelRepo = "%%RYUJINX_TARGET_RELEASE_CHANNEL_REPO%%";
|
|
|
|
|
|
|
|
|
|
public static bool IsValid()
|
|
|
|
|
{
|
|
|
|
|
return !BuildGitHash.StartsWith("%%") &&
|
|
|
|
|
!ReleaseChannelName.StartsWith("%%") &&
|
|
|
|
|
!ReleaseChannelOwner.StartsWith("%%") &&
|
|
|
|
|
!ReleaseChannelRepo.StartsWith("%%");
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-04 18:03:16 +01:00
|
|
|
|
public static bool IsFlatHubBuild()
|
|
|
|
|
{
|
|
|
|
|
return IsValid() && ReleaseChannelOwner.Equals(FlatHubChannelOwner);
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-22 17:56:09 +01:00
|
|
|
|
public static string GetVersion()
|
|
|
|
|
{
|
|
|
|
|
if (IsValid())
|
|
|
|
|
{
|
|
|
|
|
return BuildVersion;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2022-01-24 18:49:14 +01:00
|
|
|
|
return Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
2022-01-22 17:56:09 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-04 18:03:16 +01:00
|
|
|
|
|
|
|
|
|
public static string GetBaseApplicationDirectory()
|
|
|
|
|
{
|
|
|
|
|
if (IsFlatHubBuild())
|
|
|
|
|
{
|
|
|
|
|
return AppDataManager.BaseDirPath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return AppDomain.CurrentDomain.BaseDirectory;
|
|
|
|
|
}
|
2022-01-22 17:56:09 +01:00
|
|
|
|
}
|
|
|
|
|
}
|