diff --git a/Patcher/PatchGenerator/Resources/PatchClient.exe b/Patcher/PatchGenerator/Resources/PatchClient.exe index 72f382c..c1c76a1 100644 --- a/Patcher/PatchGenerator/Resources/PatchClient.exe +++ b/Patcher/PatchGenerator/Resources/PatchClient.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a9a1031ebda804492b75ecbbb1862f63d2185d25192bcd95738f281f145015d +oid sha256:599d6cdb3cdd7d500020a00bbe76a2b87550e81af2fe44a5dd7c5fb09167431a size 25324204 diff --git a/Patcher/PatcherUtils/Model/PatcherExitCode.cs b/Patcher/PatcherUtils/Model/PatcherExitCode.cs index ff962d6..811ec35 100644 --- a/Patcher/PatcherUtils/Model/PatcherExitCode.cs +++ b/Patcher/PatcherUtils/Model/PatcherExitCode.cs @@ -7,6 +7,7 @@ EftExeNotFound = 11, NoPatchFolder = 12, MissingFile = 13, - MissingDir = 14 + MissingDir = 14, + PatchFailed = 15 } } diff --git a/Patcher/PatcherUtils/PatchHelper.cs b/Patcher/PatcherUtils/PatchHelper.cs index 8e4fc2d..b810ee9 100644 --- a/Patcher/PatcherUtils/PatchHelper.cs +++ b/Patcher/PatcherUtils/PatchHelper.cs @@ -95,7 +95,7 @@ namespace PatcherUtils /// /// /// - private void ApplyDelta(string SourceFilePath, string DeltaFilePath) + private (bool, string) ApplyDelta(string SourceFilePath, string DeltaFilePath) { string decodedPath = SourceFilePath + ".decoded"; @@ -115,15 +115,19 @@ namespace PatcherUtils { File.Move(decodedPath, SourceFilePath, true); PatchLogger.LogInfo($"Delta applied: {DeltaFilePath}"); + return (true, ""); } catch (Exception ex) { PatchLogger.LogException(ex); + return (false, ex.Message); } } else { - PatchLogger.LogError($"Failed to decode file delta: {SourceFilePath}"); + string error = $"Failed to decode file delta: {SourceFilePath}"; + PatchLogger.LogError(error); + return (false, error); } } @@ -433,7 +437,12 @@ namespace PatcherUtils } PatchLogger.LogInfo("::: Applying Delta :::"); - ApplyDelta(sourceFile.FullName, deltaFile.FullName); + var result = ApplyDelta(sourceFile.FullName, deltaFile.FullName); + + if(!result.Item1) + { + return new PatchMessage(result.Item2, PatcherExitCode.PatchFailed); + } deltaCount--; @@ -455,6 +464,7 @@ namespace PatcherUtils catch(Exception ex) { PatchLogger.LogException(ex); + return new PatchMessage(ex.Message, PatcherExitCode.PatchFailed); } newCount--; @@ -476,6 +486,7 @@ namespace PatcherUtils catch(Exception ex) { PatchLogger.LogException(ex); + return new PatchMessage(ex.Message, PatcherExitCode.PatchFailed); } delCount--;