Skip to content

Commit

Permalink
Realized that patcher can't replace patcher executable with same name…
Browse files Browse the repository at this point in the history
… during auto-update, fixed
  • Loading branch information
PablosCorner committed Apr 13, 2024
1 parent 1ecbd60 commit a183598
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions WiiLink-Patcher-CLI/WiiLink_Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>
{
{ "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
Expand Down

0 comments on commit a183598

Please sign in to comment.