|
|
@ -5,8 +5,8 @@ using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq; |
|
|
|
using System.Net; |
|
|
|
using System.Net; |
|
|
|
using System.Net.Http; |
|
|
|
using System.Net.Http; |
|
|
|
using System.Text.Json; |
|
|
|
|
|
|
|
using System.Text.Json.Serialization; |
|
|
|
using System.Text.Json.Serialization; |
|
|
|
|
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Windows; |
|
|
|
using System.Windows; |
|
|
|
using AsyncAwaitBestPractices; |
|
|
|
using AsyncAwaitBestPractices; |
|
|
@ -148,11 +148,28 @@ namespace StabilityMatrix |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (AppDomain.CurrentDomain.BaseDirectory.EndsWith("Update\\")) |
|
|
|
if (AppDomain.CurrentDomain.BaseDirectory.EndsWith("Update\\")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
File.Copy(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "StabilityMatrix.exe"), |
|
|
|
var delays = Backoff.DecorrelatedJitterBackoffV2( |
|
|
|
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "StabilityMatrix.exe"), true); |
|
|
|
TimeSpan.FromMilliseconds(150), retryCount: 3); |
|
|
|
|
|
|
|
foreach (var dlay in delays) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
File.Copy( |
|
|
|
|
|
|
|
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, |
|
|
|
|
|
|
|
"StabilityMatrix.exe"), |
|
|
|
|
|
|
|
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", |
|
|
|
|
|
|
|
"StabilityMatrix.exe"), true); |
|
|
|
|
|
|
|
|
|
|
|
Process.Start(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", |
|
|
|
Process.Start(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", |
|
|
|
"StabilityMatrix.exe")); |
|
|
|
"StabilityMatrix.exe")); |
|
|
|
|
|
|
|
|
|
|
|
Current.Shutdown(); |
|
|
|
Current.Shutdown(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Thread.Sleep(dlay); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|