Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
946633276b | ||
|
baf94e0e3e | ||
|
cf6201a4a6 | ||
|
18909195d1 |
64
.github/workflows/flatpak.yml
vendored
64
.github/workflows/flatpak.yml
vendored
@@ -51,37 +51,75 @@ jobs:
|
|||||||
- name: Restore Nuget packages
|
- name: Restore Nuget packages
|
||||||
# With .NET 8.0.100, Microsoft.NET.ILLink.Tasks isn't restored by default and only seems to appears when publishing.
|
# With .NET 8.0.100, Microsoft.NET.ILLink.Tasks isn't restored by default and only seems to appears when publishing.
|
||||||
# So we just publish to grab the dependencies
|
# So we just publish to grab the dependencies
|
||||||
run: dotnet publish -c Release -r linux-x64 Ryujinx/${{ env.RYUJINX_PROJECT_FILE }} --self-contained
|
run: |
|
||||||
|
dotnet publish -c Release -r linux-x64 Ryujinx/${{ env.RYUJINX_PROJECT_FILE }} --self-contained
|
||||||
|
dotnet publish -c Release -r linux-arm64 Ryujinx/${{ env.RYUJINX_PROJECT_FILE }} --self-contained
|
||||||
|
|
||||||
- name: Generate nuget_sources.json
|
- name: Generate nuget_sources.json
|
||||||
shell: python
|
shell: python
|
||||||
run: |
|
run: |
|
||||||
|
import hashlib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import base64
|
import base64
|
||||||
import binascii
|
import binascii
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import urllib.request
|
||||||
|
|
||||||
sources = []
|
sources = []
|
||||||
|
|
||||||
for path in Path(os.environ['NUGET_PACKAGES']).glob('**/*.nupkg.sha512'):
|
|
||||||
|
def create_source_from_external(name, version):
|
||||||
|
full_dir_path = Path(os.environ["NUGET_PACKAGES"]).joinpath(name).joinpath(version)
|
||||||
|
os.makedirs(full_dir_path, exist_ok=True)
|
||||||
|
|
||||||
|
filename = "{}.{}.nupkg".format(name, version)
|
||||||
|
url = "https://api.nuget.org/v3-flatcontainer/{}/{}/{}".format(
|
||||||
|
name, version, filename
|
||||||
|
)
|
||||||
|
|
||||||
|
print(f"Processing {url}...")
|
||||||
|
response = urllib.request.urlopen(url)
|
||||||
|
sha512 = hashlib.sha512(response.read()).hexdigest()
|
||||||
|
|
||||||
|
return {
|
||||||
|
"type": "file",
|
||||||
|
"url": url,
|
||||||
|
"sha512": sha512,
|
||||||
|
"dest": os.environ["NUGET_SOURCES_DESTDIR"],
|
||||||
|
"dest-filename": filename,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
has_added_x64_apphost = False
|
||||||
|
|
||||||
|
for path in Path(os.environ["NUGET_PACKAGES"]).glob("**/*.nupkg.sha512"):
|
||||||
name = path.parent.parent.name
|
name = path.parent.parent.name
|
||||||
version = path.parent.name
|
version = path.parent.name
|
||||||
filename = '{}.{}.nupkg'.format(name, version)
|
filename = "{}.{}.nupkg".format(name, version)
|
||||||
url = 'https://api.nuget.org/v3-flatcontainer/{}/{}/{}'.format(name, version, filename)
|
url = "https://api.nuget.org/v3-flatcontainer/{}/{}/{}".format(
|
||||||
|
name, version, filename
|
||||||
|
)
|
||||||
|
|
||||||
with path.open() as fp:
|
with path.open() as fp:
|
||||||
sha512 = binascii.hexlify(base64.b64decode(fp.read())).decode('ascii')
|
sha512 = binascii.hexlify(base64.b64decode(fp.read())).decode("ascii")
|
||||||
|
|
||||||
sources.append({
|
sources.append(
|
||||||
'type': 'file',
|
{
|
||||||
'url': url,
|
"type": "file",
|
||||||
'sha512': sha512,
|
"url": url,
|
||||||
'dest': os.environ['NUGET_SOURCES_DESTDIR'],
|
"sha512": sha512,
|
||||||
'dest-filename': filename,
|
"dest": os.environ["NUGET_SOURCES_DESTDIR"],
|
||||||
})
|
"dest-filename": filename,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
with open('flathub/nuget_sources.json', 'w') as fp:
|
# .NET will not add current installed application host to the list, force inject it here.
|
||||||
|
if not has_added_x64_apphost and name.startswith('microsoft.netcore.app.host'):
|
||||||
|
sources.append(create_source_from_external("microsoft.netcore.app.host.linux-x64", version))
|
||||||
|
has_added_x64_apphost = True
|
||||||
|
|
||||||
|
with open("flathub/nuget_sources.json", "w") as fp:
|
||||||
json.dump(sources, fp, indent=4)
|
json.dump(sources, fp, indent=4)
|
||||||
|
|
||||||
- name: Update flatpak metadata
|
- name: Update flatpak metadata
|
||||||
|
@@ -73,6 +73,10 @@
|
|||||||
"GameListContextMenuCreateShortcut": "Create Application Shortcut",
|
"GameListContextMenuCreateShortcut": "Create Application Shortcut",
|
||||||
"GameListContextMenuCreateShortcutToolTip": "Create a Desktop Shortcut that launches the selected Application",
|
"GameListContextMenuCreateShortcutToolTip": "Create a Desktop Shortcut that launches the selected Application",
|
||||||
"GameListContextMenuCreateShortcutToolTipMacOS": "Create a shortcut in macOS's Applications folder that launches the selected Application",
|
"GameListContextMenuCreateShortcutToolTipMacOS": "Create a shortcut in macOS's Applications folder that launches the selected Application",
|
||||||
|
"GameListContextMenuOpenModsDirectory": "Open Mods Directory",
|
||||||
|
"GameListContextMenuOpenModsDirectoryToolTip": "Opens the directory which contains Application's Mods",
|
||||||
|
"GameListContextMenuOpenSdModsDirectory": "Open Atmosphere Mods Directory",
|
||||||
|
"GameListContextMenuOpenSdModsDirectoryToolTip": "Opens the alternative SD card Atmosphere directory which contains Application's Mods. Useful for mods that are packaged for real hardware.",
|
||||||
"StatusBarGamesLoaded": "{0}/{1} Games Loaded",
|
"StatusBarGamesLoaded": "{0}/{1} Games Loaded",
|
||||||
"StatusBarSystemVersion": "System Version: {0}",
|
"StatusBarSystemVersion": "System Version: {0}",
|
||||||
"LinuxVmMaxMapCountDialogTitle": "Low limit for memory mappings detected",
|
"LinuxVmMaxMapCountDialogTitle": "Low limit for memory mappings detected",
|
||||||
|
@@ -51,6 +51,15 @@
|
|||||||
Header="{locale:Locale GameListContextMenuManageMod}"
|
Header="{locale:Locale GameListContextMenuManageMod}"
|
||||||
ToolTip.Tip="{locale:Locale GameListContextMenuManageModToolTip}" />
|
ToolTip.Tip="{locale:Locale GameListContextMenuManageModToolTip}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
|
<MenuItem
|
||||||
|
Click="OpenModsDirectory_Click"
|
||||||
|
Header="{locale:Locale GameListContextMenuOpenModsDirectory}"
|
||||||
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenModsDirectoryToolTip}" />
|
||||||
|
<MenuItem
|
||||||
|
Click="OpenSdModsDirectory_Click"
|
||||||
|
Header="{locale:Locale GameListContextMenuOpenSdModsDirectory}"
|
||||||
|
ToolTip.Tip="{locale:Locale GameListContextMenuOpenSdModsDirectoryToolTip}" />
|
||||||
|
<Separator />
|
||||||
<MenuItem Header="{locale:Locale GameListContextMenuCacheManagement}">
|
<MenuItem Header="{locale:Locale GameListContextMenuCacheManagement}">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Click="PurgePtcCache_Click"
|
Click="PurgePtcCache_Click"
|
||||||
|
@@ -126,6 +126,32 @@ namespace Ryujinx.Ava.UI.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OpenModsDirectory_Click(object sender, RoutedEventArgs args)
|
||||||
|
{
|
||||||
|
var viewModel = (sender as MenuItem)?.DataContext as MainWindowViewModel;
|
||||||
|
|
||||||
|
if (viewModel?.SelectedApplication != null)
|
||||||
|
{
|
||||||
|
string modsBasePath = ModLoader.GetModsBasePath();
|
||||||
|
string titleModsPath = ModLoader.GetApplicationDir(modsBasePath, viewModel.SelectedApplication.TitleId);
|
||||||
|
|
||||||
|
OpenHelper.OpenFolder(titleModsPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OpenSdModsDirectory_Click(object sender, RoutedEventArgs args)
|
||||||
|
{
|
||||||
|
var viewModel = (sender as MenuItem)?.DataContext as MainWindowViewModel;
|
||||||
|
|
||||||
|
if (viewModel?.SelectedApplication != null)
|
||||||
|
{
|
||||||
|
string sdModsBasePath = ModLoader.GetSdModsBasePath();
|
||||||
|
string titleModsPath = ModLoader.GetApplicationDir(sdModsBasePath, viewModel.SelectedApplication.TitleId);
|
||||||
|
|
||||||
|
OpenHelper.OpenFolder(titleModsPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async void OpenModManager_Click(object sender, RoutedEventArgs args)
|
public async void OpenModManager_Click(object sender, RoutedEventArgs args)
|
||||||
{
|
{
|
||||||
var viewModel = (sender as MenuItem)?.DataContext as MainWindowViewModel;
|
var viewModel = (sender as MenuItem)?.DataContext as MainWindowViewModel;
|
||||||
|
@@ -2,6 +2,7 @@ using Ryujinx.Common.Logging;
|
|||||||
using Ryujinx.Common.Utilities;
|
using Ryujinx.Common.Utilities;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Runtime.Versioning;
|
||||||
|
|
||||||
namespace Ryujinx.Common.Configuration
|
namespace Ryujinx.Common.Configuration
|
||||||
{
|
{
|
||||||
@@ -95,18 +96,9 @@ namespace Ryujinx.Common.Configuration
|
|||||||
|
|
||||||
BaseDirPath = Path.GetFullPath(BaseDirPath); // convert relative paths
|
BaseDirPath = Path.GetFullPath(BaseDirPath); // convert relative paths
|
||||||
|
|
||||||
// NOTE: Moves the Ryujinx folder in `~/.config` to `~/Library/Application Support` if one is found
|
if (IsPathSymlink(BaseDirPath))
|
||||||
// and a Ryujinx folder does not already exist in Application Support.
|
|
||||||
// Also creates a symlink from `~/.config/Ryujinx` to `~/Library/Application Support/Ryujinx` to preserve backwards compatibility.
|
|
||||||
// This should be removed in the future.
|
|
||||||
if (OperatingSystem.IsMacOS() && Mode == LaunchMode.UserProfile)
|
|
||||||
{
|
{
|
||||||
string oldConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), DefaultBaseDir);
|
Logger.Warning?.Print(LogClass.Application, $"Application data directory is a symlink. This may be unintended.");
|
||||||
if (Path.Exists(oldConfigPath) && !IsPathSymlink(oldConfigPath) && !Path.Exists(BaseDirPath))
|
|
||||||
{
|
|
||||||
FileSystemUtils.MoveDirectory(oldConfigPath, BaseDirPath);
|
|
||||||
Directory.CreateSymbolicLink(oldConfigPath, BaseDirPath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupBasePaths();
|
SetupBasePaths();
|
||||||
@@ -245,6 +237,82 @@ namespace Ryujinx.Common.Configuration
|
|||||||
return (attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint;
|
return (attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SupportedOSPlatform("macos")]
|
||||||
|
public static void FixMacOSConfigurationFolders()
|
||||||
|
{
|
||||||
|
string oldConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
||||||
|
".config", DefaultBaseDir);
|
||||||
|
if (Path.Exists(oldConfigPath) && !IsPathSymlink(oldConfigPath) && !Path.Exists(BaseDirPath))
|
||||||
|
{
|
||||||
|
FileSystemUtils.MoveDirectory(oldConfigPath, BaseDirPath);
|
||||||
|
Directory.CreateSymbolicLink(oldConfigPath, BaseDirPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
string correctApplicationDataDirectoryPath =
|
||||||
|
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), DefaultBaseDir);
|
||||||
|
if (IsPathSymlink(correctApplicationDataDirectoryPath))
|
||||||
|
{
|
||||||
|
//copy the files somewhere temporarily
|
||||||
|
string tempPath = Path.Combine(Path.GetTempPath(), DefaultBaseDir);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileSystemUtils.CopyDirectory(correctApplicationDataDirectoryPath, tempPath, true);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application,
|
||||||
|
$"Critical error copying Ryujinx application data into the temp folder. {exception}");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileSystemInfo resolvedDirectoryInfo =
|
||||||
|
Directory.ResolveLinkTarget(correctApplicationDataDirectoryPath, true);
|
||||||
|
string resolvedPath = resolvedDirectoryInfo.FullName;
|
||||||
|
Logger.Error?.Print(LogClass.Application, $"Please manually move your Ryujinx data from {resolvedPath} to {correctApplicationDataDirectoryPath}, and remove the symlink.");
|
||||||
|
}
|
||||||
|
catch (Exception symlinkException)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application, $"Unable to resolve the symlink for Ryujinx application data: {symlinkException}. Follow the symlink at {correctApplicationDataDirectoryPath} and move your data back to the Application Support folder.");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//delete the symlink
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//This will fail if this is an actual directory, so there is no way we can actually delete user data here.
|
||||||
|
File.Delete(correctApplicationDataDirectoryPath);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application,
|
||||||
|
$"Critical error deleting the Ryujinx application data folder symlink at {correctApplicationDataDirectoryPath}. {exception}");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileSystemInfo resolvedDirectoryInfo =
|
||||||
|
Directory.ResolveLinkTarget(correctApplicationDataDirectoryPath, true);
|
||||||
|
string resolvedPath = resolvedDirectoryInfo.FullName;
|
||||||
|
Logger.Error?.Print(LogClass.Application, $"Please manually move your Ryujinx data from {resolvedPath} to {correctApplicationDataDirectoryPath}, and remove the symlink.");
|
||||||
|
}
|
||||||
|
catch (Exception symlinkException)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application, $"Unable to resolve the symlink for Ryujinx application data: {symlinkException}. Follow the symlink at {correctApplicationDataDirectoryPath} and move your data back to the Application Support folder.");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//put the files back
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileSystemUtils.CopyDirectory(tempPath, correctApplicationDataDirectoryPath, true);
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Application,
|
||||||
|
$"Critical error copying Ryujinx application data into the correct location. {exception}. Please manually move your application data from {tempPath} to {correctApplicationDataDirectoryPath}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string GetModsPath() => CustomModsPath ?? Directory.CreateDirectory(Path.Combine(BaseDirPath, DefaultModsDir)).FullName;
|
public static string GetModsPath() => CustomModsPath ?? Directory.CreateDirectory(Path.Combine(BaseDirPath, DefaultModsDir)).FullName;
|
||||||
public static string GetSdModsPath() => CustomSdModsPath ?? Directory.CreateDirectory(Path.Combine(BaseDirPath, DefaultSdcardDir, "atmosphere")).FullName;
|
public static string GetSdModsPath() => CustomSdModsPath ?? Directory.CreateDirectory(Path.Combine(BaseDirPath, DefaultSdcardDir, "atmosphere")).FullName;
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current version of the file format
|
/// The current version of the file format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const int CurrentVersion = 48;
|
public const int CurrentVersion = 49;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the configuration file format
|
/// Version of the configuration file format
|
||||||
|
@@ -1430,6 +1430,18 @@ namespace Ryujinx.UI.Common.Configuration
|
|||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (configurationFileFormat.Version < 49)
|
||||||
|
{
|
||||||
|
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 49.");
|
||||||
|
|
||||||
|
if (OperatingSystem.IsMacOS())
|
||||||
|
{
|
||||||
|
AppDataManager.FixMacOSConfigurationFolders();
|
||||||
|
}
|
||||||
|
|
||||||
|
configurationFileUpdated = true;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
||||||
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
||||||
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
||||||
|
Reference in New Issue
Block a user