From a1835984fc12b0e72b2cda2aa7d45cba9a5d3c09 Mon Sep 17 00:00:00 2001 From: PablosCorner Date: Sat, 13 Apr 2024 17:31:02 -0400 Subject: [PATCH] Realized that patcher can't replace patcher executable with same name during auto-update, fixed --- WiiLink-Patcher-CLI/WiiLink_Patcher.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/WiiLink-Patcher-CLI/WiiLink_Patcher.cs b/WiiLink-Patcher-CLI/WiiLink_Patcher.cs index 35bef8f..e18ccbf 100644 --- a/WiiLink-Patcher-CLI/WiiLink_Patcher.cs +++ b/WiiLink-Patcher-CLI/WiiLink_Patcher.cs @@ -3663,16 +3663,19 @@ public static async Task CheckForUpdates(string currentVersion) // Get the latest version number from the text file string latestVersion = updateInfo.Split('\n')[0].Trim(); + // Remove any . from the version number (v2.0.2-1 -> v202-1) + string versionWithoutDots = latestVersion.Replace(".", ""); + // Map operating system names to executable names var executables = new Dictionary { - { "Windows", "WiiLinkPatcher_Windows.exe" }, + { "Windows", $"WiiLinkPatcher_Windows_{versionWithoutDots}.exe" }, { "Linux", RuntimeInformation.ProcessArchitecture == Architecture.Arm64 - ? "WiiLinkPatcher_Linux-ARM64" - : "WiiLinkPatcher_Linux-x64" }, + ? $"WiiLinkPatcher_Linux-ARM64_{versionWithoutDots}" + : $"WiiLinkPatcher_Linux-x64_{versionWithoutDots}" }, { "OSX", RuntimeInformation.ProcessArchitecture == Architecture.Arm64 - ? "WiiLinkPatcher_macOS-ARM64" - : "WiiLinkPatcher_macOS-x64" } + ? $"WiiLinkPatcher_macOS-ARM64_{versionWithoutDots}" + : $"WiiLinkPatcher_macOS-x64_{versionWithoutDots}" } }; // Get the download URL for the latest version