|
|
@@ -38,7 +38,7 @@ namespace GCMM |
|
|
|
playbtn.Text = pnp; |
|
|
|
return GameState.Unpatched; |
|
|
|
} |
|
|
|
string backup = Directory.EnumerateDirectories(backups).OrderByDescending(s => s).FirstOrDefault(); |
|
|
|
string backup = Directory.EnumerateDirectories(backups).OrderByDescending(name => Directory.GetLastWriteTimeUtc(name)).FirstOrDefault(); |
|
|
|
if (backup == null) |
|
|
|
{ |
|
|
|
status.Text = nopatch; |
|
|
@@ -85,13 +85,14 @@ namespace GCMM |
|
|
|
{ |
|
|
|
url = JArray.Parse(await client.DownloadStringTaskAsync(releases)).First["assets"].First["browser_download_url"].ToString(); |
|
|
|
await client.DownloadFileTaskAsync(url, "IPA.zip"); |
|
|
|
ZipFile.ExtractToDirectory("IPA.zip", Settings.Default.GamePath); |
|
|
|
using (var fs = new FileStream("IPA.zip", FileMode.Open)) |
|
|
|
using (var za = new ZipArchive(fs)) |
|
|
|
za.ExtractToDirectory(Settings.Default.GamePath, true); //Overwrite files that were left from a previous install of the patcher |
|
|
|
} |
|
|
|
} |
|
|
|
status = CheckIfPatched(); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (status != GameState.NotFound && status != GameState.NoPatcher) |
|
|
|
status = CheckIfPatched(); |
|
|
|
switch (status) |
|
|
|
{ |
|
|
|
case GameState.NoPatcher: //Make sure it actually worked |
|
|
|