- fix: update resolver dotnet resolving
This commit is contained in:
@@ -42,7 +42,7 @@ public static class DotnetStandalone
|
||||
|
||||
private static async Task EnsureDotnet(LauncherRuntimeInfo runtimeInfo)
|
||||
{
|
||||
if (!Directory.Exists(GetExecutePath(runtimeInfo)))
|
||||
if (!File.Exists(GetExecutePath(runtimeInfo)))
|
||||
await Download(runtimeInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Threading;
|
||||
using Nebula.SharedModels;
|
||||
using Nebula.UpdateResolver.Configuration;
|
||||
using Nebula.UpdateResolver.Rest;
|
||||
@@ -26,20 +27,25 @@ public partial class MainWindow : Window
|
||||
InitializeComponent();
|
||||
LogStandalone.OnLog += (message, percentage) =>
|
||||
{
|
||||
ProgressLabel.Content = message;
|
||||
if (percentage == 0)
|
||||
PercentLabel.Content = "";
|
||||
else
|
||||
PercentLabel.Content = percentage + "%";
|
||||
|
||||
var percentText = "";
|
||||
if (percentage != 0)
|
||||
percentText = $"{percentage}%";
|
||||
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
ProgressLabel.Content = message;
|
||||
PercentLabel.Content = percentText;
|
||||
});
|
||||
|
||||
var messageOut =
|
||||
$"[{DateTime.Now.ToUniversalTime():yyyy-MM-dd HH:mm:ss}]: {message} {PercentLabel.Content}";
|
||||
$"[{DateTime.Now.ToUniversalTime():yyyy-MM-dd HH:mm:ss}]: {message} {percentText}";
|
||||
Console.WriteLine(messageOut);
|
||||
_logStr += messageOut + "\n";
|
||||
};
|
||||
|
||||
LogStandalone.Log("Starting up");
|
||||
if (!Design.IsDesignMode)
|
||||
_ = Start();
|
||||
Task.Run(Start);
|
||||
else
|
||||
LogStandalone.Log("Debug information", 51);
|
||||
}
|
||||
|
||||
@@ -20,13 +20,21 @@ public static class Helper
|
||||
const int bufferSize = 81920;
|
||||
var buffer = new byte[bufferSize];
|
||||
|
||||
int skipStep = 0;
|
||||
long totalRead = 0;
|
||||
int bytesRead;
|
||||
while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0)
|
||||
{
|
||||
output.Write(buffer, 0, bytesRead);
|
||||
totalRead += bytesRead;
|
||||
LogStandalone.Log($"Saving {fileName}", (int)(((float)totalLength / totalRead) * 100));
|
||||
|
||||
skipStep++;
|
||||
|
||||
if(skipStep < 50) continue;
|
||||
|
||||
skipStep = 0;
|
||||
|
||||
LogStandalone.Log($"Saving {fileName}", (int)((totalRead / (float)totalLength) * 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user