diff options
| author | Mary <mary@mary.zone> | 2022-03-04 18:03:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-04 18:03:16 +0100 |
| commit | ac21abbb9d23432879b1026eb5bc48ad3d4583d8 (patch) | |
| tree | dc0b99a3caeae4c9bc3b319a875f43a1647836de /Ryujinx.Common/ReleaseInformations.cs | |
| parent | a3dd04deef7d2555726378293df891f3877f4489 (diff) | |
Preparation for initial Flatpack and FlatHub integration (#3173)
* Preparation for initial Flatpack and FlatHub integration
This integrate some initial changes required for Flatpack and distribution from FlatHub.
Also added some resources that will be used for packaging on Linux.
* Address gdkchan comment
Diffstat (limited to 'Ryujinx.Common/ReleaseInformations.cs')
| -rw-r--r-- | Ryujinx.Common/ReleaseInformations.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Ryujinx.Common/ReleaseInformations.cs b/Ryujinx.Common/ReleaseInformations.cs index 32a01948..35890406 100644 --- a/Ryujinx.Common/ReleaseInformations.cs +++ b/Ryujinx.Common/ReleaseInformations.cs @@ -1,10 +1,14 @@ -using System.Reflection; +using Ryujinx.Common.Configuration; +using System; +using System.Reflection; namespace Ryujinx.Common { // DO NOT EDIT, filled by CI public static class ReleaseInformations { + private const string FlatHubChannelOwner = "flathub"; + public static string BuildVersion = "%%RYUJINX_BUILD_VERSION%%"; public static string BuildGitHash = "%%RYUJINX_BUILD_GIT_HASH%%"; public static string ReleaseChannelName = "%%RYUJINX_TARGET_RELEASE_CHANNEL_NAME%%"; @@ -19,6 +23,11 @@ namespace Ryujinx.Common !ReleaseChannelRepo.StartsWith("%%"); } + public static bool IsFlatHubBuild() + { + return IsValid() && ReleaseChannelOwner.Equals(FlatHubChannelOwner); + } + public static string GetVersion() { if (IsValid()) @@ -30,5 +39,15 @@ namespace Ryujinx.Common return Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion; } } + + public static string GetBaseApplicationDirectory() + { + if (IsFlatHubBuild()) + { + return AppDataManager.BaseDirPath; + } + + return AppDomain.CurrentDomain.BaseDirectory; + } } } |
