mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-11-22 01:43:23 +01:00
Include a start.sh file with correct launch options (#4013)
* Include reference to start.sh to be bundled * Add start.sh * Fix silly mistake I made on windows-x64 * ... I cannot read properly * Make same changes for avalonia csproj * Remove notice from start.sh Co-authored-by: Mary-nyan <thog@protonmail.com> * Update Ryujinx/Ryujinx.csproj Co-authored-by: Mary-nyan <thog@protonmail.com> * Update Ryujinx.Ava/Ryujinx.Ava.csproj Co-authored-by: Mary-nyan <thog@protonmail.com> * Update distribution/linux/start.sh Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update distribution/linux/start.sh Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.Ava/Ryujinx.Ava.csproj Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Update Ryujinx.csproj * Update Ryujinx.Ava.csproj * Rename start.sh to Ryujinx.sh * Update Ryujinx.csproj * Update Ryujinx.Ava.csproj * Update Ryujinx.Ava.csproj * Update Ryujinx.Ava/Ryujinx.Ava.csproj Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com> * Add `GDK_BACKEND` variable * Update Ryujinx.Ava.csproj * Update Program.cs * Update Program.cs * Update Ryujinx.sh * Update Program.cs * linux: Register mime types on launch * Add DOTNET_EnableAlternateStackCheck=1 to desktop file * linux: Add exclusion for RegisterMimeTypes for flathub builds * Update logo path * Cleanup Ryujinx.sh * Fix typo in ReleaseInformation * gha: Fix permissions for linux release binaries * ava: Rename output assembly to Ryujinx * Update mime database after installing new types Wait until logging is available before registering mime types * Copy mime types to output directory Co-authored-by: Mary-nyan <thog@protonmail.com> Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
This commit is contained in:
parent
9e2681f2d7
commit
cbaa845f5d
18 changed files with 177 additions and 31 deletions
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
|
@ -38,11 +38,11 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Configure for release
|
- name: Configure for release
|
||||||
run: |
|
run: |
|
||||||
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' Ryujinx.Common/ReleaseInformation.cs
|
||||||
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' Ryujinx.Common/ReleaseInformation.cs
|
||||||
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' Ryujinx.Common/ReleaseInformation.cs
|
||||||
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' Ryujinx.Common/ReleaseInformation.cs
|
||||||
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' Ryujinx.Common/ReleaseInformations.cs
|
sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' Ryujinx.Common/ReleaseInformation.cs
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Create output dir
|
- name: Create output dir
|
||||||
run: "mkdir release_output"
|
run: "mkdir release_output"
|
||||||
|
@ -75,15 +75,24 @@ jobs:
|
||||||
- name: Packing Linux builds
|
- name: Packing Linux builds
|
||||||
run: |
|
run: |
|
||||||
pushd publish_linux
|
pushd publish_linux
|
||||||
tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
|
tar --exclude "publish/Ryujinx" -cvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar publish
|
||||||
|
python3 ../distribution/misc/add_tar_exec.py ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar "publish/Ryujinx" "publish/Ryujinx"
|
||||||
|
gzip -9 < ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar > ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz
|
||||||
|
rm ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd publish_linux_sdl2_headless
|
pushd publish_linux_sdl2_headless
|
||||||
tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
|
tar --exclude "publish/Ryujinx.Headless.SDL2" -cvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-linux_x64.tar publish
|
||||||
|
python3 ../distribution/misc/add_tar_exec.py ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-linux_x64.tar "publish/Ryujinx.Headless.SDL2" "publish/Ryujinx.Headless.SDL2"
|
||||||
|
gzip -9 < ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-linux_x64.tar > ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz
|
||||||
|
rm ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-linux_x64.tar
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd publish_linux_ava
|
pushd publish_linux_ava
|
||||||
tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
|
tar --exclude "publish/Ryujinx" -cvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar publish
|
||||||
|
python3 ../distribution/misc/add_tar_exec.py ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar "publish/Ryujinx" "publish/Ryujinx"
|
||||||
|
gzip -9 < ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar > ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz
|
||||||
|
rm ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-linux_x64.tar
|
||||||
popd
|
popd
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ namespace Ryujinx.Modules
|
||||||
{
|
{
|
||||||
using (HttpClient jsonClient = ConstructHttpClient())
|
using (HttpClient jsonClient = ConstructHttpClient())
|
||||||
{
|
{
|
||||||
string buildInfoURL = $"{GitHubApiURL}/repos/{ReleaseInformations.ReleaseChannelOwner}/{ReleaseInformations.ReleaseChannelRepo}/releases/latest";
|
string buildInfoURL = $"{GitHubApiURL}/repos/{ReleaseInformation.ReleaseChannelOwner}/{ReleaseInformation.ReleaseChannelRepo}/releases/latest";
|
||||||
|
|
||||||
string fetchedJson = await jsonClient.GetStringAsync(buildInfoURL);
|
string fetchedJson = await jsonClient.GetStringAsync(buildInfoURL);
|
||||||
JObject jsonRoot = JObject.Parse(fetchedJson);
|
JObject jsonRoot = JObject.Parse(fetchedJson);
|
||||||
|
@ -625,7 +625,7 @@ namespace Ryujinx.Modules
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.Version.Contains("dirty") || !ReleaseInformations.IsValid())
|
if (Program.Version.Contains("dirty") || !ReleaseInformation.IsValid())
|
||||||
{
|
{
|
||||||
if (showWarnings)
|
if (showWarnings)
|
||||||
{
|
{
|
||||||
|
@ -640,7 +640,7 @@ namespace Ryujinx.Modules
|
||||||
#else
|
#else
|
||||||
if (showWarnings)
|
if (showWarnings)
|
||||||
{
|
{
|
||||||
if (ReleaseInformations.IsFlatHubBuild())
|
if (ReleaseInformation.IsFlatHubBuild())
|
||||||
{
|
{
|
||||||
ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance[LocaleKeys.UpdaterDisabledWarningTitle], LocaleManager.Instance[LocaleKeys.DialogUpdaterFlatpakNotSupportedMessage]);
|
ContentDialogHelper.CreateWarningDialog(LocaleManager.Instance[LocaleKeys.UpdaterDisabledWarningTitle], LocaleManager.Instance[LocaleKeys.DialogUpdaterFlatpakNotSupportedMessage]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,10 @@ using Ryujinx.Ui.Common;
|
||||||
using Ryujinx.Ui.Common.Configuration;
|
using Ryujinx.Ui.Common.Configuration;
|
||||||
using Ryujinx.Ui.Common.Helper;
|
using Ryujinx.Ui.Common.Helper;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Runtime.Versioning;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava
|
namespace Ryujinx.Ava
|
||||||
|
@ -32,9 +34,51 @@ namespace Ryujinx.Ava
|
||||||
|
|
||||||
private const uint MB_ICONWARNING = 0x30;
|
private const uint MB_ICONWARNING = 0x30;
|
||||||
|
|
||||||
|
[SupportedOSPlatform("linux")]
|
||||||
|
static void RegisterMimeTypes()
|
||||||
|
{
|
||||||
|
if (ReleaseInformation.IsFlatHubBuild())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string mimeDbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share", "mime");
|
||||||
|
|
||||||
|
if (!File.Exists(Path.Combine(mimeDbPath, "packages", "Ryujinx.xml")))
|
||||||
|
{
|
||||||
|
string mimeTypesFile = Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "mime", "Ryujinx.xml");
|
||||||
|
using Process mimeProcess = new();
|
||||||
|
|
||||||
|
mimeProcess.StartInfo.FileName = "xdg-mime";
|
||||||
|
mimeProcess.StartInfo.Arguments = $"install --novendor --mode user {mimeTypesFile}";
|
||||||
|
|
||||||
|
mimeProcess.Start();
|
||||||
|
mimeProcess.WaitForExit();
|
||||||
|
|
||||||
|
if (mimeProcess.ExitCode != 0)
|
||||||
|
{
|
||||||
|
Logger.Error?.PrintMsg(LogClass.Application, $"Unable to install mime types. Make sure xdg-utils is installed. Process exited with code: {mimeProcess.ExitCode}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
using Process updateMimeProcess = new();
|
||||||
|
|
||||||
|
updateMimeProcess.StartInfo.FileName = "update-mime-database";
|
||||||
|
updateMimeProcess.StartInfo.Arguments = mimeDbPath;
|
||||||
|
|
||||||
|
updateMimeProcess.Start();
|
||||||
|
updateMimeProcess.WaitForExit();
|
||||||
|
|
||||||
|
if (updateMimeProcess.ExitCode != 0)
|
||||||
|
{
|
||||||
|
Logger.Error?.PrintMsg(LogClass.Application, $"Could not update local mime database. Process exited with code: {updateMimeProcess.ExitCode}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Version = ReleaseInformations.GetVersion();
|
Version = ReleaseInformation.GetVersion();
|
||||||
|
|
||||||
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134))
|
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134))
|
||||||
{
|
{
|
||||||
|
@ -93,6 +137,12 @@ namespace Ryujinx.Ava
|
||||||
// Initialize the logger system.
|
// Initialize the logger system.
|
||||||
LoggerModule.Initialize();
|
LoggerModule.Initialize();
|
||||||
|
|
||||||
|
// Register mime types on linux.
|
||||||
|
if (OperatingSystem.IsLinux())
|
||||||
|
{
|
||||||
|
RegisterMimeTypes();
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize Discord integration.
|
// Initialize Discord integration.
|
||||||
DiscordIntegrationModule.Initialize();
|
DiscordIntegrationModule.Initialize();
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<AssemblyName>Ryujinx</AssemblyName>
|
||||||
<Version>1.0.0-dirty</Version>
|
<Version>1.0.0-dirty</Version>
|
||||||
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
|
||||||
<RootNamespace>Ryujinx.Ava</RootNamespace>
|
<RootNamespace>Ryujinx.Ava</RootNamespace>
|
||||||
|
@ -76,6 +77,16 @@
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
|
||||||
|
<Content Include="..\distribution\linux\Ryujinx.sh">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="..\distribution\linux\mime\Ryujinx.xml">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
<TargetPath>mime\Ryujinx.xml</TargetPath>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AvaloniaResource Include="Ui\**\*.xaml">
|
<AvaloniaResource Include="Ui\**\*.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|
|
@ -940,7 +940,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
public static void OpenLogsFolder()
|
public static void OpenLogsFolder()
|
||||||
{
|
{
|
||||||
string logPath = Path.Combine(ReleaseInformations.GetBaseApplicationDirectory(), "Logs");
|
string logPath = Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "Logs");
|
||||||
|
|
||||||
new DirectoryInfo(logPath).Create();
|
new DirectoryInfo(logPath).Create();
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace Ryujinx.Common.Logging
|
||||||
files[i].Delete();
|
files[i].Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
string version = ReleaseInformations.GetVersion();
|
string version = ReleaseInformation.GetVersion();
|
||||||
|
|
||||||
// Get path for the current time
|
// Get path for the current time
|
||||||
path = Path.Combine(logDir.FullName, $"Ryujinx_{version}_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.log");
|
path = Path.Combine(logDir.FullName, $"Ryujinx_{version}_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.log");
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Reflection;
|
||||||
namespace Ryujinx.Common
|
namespace Ryujinx.Common
|
||||||
{
|
{
|
||||||
// DO NOT EDIT, filled by CI
|
// DO NOT EDIT, filled by CI
|
||||||
public static class ReleaseInformations
|
public static class ReleaseInformation
|
||||||
{
|
{
|
||||||
private const string FlatHubChannelOwner = "flathub";
|
private const string FlatHubChannelOwner = "flathub";
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace Ryujinx.Headless.SDL2
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Version = ReleaseInformations.GetVersion();
|
Version = ReleaseInformation.GetVersion();
|
||||||
|
|
||||||
Console.Title = $"Ryujinx Console {Version} (Headless SDL2)";
|
Console.Title = $"Ryujinx Console {Version} (Headless SDL2)";
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ namespace Ryujinx.Headless.SDL2
|
||||||
if ((bool)option.EnableFileLog)
|
if ((bool)option.EnableFileLog)
|
||||||
{
|
{
|
||||||
Logger.AddTarget(new AsyncLogTargetWrapper(
|
Logger.AddTarget(new AsyncLogTargetWrapper(
|
||||||
new FileLogTarget(ReleaseInformations.GetBaseApplicationDirectory(), "file"),
|
new FileLogTarget(ReleaseInformation.GetBaseApplicationDirectory(), "file"),
|
||||||
1000,
|
1000,
|
||||||
AsyncLogTargetOverflowAction.Block
|
AsyncLogTargetOverflowAction.Block
|
||||||
));
|
));
|
||||||
|
|
|
@ -91,7 +91,7 @@ namespace Ryujinx.SDL2.Common
|
||||||
|
|
||||||
SDL_EventState(SDL_EventType.SDL_CONTROLLERSENSORUPDATE, SDL_DISABLE);
|
SDL_EventState(SDL_EventType.SDL_CONTROLLERSENSORUPDATE, SDL_DISABLE);
|
||||||
|
|
||||||
string gamepadDbPath = Path.Combine(ReleaseInformations.GetBaseApplicationDirectory(), "SDL_GameControllerDB.txt");
|
string gamepadDbPath = Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "SDL_GameControllerDB.txt");
|
||||||
|
|
||||||
if (File.Exists(gamepadDbPath))
|
if (File.Exists(gamepadDbPath))
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
||||||
if (e.NewValue)
|
if (e.NewValue)
|
||||||
{
|
{
|
||||||
Logger.AddTarget(new AsyncLogTargetWrapper(
|
Logger.AddTarget(new AsyncLogTargetWrapper(
|
||||||
new FileLogTarget(ReleaseInformations.GetBaseApplicationDirectory(), "file"),
|
new FileLogTarget(ReleaseInformation.GetBaseApplicationDirectory(), "file"),
|
||||||
1000,
|
1000,
|
||||||
AsyncLogTargetOverflowAction.Block
|
AsyncLogTargetOverflowAction.Block
|
||||||
));
|
));
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace Ryujinx.Modules
|
||||||
{
|
{
|
||||||
using (HttpClient jsonClient = ConstructHttpClient())
|
using (HttpClient jsonClient = ConstructHttpClient())
|
||||||
{
|
{
|
||||||
string buildInfoURL = $"{GitHubApiURL}/repos/{ReleaseInformations.ReleaseChannelOwner}/{ReleaseInformations.ReleaseChannelRepo}/releases/latest";
|
string buildInfoURL = $"{GitHubApiURL}/repos/{ReleaseInformation.ReleaseChannelOwner}/{ReleaseInformation.ReleaseChannelRepo}/releases/latest";
|
||||||
|
|
||||||
// Fetch latest build information
|
// Fetch latest build information
|
||||||
string fetchedJson = await jsonClient.GetStringAsync(buildInfoURL);
|
string fetchedJson = await jsonClient.GetStringAsync(buildInfoURL);
|
||||||
|
@ -556,7 +556,7 @@ namespace Ryujinx.Modules
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.Version.Contains("dirty") || !ReleaseInformations.IsValid())
|
if (Program.Version.Contains("dirty") || !ReleaseInformation.IsValid())
|
||||||
{
|
{
|
||||||
if (showWarnings)
|
if (showWarnings)
|
||||||
{
|
{
|
||||||
|
@ -570,7 +570,7 @@ namespace Ryujinx.Modules
|
||||||
#else
|
#else
|
||||||
if (showWarnings)
|
if (showWarnings)
|
||||||
{
|
{
|
||||||
if (ReleaseInformations.IsFlatHubBuild())
|
if (ReleaseInformation.IsFlatHubBuild())
|
||||||
{
|
{
|
||||||
GtkDialog.CreateWarningDialog("Updater Disabled!", "Please update Ryujinx via FlatHub.");
|
GtkDialog.CreateWarningDialog("Updater Disabled!", "Please update Ryujinx via FlatHub.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Runtime.Versioning;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx
|
namespace Ryujinx
|
||||||
|
@ -72,9 +73,51 @@ namespace Ryujinx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SupportedOSPlatform("linux")]
|
||||||
|
static void RegisterMimeTypes()
|
||||||
|
{
|
||||||
|
if (ReleaseInformation.IsFlatHubBuild())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string mimeDbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share", "mime");
|
||||||
|
|
||||||
|
if (!File.Exists(Path.Combine(mimeDbPath, "packages", "Ryujinx.xml")))
|
||||||
|
{
|
||||||
|
string mimeTypesFile = Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "mime", "Ryujinx.xml");
|
||||||
|
using Process mimeProcess = new();
|
||||||
|
|
||||||
|
mimeProcess.StartInfo.FileName = "xdg-mime";
|
||||||
|
mimeProcess.StartInfo.Arguments = $"install --novendor --mode user {mimeTypesFile}";
|
||||||
|
|
||||||
|
mimeProcess.Start();
|
||||||
|
mimeProcess.WaitForExit();
|
||||||
|
|
||||||
|
if (mimeProcess.ExitCode != 0)
|
||||||
|
{
|
||||||
|
Logger.Error?.PrintMsg(LogClass.Application, $"Unable to install mime types. Make sure xdg-utils is installed. Process exited with code: {mimeProcess.ExitCode}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
using Process updateMimeProcess = new();
|
||||||
|
|
||||||
|
updateMimeProcess.StartInfo.FileName = "update-mime-database";
|
||||||
|
updateMimeProcess.StartInfo.Arguments = mimeDbPath;
|
||||||
|
|
||||||
|
updateMimeProcess.Start();
|
||||||
|
updateMimeProcess.WaitForExit();
|
||||||
|
|
||||||
|
if (updateMimeProcess.ExitCode != 0)
|
||||||
|
{
|
||||||
|
Logger.Error?.PrintMsg(LogClass.Application, $"Could not update local mime database. Process exited with code: {updateMimeProcess.ExitCode}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Version = ReleaseInformations.GetVersion();
|
Version = ReleaseInformation.GetVersion();
|
||||||
|
|
||||||
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134))
|
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134))
|
||||||
{
|
{
|
||||||
|
@ -101,6 +144,8 @@ namespace Ryujinx
|
||||||
if (OperatingSystem.IsLinux())
|
if (OperatingSystem.IsLinux())
|
||||||
{
|
{
|
||||||
XInitThreads();
|
XInitThreads();
|
||||||
|
Environment.SetEnvironmentVariable("GDK_BACKEND", "x11");
|
||||||
|
setenv("GDK_BACKEND", "x11", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OperatingSystem.IsMacOS())
|
if (OperatingSystem.IsMacOS())
|
||||||
|
@ -144,6 +189,12 @@ namespace Ryujinx
|
||||||
// Initialize the logger system.
|
// Initialize the logger system.
|
||||||
LoggerModule.Initialize();
|
LoggerModule.Initialize();
|
||||||
|
|
||||||
|
// Register mime types on linux.
|
||||||
|
if (OperatingSystem.IsLinux())
|
||||||
|
{
|
||||||
|
RegisterMimeTypes();
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize Discord integration.
|
// Initialize Discord integration.
|
||||||
DiscordIntegrationModule.Initialize();
|
DiscordIntegrationModule.Initialize();
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,16 @@
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
|
||||||
|
<Content Include="..\distribution\linux\Ryujinx.sh">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="..\distribution\linux\mime\Ryujinx.xml">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
<TargetPath>mime\Ryujinx.xml</TargetPath>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Due to .net core 3.1 embedded resource loading -->
|
<!-- Due to .net core 3.1 embedded resource loading -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
|
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
|
||||||
|
|
|
@ -1294,7 +1294,7 @@ namespace Ryujinx.Ui
|
||||||
|
|
||||||
private void OpenLogsFolder_Pressed(object sender, EventArgs args)
|
private void OpenLogsFolder_Pressed(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
string logPath = System.IO.Path.Combine(ReleaseInformations.GetBaseApplicationDirectory(), "Logs");
|
string logPath = System.IO.Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "Logs");
|
||||||
|
|
||||||
new DirectoryInfo(logPath).Create();
|
new DirectoryInfo(logPath).Create();
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Version=1.0
|
Version=1.0
|
||||||
Name=Ryujinx
|
Name=Ryujinx
|
||||||
Comment=A Nintendo Switch Emulator
|
|
||||||
Type=Application
|
Type=Application
|
||||||
|
Icon=Ryujinx
|
||||||
|
Exec=env DOTNET_EnableAlternateStackCheck=1 Ryujinx %f
|
||||||
|
Comment=A Nintendo Switch Emulator
|
||||||
GenericName=Nintendo Switch Emulator
|
GenericName=Nintendo Switch Emulator
|
||||||
Icon=ryujinx
|
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Exec=Ryujinx %f
|
Categories=Game;Emulator;
|
||||||
Categories=Game;Emulator;GTK;
|
|
||||||
MimeType=application/x-nx-nca;application/x-nx-nro;application/x-nx-nso;application/x-nx-nsp;application/x-nx-xci;
|
MimeType=application/x-nx-nca;application/x-nx-nro;application/x-nx-nso;application/x-nx-nsp;application/x-nx-xci;
|
||||||
Keywords=Switch;Nintendo;Emulator;
|
Keywords=Switch;Nintendo;Emulator;
|
||||||
StartupWMClass=Ryujinx
|
StartupWMClass=Ryujinx
|
5
distribution/linux/Ryujinx.sh
Normal file
5
distribution/linux/Ryujinx.sh
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(dirname $(realpath $0))
|
||||||
|
|
||||||
|
env DOTNET_EnableAlternateStackCheck=1 "$SCRIPT_DIR/Ryujinx" "$@"
|
|
@ -2,22 +2,32 @@
|
||||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||||
<mime-type type="application/x-nx-nca">
|
<mime-type type="application/x-nx-nca">
|
||||||
<comment>Nintendo Content Archive</comment>
|
<comment>Nintendo Content Archive</comment>
|
||||||
|
<acronym>NCA</acronym>
|
||||||
<glob pattern="*.nca"/>
|
<glob pattern="*.nca"/>
|
||||||
|
<magic><match value="NCA" type="string" offset="512"/></magic>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
<mime-type type="application/x-nx-nro">
|
<mime-type type="application/x-nx-nro">
|
||||||
<comment>Nintendo Relocatable Object</comment>
|
<comment>Nintendo Relocatable Object</comment>
|
||||||
|
<acronym>NRO</acronym>
|
||||||
<glob pattern="*.nro"/>
|
<glob pattern="*.nro"/>
|
||||||
|
<magic><match value="NRO0" type="string" offset="16"/></magic>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
<mime-type type="application/x-nx-nso">
|
<mime-type type="application/x-nx-nso">
|
||||||
<comment>Nintendo Shared Object</comment>
|
<comment>Nintendo Shared Object</comment>
|
||||||
|
<acronym>NSO</acronym>
|
||||||
<glob pattern="*.nso"/>
|
<glob pattern="*.nso"/>
|
||||||
|
<magic><match value="NSO0" type="string" offset="0"/></magic>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
<mime-type type="application/x-nx-nsp">
|
<mime-type type="application/x-nx-nsp">
|
||||||
<comment>Nintendo Submission Package</comment>
|
<comment>Nintendo Submission Package</comment>
|
||||||
|
<acronym>NSP</acronym>
|
||||||
<glob pattern="*.nsp"/>
|
<glob pattern="*.nsp"/>
|
||||||
|
<magic><match value="PFS0" type="string" offset="0"/></magic>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
<mime-type type="application/x-nx-xci">
|
<mime-type type="application/x-nx-xci">
|
||||||
<comment>Nintendo Switch Cartridge</comment>
|
<comment>Nintendo Switch Cartridge</comment>
|
||||||
|
<acronym>XCI</acronym>
|
||||||
<glob pattern="*.xci"/>
|
<glob pattern="*.xci"/>
|
||||||
|
<magic><match value="HEAD" type="string" offset="4352"/></magic>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
</mime-info>
|
</mime-info>
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in a new issue