mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-06-28 11:26:24 +02:00
Fix AppDataManager
This commit is contained in:
parent
96b6f475a3
commit
ba3f6abb4c
2 changed files with 32 additions and 3 deletions
|
@ -49,7 +49,16 @@ namespace Ryujinx.Common.Configuration
|
||||||
|
|
||||||
public static void Initialize(string baseDirPath)
|
public static void Initialize(string baseDirPath)
|
||||||
{
|
{
|
||||||
string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
string appDataPath;
|
||||||
|
if (OperatingSystem.IsIOS())
|
||||||
|
{
|
||||||
|
appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (appDataPath.Length == 0)
|
if (appDataPath.Length == 0)
|
||||||
{
|
{
|
||||||
|
@ -137,7 +146,22 @@ namespace Ryujinx.Common.Configuration
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (OperatingSystem.IsMacOS())
|
if (OperatingSystem.IsIOS())
|
||||||
|
{
|
||||||
|
logDir = Path.Combine(BaseDirPath, "Logs");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(logDir);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Application, $"Logging directory could not be created '{logDir}'");
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (OperatingSystem.IsMacOS())
|
||||||
{
|
{
|
||||||
// NOTE: Should evaluate to "~/Library/Logs/Ryujinx/".
|
// NOTE: Should evaluate to "~/Library/Logs/Ryujinx/".
|
||||||
logDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Logs", DefaultBaseDir);
|
logDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Logs", DefaultBaseDir);
|
||||||
|
|
|
@ -35,7 +35,12 @@ namespace Ryujinx.Common
|
||||||
|
|
||||||
public static bool IsReleaseBuild => IsValid && ReleaseChannelName.Equals(ReleaseChannel);
|
public static bool IsReleaseBuild => IsValid && ReleaseChannelName.Equals(ReleaseChannel);
|
||||||
|
|
||||||
public static string Version => IsValid ? BuildVersion : Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
|
public static string Version =>
|
||||||
|
IsValid
|
||||||
|
? BuildVersion
|
||||||
|
: Assembly.GetEntryAssembly()?
|
||||||
|
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
|
||||||
|
.InformationalVersion ?? "iOS";
|
||||||
|
|
||||||
public static string GetChangelogUrl(Version currentVersion, Version newVersion) =>
|
public static string GetChangelogUrl(Version currentVersion, Version newVersion) =>
|
||||||
IsCanaryBuild
|
IsCanaryBuild
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue