1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-24 06:06:01 +00:00

infra: Fix updater for old Ava users (#6441)

* Add binaries with both names to release archives

* Add migration code for the new filename

* Add Ryujinx.Ava to all win/linux releases for a while
This commit is contained in:
TSRBerry 2024-03-13 23:26:35 +01:00 committed by GitHub
parent e2a655f1a4
commit 6b4ee82e5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 52 additions and 15 deletions

View file

@ -104,37 +104,30 @@ jobs:
if: matrix.platform.os == 'windows-latest' if: matrix.platform.os == 'windows-latest'
run: | run: |
pushd publish_ava pushd publish_ava
cp publish/Ryujinx.exe publish/Ryujinx.Ava.exe
7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish 7z a ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
7z a ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
popd popd
pushd publish_sdl2_headless pushd publish_sdl2_headless
7z a ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish 7z a ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
popd popd
pushd publish_ava
mv publish/Ryujinx.exe publish/Ryujinx.Ava.exe
7z a ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.zip publish
popd
shell: bash shell: bash
- name: Packing Linux builds - name: Packing Linux builds
if: matrix.platform.os == 'ubuntu-latest' if: matrix.platform.os == 'ubuntu-latest'
run: | run: |
pushd publish_ava pushd publish_ava
chmod +x publish/Ryujinx.sh publish/Ryujinx cp publish/Ryujinx publish/Ryujinx.Ava
chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava publish/Ryujinx
tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish tar -czvf ../release_output/ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
popd popd
pushd publish_sdl2_headless pushd publish_sdl2_headless
chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2 chmod +x publish/Ryujinx.sh publish/Ryujinx.Headless.SDL2
tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish tar -czvf ../release_output/sdl2-ryujinx-headless-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
popd popd
pushd publish_ava
mv publish/Ryujinx publish/Ryujinx.Ava
chmod +x publish/Ryujinx.sh publish/Ryujinx.Ava
tar -czvf ../release_output/test-ava-ryujinx-${{ steps.version_info.outputs.build_version }}-${{ matrix.platform.zip_os_name }}.tar.gz publish
popd
shell: bash shell: bash
- name: Pushing new release - name: Pushing new release

View file

@ -298,7 +298,14 @@ namespace Ryujinx.Modules
else else
{ {
// Find the process name. // Find the process name.
string ryuName = Path.GetFileName(Environment.ProcessPath); string ryuName = Path.GetFileName(Environment.ProcessPath) ?? string.Empty;
// Migration: Start the updated binary.
// TODO: Remove this in a future update.
if (ryuName.StartsWith("Ryujinx.Ava"))
{
ryuName = ryuName.Replace(".Ava", "");
}
// Some operating systems can see the renamed executable, so strip off the .ryuold if found. // Some operating systems can see the renamed executable, so strip off the .ryuold if found.
if (ryuName.EndsWith(".ryuold")) if (ryuName.EndsWith(".ryuold"))
@ -307,7 +314,7 @@ namespace Ryujinx.Modules
} }
// Fallback if the executable could not be found. // Fallback if the executable could not be found.
if (!Path.Exists(Path.Combine(executableDirectory, ryuName))) if (ryuName.Length == 0 || !Path.Exists(Path.Combine(executableDirectory, ryuName)))
{ {
ryuName = OperatingSystem.IsWindows() ? "Ryujinx.exe" : "Ryujinx"; ryuName = OperatingSystem.IsWindows() ? "Ryujinx.exe" : "Ryujinx";
} }
@ -759,6 +766,43 @@ namespace Ryujinx.Modules
{ {
File.Delete(file); File.Delete(file);
} }
// Migration: Delete old Ryujinx binary.
// TODO: Remove this in a future update.
if (!OperatingSystem.IsMacOS())
{
string[] oldRyuFiles = Directory.GetFiles(_homeDir, "Ryujinx.Ava*", SearchOption.TopDirectoryOnly);
// Assume we are running the new one if the process path is not available.
// This helps to prevent an infinite loop of restarts.
string currentRyuName = Path.GetFileName(Environment.ProcessPath) ?? (OperatingSystem.IsWindows() ? "Ryujinx.exe" : "Ryujinx");
string newRyuName = Path.Combine(_homeDir, currentRyuName.Replace(".Ava", ""));
if (!currentRyuName.Contains("Ryujinx.Ava"))
{
foreach (string oldRyuFile in oldRyuFiles)
{
File.Delete(oldRyuFile);
}
}
// Should we be running the old binary, start the new one if possible.
else if (File.Exists(newRyuName))
{
ProcessStartInfo processStart = new(newRyuName)
{
UseShellExecute = true,
WorkingDirectory = _homeDir,
};
foreach (string argument in CommandLineState.Arguments)
{
processStart.ArgumentList.Add(argument);
}
Process.Start(processStart);
Environment.Exit(0);
}
}
} }
} }
} }