Skip to content

Commit

Permalink
net8 file cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Aytackydln committed Jan 8, 2024
1 parent b818be3 commit a161d9d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 40 additions & 1 deletion Project-Aurora/Project-Aurora/Modules/UpdateCleanup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
Expand All @@ -10,10 +11,16 @@ namespace Aurora.Modules;

public partial class UpdateCleanup : AuroraModule
{
protected override async Task Initialize()
protected override Task Initialize()
{
if (!Global.Configuration.Migrations.Contains("net8"))
{
Net8Migration();
Global.Configuration.Migrations.Add("net8");
}
CleanOldLogiDll();
CleanLogs();
return Task.CompletedTask;
}

private static void CleanOldLogiDll()
Expand Down Expand Up @@ -52,4 +59,36 @@ public override void Dispose()
{
//noop
}

private void Net8Migration()
{
IEnumerable<string> files = [
"Accessibility.dl",
"clrcompression.dl",
"D3DCompiler_47_cor3.dl",
"DirectWriteForwarder.dl",
"Microsoft.VisualBasic.Forms.dl",
"Microsoft.Win32.Registry.AccessControl.dl",
"Microsoft.Win32.SystemEvents.dl",
"System.Windows.Controls.Ribbon.dl",
"System.Windows.Extensions.dl",
"System.Windows.Forms.Design.dl",
"System.Windows.Forms.Design.Editors.dl",
"System.Windows.Forms.dl",
"System.Windows.Forms.Primitives.dl",
"System.Windows.Input.Manipulations.dl",
"System.Windows.Presentation.dl",
"System.Xaml.dl",
"WindowsFormsIntegration.dl",
"wpfgfx_cor3.dll"
];

foreach (var file in files)
{
if (File.Exists(file))
{
File.Delete(file);
}
}
}
}
2 changes: 2 additions & 0 deletions Project-Aurora/Project-Aurora/Settings/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ public class Configuration : INotifyPropertyChanged
public double Lat { get; set; }
public double Lon { get; set; }

public IList<string> Migrations = [];

/// <summary>
/// Called after the configuration file has been deserialized or created for the first time.
/// </summary>
Expand Down

0 comments on commit a161d9d

Please sign in to comment.