Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Fix file identifiers not checked on existing files, lost by the merge 4…
Browse files Browse the repository at this point in the history
  • Loading branch information
SadPencil committed Feb 24, 2024
1 parent 25b5ae6 commit 46245b8
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions ClientUpdater/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1428,9 +1428,7 @@ private static async ValueTask<string> DownloadFileAsync(UpdaterFileInfo fileInf
if (downloadFile.Exists &&
(fileInfo.Archived ? fileInfo.Identifier : fileInfo.ArchiveIdentifier) == GetUniqueIdForFile(fileRelativePath))
{
string msg = "File " + filename + " has already been downloaded, skipping downloading.";
Logger.Log("Updater: " + msg);
return msg;
Logger.Log("Updater: File " + filename + " has already been downloaded, skipping downloading.");
}
else
{
Expand Down Expand Up @@ -1487,21 +1485,21 @@ private static async ValueTask<string> DownloadFileAsync(UpdaterFileInfo fileInf
Logger.Log($"Updater: File {downloadFile.Name} execute permission added. Current permission flags: " + downloadFile.UnixFileMode);
}
#endif
}

string fileIdentifier = CheckFileIdentifiers(filename, SafePath.CombineFilePath(prefixPath, filename), fileInfo.Identifier);
if (string.IsNullOrEmpty(fileIdentifier))
{
Logger.Log("Updater: File " + filename + " is intact.");
string fileIdentifier = CheckFileIdentifiers(filename, SafePath.CombineFilePath(prefixPath, filename), fileInfo.Identifier);
if (string.IsNullOrEmpty(fileIdentifier))
{
Logger.Log("Updater: File " + filename + " is intact.");

return null;
}
return null;
}

string msg = "Downloaded file " + filename + " has a non-matching identifier: " + fileIdentifier + " against " + fileInfo.Identifier;
Logger.Log("Updater: " + msg);
DeleteFileAndWait(decompressedFile.FullName);
string msg = "Downloaded file " + filename + " has a non-matching identifier: " + fileIdentifier + " against " + fileInfo.Identifier;
Logger.Log("Updater: " + msg);
DeleteFileAndWait(decompressedFile.FullName);

return msg;
}
return msg;
}
catch (Exception exception)
{
Expand Down

0 comments on commit 46245b8

Please sign in to comment.