mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-07 07:46:12 +02:00
Remove auto update
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
global using Stone_Red_Utilities.Logging;
|
global using Stone_Red_Utilities.Logging;
|
||||||
|
|
||||||
using AlwaysUpToDate;
|
|
||||||
|
|
||||||
using Stone_Red_C_Sharp_Utilities.Logging;
|
using Stone_Red_C_Sharp_Utilities.Logging;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@@ -20,11 +18,7 @@ public partial class App : Application
|
|||||||
|
|
||||||
public const string AppName = "Desktop Magic";
|
public const string AppName = "Desktop Magic";
|
||||||
private readonly string logFilePath;
|
private readonly string logFilePath;
|
||||||
#if DEBUG
|
|
||||||
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/develop/update/updateInfo.json");
|
|
||||||
#else
|
|
||||||
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/main/update/updateInfo.json");
|
|
||||||
#endif
|
|
||||||
private readonly Thread? eventThread;
|
private readonly Thread? eventThread;
|
||||||
private readonly EventWaitHandle eventWaitHandle;
|
private readonly EventWaitHandle eventWaitHandle;
|
||||||
|
|
||||||
@@ -64,12 +58,6 @@ public partial class App : Application
|
|||||||
|
|
||||||
Setup(true);
|
Setup(true);
|
||||||
Exit += CloseHandler;
|
Exit += CloseHandler;
|
||||||
|
|
||||||
updater.ProgressChanged += Updater_ProgressChanged;
|
|
||||||
updater.OnException += Updater_OnException;
|
|
||||||
updater.NoUpdateAvailible += Updater_NoUpdateAvailible;
|
|
||||||
updater.UpdateAvailible += Updater_UpdateAvailible;
|
|
||||||
updater.Start();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,26 +67,6 @@ public partial class App : Application
|
|||||||
eventThread?.Interrupt();
|
eventThread?.Interrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Updater_UpdateAvailible(string version, string additionalInformation)
|
|
||||||
{
|
|
||||||
updater.Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Updater_NoUpdateAvailible()
|
|
||||||
{
|
|
||||||
Logger.Log("No update available", "Updater");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Updater_OnException(Exception exception)
|
|
||||||
{
|
|
||||||
Logger.Log(exception.ToString(), "Updater");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Updater_ProgressChanged(long? totalFileSize, long totalBytesDownloaded, double? progressPercentage)
|
|
||||||
{
|
|
||||||
Logger.Log($"Downloading: {progressPercentage}% {totalBytesDownloaded}/{totalFileSize}", "Updater");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Setup(bool clearLogFile)
|
private void Setup(bool clearLogFile)
|
||||||
{
|
{
|
||||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AlwaysUpToDate" Version="1.0.0.4" />
|
|
||||||
<PackageReference Include="BusyIndicators" Version="2.1.2" />
|
<PackageReference Include="BusyIndicators" Version="2.1.2" />
|
||||||
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.1" />
|
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.1" />
|
||||||
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
|
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Windows only application")]
|
[assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Windows only application")]
|
||||||
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "No need to")]
|
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "No need to")]
|
||||||
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hardcoded", Justification = "<Pending>")]
|
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hardcoded", Justification = "<Pending>")]
|
||||||
|
[assembly: SuppressMessage("Critical Code Smell", "S2696:Instance members should not write to \"static\" fields", Justification = "<Pending>", Scope = "member", Target = "~P:DesktopMagic.DataContexts.MainWindowDataContext.Settings")]
|
||||||
|
|||||||
Binary file not shown.
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"Version":"0.0.3.1",
|
|
||||||
"FileUrl":"http://github.com/Stone-Red-Code/DesktopMagic/blob/main/update/DesktopMagic.zip?raw=true"
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user