Skip to content

Commit

Permalink
Function to download WiiLink Account Linker
Browse files Browse the repository at this point in the history
  • Loading branch information
PablosCorner committed Dec 22, 2024
1 parent dc55824 commit 9b96d92
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions WiiLink-Patcher-CLI/WiiLink_Patcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,22 @@ static public void DownloadOSCApp(string appName)
DownloadFile($"https://hbb1.oscwii.org/api/v3/contents/{appName}/icon.png", Path.Join(appPath, "icon.png"), appName);
}

// <summary>
/// Downloads WiiLink Account Linker from Patcher Server
/// </summary>
static public void DownloadLinker()
{
task = "Downloading WiiLink Account Linker";
string appPath = Path.Join("apps", "WiiLinkAccountLinker");

if (!Directory.Exists(appPath))
Directory.CreateDirectory(appPath);

DownloadFile($"{wiiLinkPatcherUrl}/linker/boot.dol", Path.Join(appPath, "boot.dol"), "WiiLink Account Linker");
DownloadFile($"{wiiLinkPatcherUrl}/linker/meta.xml", Path.Join(appPath, "meta.xml"), "WiiLink Account Linker");
DownloadFile($"{wiiLinkPatcherUrl}/linker/icon.png", Path.Join(appPath, "icon.png"), "WiiLink Account Linker");
}

/// <summary>
/// Downloads AnyGlobe Changer from OSC or GitHub, depending on platform, as the latest OSC release doesn't work with Dolphin.
/// </summary>
Expand Down Expand Up @@ -2147,11 +2163,11 @@ static void DownloadAllPatches()
DownloadPatch("Dominos", $"Dominos_0.delta", "Dominos_0.delta", "Food Channel (Dominos)");
DownloadPatch("Dominos", $"Dominos_1.delta", "Dominos_1.delta", "Food Channel (Dominos)");
DownloadPatch("Dominos", $"Dominos_2.delta", "Dominos_2.delta", "Food Channel (Dominos)");
DownloadOSCApp("WiiLink_Account_Linker");
DownloadLinker();
break;
}

// Kirby TV Channel (only if user chose to install it)
// Kirby TV Channel
DownloadPatch("ktv", $"ktv_2.delta", "KirbyTV_2.delta", "Kirby TV Channel");
}

Expand All @@ -2167,7 +2183,7 @@ static void DownloadAllPatches()
DownloadOSCApp("sntp");
}

// Download WC24 patches if applicable
// Download WC24 patches
// Nintendo Channel
DownloadPatch("nc", $"NC_1_{wc24_reg}.delta", $"NC_1_{wc24_reg}.delta", "Nintendo Channel");

Expand Down Expand Up @@ -3254,7 +3270,7 @@ static void DownloadCustomPatches(List<string> channelSelection)
DownloadPatch("Dominos", $"Dominos_0.delta", "Dominos_0.delta", "Food Channel (Domino's)");
DownloadPatch("Dominos", $"Dominos_1.delta", "Dominos_1.delta", "Food Channel (Domino's)");
DownloadPatch("Dominos", $"Dominos_2.delta", "Dominos_2.delta", "Food Channel (Domino's)");
DownloadOSCApp("WiiLink_Account_Linker");
DownloadLinker();
break;
case "nc_us":
task = "Downloading Nintendo Channel (USA)";
Expand Down

0 comments on commit 9b96d92

Please sign in to comment.