|
|
|
@ -70,9 +70,13 @@ public class Program
|
|
|
|
|
|
|
|
|
|
private static void HandleUpdateReplacement() |
|
|
|
|
{ |
|
|
|
|
// Check if we're in the named update folder |
|
|
|
|
if (Compat.AppCurrentDir.Parent is {Name: UpdateHelper.UpdateFolderName} parentDir) |
|
|
|
|
// Check if we're in the named update folder or the legacy update folder for 1.2.0 -> 2.0.0 |
|
|
|
|
if (Compat.AppCurrentDir is {Name: UpdateHelper.UpdateFolderName} or {Name: "Update"}) |
|
|
|
|
{ |
|
|
|
|
var parentDir = Compat.AppCurrentDir.Parent; |
|
|
|
|
if (parentDir is null) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
var retryDelays = Backoff.DecorrelatedJitterBackoffV2( |
|
|
|
|
TimeSpan.FromMilliseconds(350), retryCount: 5); |
|
|
|
|
|
|
|
|
@ -112,6 +116,21 @@ public class Program
|
|
|
|
|
logger.Error(e, "Failed to delete update file"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// for 1.2.0 -> 2.0.0 update |
|
|
|
|
var legacyUpdateDir = Compat.AppCurrentDir.JoinDir("Update"); |
|
|
|
|
if (legacyUpdateDir.Exists) |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
legacyUpdateDir.Delete(true); |
|
|
|
|
} |
|
|
|
|
catch (Exception e) |
|
|
|
|
{ |
|
|
|
|
var logger = LogManager.GetCurrentClassLogger(); |
|
|
|
|
logger.Error(e, "Failed to delete legacy update file"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void ConfigureSentry() |
|
|
|
|