Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.1.4 #22

Merged
merged 5 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions StabilityMatrix/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using AsyncAwaitBestPractices;
Expand Down Expand Up @@ -148,11 +148,28 @@ private void App_OnStartup(object sender, StartupEventArgs e)
{
if (AppDomain.CurrentDomain.BaseDirectory.EndsWith("Update\\"))
{
File.Copy(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "StabilityMatrix.exe"),
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "StabilityMatrix.exe"), true);
Process.Start(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..",
"StabilityMatrix.exe"));
Current.Shutdown();
var delays = Backoff.DecorrelatedJitterBackoffV2(
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, "..",
"StabilityMatrix.exe"));

Current.Shutdown();
}
catch (Exception)
{
Thread.Sleep(dlay);
}
}
return;
}

Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/DataDirectoryMigrationDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.Threading.Tasks;
using System.Windows;
using AsyncAwaitBestPractices;
Expand Down
3 changes: 1 addition & 2 deletions StabilityMatrix/DesignData/MockFirstLaunchSetupViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.ViewModels;

namespace StabilityMatrix.DesignData;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Helper/ArchiveHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using NLog;
using SharpCompress.Common;
using SharpCompress.Readers;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;

namespace StabilityMatrix.Helper;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Helper/EventManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using StabilityMatrix.Models;
using StabilityMatrix.Updater;

namespace StabilityMatrix.Helper;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Helper/FileHash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Security.Cryptography;
using System.Threading.Tasks;
using Blake3;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;

namespace StabilityMatrix.Helper;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Helper/FileTransfers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;

namespace StabilityMatrix.Helper;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Helper/IPrerequisiteHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;

namespace StabilityMatrix.Helper;
Expand Down
3 changes: 1 addition & 2 deletions StabilityMatrix/Helper/ModelFinder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Linq;
using System.Threading.Tasks;
using NLog;
using Refit;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Helper/PrerequisiteHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Microsoft.Extensions.Logging;
using Microsoft.Win32;
using Octokit;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.Python;
using StabilityMatrix.Services;
Expand Down
5 changes: 4 additions & 1 deletion StabilityMatrix/Helper/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,13 @@ public void SetLibraryPath(string path)
var homeDir = Path.Combine(appDataDir, "StabilityMatrix");
Directory.CreateDirectory(homeDir);
var libraryJsonPath = Path.Combine(homeDir, "library.json");

var library = new LibrarySettings { LibraryPath = path };
var libraryJson = JsonSerializer.Serialize(library, new JsonSerializerOptions { WriteIndented = true });
File.WriteAllText(libraryJsonPath, libraryJson);

// actually create the LibraryPath directory
Directory.CreateDirectory(path);
}

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Helper/SnackbarService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Threading.Tasks;
using System;
using AsyncAwaitBestPractices;
using Microsoft.Extensions.Logging;
using StabilityMatrix.Models;
using StabilityMatrix.ViewModels;
using Wpf.Ui.Common;
Expand Down
3 changes: 1 addition & 2 deletions StabilityMatrix/LaunchPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Windows;
using System.Windows;
using System.Windows.Controls;
using StabilityMatrix.ViewModels;

Expand Down
2 changes: 0 additions & 2 deletions StabilityMatrix/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
using System.Reactive.Linq;
using System.Threading;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Interop;
using CommunityToolkit.Mvvm.ComponentModel;
using StabilityMatrix.Helper;
using StabilityMatrix.Services;
using StabilityMatrix.ViewModels;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Models/CheckpointFile.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Models/InstalledPackage.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using StabilityMatrix.Helper;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Services/DownloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Polly.Contrib.WaitAndRetry;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;

namespace StabilityMatrix.Services;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Services/IDownloadService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;

namespace StabilityMatrix.Services;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Updater/IUpdateHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;

namespace StabilityMatrix.Updater;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/Updater/UpdateHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Microsoft.Extensions.Options;
using StabilityMatrix.Extensions;
using StabilityMatrix.Helper;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Configs;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.Services;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/ViewModels/CheckpointBrowserViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Diagnostics;
using System.Net.Http;
using System.Windows.Data;
using Octokit;
using StabilityMatrix.Api;
using StabilityMatrix.Database;
using StabilityMatrix.Extensions;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/ViewModels/CheckpointManagerViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/ViewModels/LaunchViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
Expand Down
2 changes: 0 additions & 2 deletions StabilityMatrix/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Dynamic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand All @@ -12,7 +11,6 @@
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.Options;
using StabilityMatrix.Helper;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Configs;
using StabilityMatrix.Services;
using StabilityMatrix.Updater;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/ViewModels/RefreshBadgeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using CommunityToolkit.Mvvm.Input;
using NLog;
using StabilityMatrix.Controls;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
using Wpf.Ui.Common;
using Wpf.Ui.Controls;
Expand Down
2 changes: 0 additions & 2 deletions StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
using NLog;
using Ookii.Dialogs.Wpf;
using StabilityMatrix.Helper;
using StabilityMatrix.Models;
using StabilityMatrix.Models.FileInterfaces;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.Models.Settings;

Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/ViewModels/UpdateWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using StabilityMatrix.Helper;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.Updater;
using Wpf.Ui.Controls.Window;
Expand Down
1 change: 0 additions & 1 deletion StabilityMatrix/WebLoginDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Windows;
using Microsoft.Web.WebView2.Core;
using NLog;
using StabilityMatrix.ViewModels;
using Wpf.Ui.Contracts;
using Wpf.Ui.Controls.ContentDialogControl;
Expand Down