Skip to content

Commit

Permalink
Fixed update link pointing to current version of program rather than …
Browse files Browse the repository at this point in the history
…latest version available

The irony being that you wouldn't be able to update to Hotfix 2 from the update screen 🫠
  • Loading branch information
PablosCorner committed Jun 29, 2023
1 parent 2e04ad1 commit 0956198
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions WiiLink-Patcher-CLI/WiiLink_Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
class WiiLink_Patcher
{
/*###### Build Info ######*/
static readonly string version = "v1.1.2h1";
static readonly string version = "v1.1.2h2";
static readonly string copyrightYear = DateTime.Now.Year.ToString();
static readonly string lastBuild = "June 28nd, 2023";
static readonly string at = "5:01 PM";
static readonly string lastBuild = "June 29nd, 2023";
static readonly string at = "1:37 PM";
static string? sdcard = DetectSDCard();

static readonly string wiiLinkPatcherUrl = "https://patcher.wiilink24.com";
Expand Down Expand Up @@ -1517,7 +1517,7 @@ static void ServerDown()
ExitApp();
}

public static async Task CheckForUpdates(string currentVersion)
public static async Task CheckForUpdates(string currentVersion)
{
PrintHeader();
Console.WriteLine("Checking for updates...");
Expand Down Expand Up @@ -1553,7 +1553,7 @@ public static async Task CheckForUpdates(string currentVersion)
};

// Get the download URL for the latest version
string downloadUrl = $"https://github.com/WiiLink24/WiiLink24-Patcher/releases/download/{version}/";
string downloadUrl = $"https://github.com/WiiLink24/WiiLink24-Patcher/releases/download/{latestVersion}/";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && executables.ContainsKey("Windows"))
downloadUrl += executables["Windows"];
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && executables.ContainsKey("Linux"))
Expand Down Expand Up @@ -1603,7 +1603,7 @@ public static async Task CheckForUpdates(string currentVersion)
response = await client.GetAsync(downloadUrl);
if (!response.IsSuccessStatusCode) // Ideally shouldn't happen if version.txt is set up correctly
{
AnsiConsole.MarkupLine($"[red]An error occurred while downloading the latest version:[/] {response.StatusCode}");
AnsiConsole.MarkupLine($"\n[red]An error occurred while downloading the latest version:[/] {response.StatusCode}");
AnsiConsole.MarkupLine("[red]Press any key to exit...[/]");
Console.ReadKey();
ExitApp();
Expand Down

0 comments on commit 0956198

Please sign in to comment.