Browse Source

Merge pull request #145 from ionite34/fix-settings-not-found

pull/22/head v1.1.4
Ionite 1 year ago committed by GitHub
parent
commit
b514b2dd82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 29
      StabilityMatrix/App.xaml.cs
  2. 1
      StabilityMatrix/DataDirectoryMigrationDialog.xaml.cs
  3. 3
      StabilityMatrix/DesignData/MockFirstLaunchSetupViewModel.cs
  4. 1
      StabilityMatrix/Helper/ArchiveHelper.cs
  5. 1
      StabilityMatrix/Helper/EventManager.cs
  6. 1
      StabilityMatrix/Helper/FileHash.cs
  7. 1
      StabilityMatrix/Helper/FileTransfers.cs
  8. 1
      StabilityMatrix/Helper/IPrerequisiteHelper.cs
  9. 3
      StabilityMatrix/Helper/ModelFinder.cs
  10. 1
      StabilityMatrix/Helper/PrerequisiteHelper.cs
  11. 5
      StabilityMatrix/Helper/SettingsManager.cs
  12. 1
      StabilityMatrix/Helper/SnackbarService.cs
  13. 3
      StabilityMatrix/LaunchPage.xaml.cs
  14. 2
      StabilityMatrix/MainWindow.xaml.cs
  15. 1
      StabilityMatrix/Models/CheckpointFile.cs
  16. 1
      StabilityMatrix/Models/InstalledPackage.cs
  17. 1
      StabilityMatrix/Services/DownloadService.cs
  18. 1
      StabilityMatrix/Services/IDownloadService.cs
  19. 1
      StabilityMatrix/Updater/IUpdateHelper.cs
  20. 1
      StabilityMatrix/Updater/UpdateHelper.cs
  21. 1
      StabilityMatrix/ViewModels/CheckpointBrowserViewModel.cs
  22. 1
      StabilityMatrix/ViewModels/CheckpointManagerViewModel.cs
  23. 1
      StabilityMatrix/ViewModels/LaunchViewModel.cs
  24. 2
      StabilityMatrix/ViewModels/MainWindowViewModel.cs
  25. 1
      StabilityMatrix/ViewModels/RefreshBadgeViewModel.cs
  26. 2
      StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs
  27. 1
      StabilityMatrix/ViewModels/UpdateWindowViewModel.cs
  28. 1
      StabilityMatrix/WebLoginDialog.xaml.cs

29
StabilityMatrix/App.xaml.cs

@ -5,8 +5,8 @@ using System.IO;
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;
@ -148,11 +148,28 @@ namespace StabilityMatrix
{
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;
}

1
StabilityMatrix/DataDirectoryMigrationDialog.xaml.cs

@ -1,5 +1,4 @@
using System;
using System.IO;
using System.Threading.Tasks;
using System.Windows;
using AsyncAwaitBestPractices;

3
StabilityMatrix/DesignData/MockFirstLaunchSetupViewModel.cs

@ -1,5 +1,4 @@
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.ViewModels;
namespace StabilityMatrix.DesignData;

1
StabilityMatrix/Helper/ArchiveHelper.cs

@ -9,7 +9,6 @@ using System.Windows.Threading;
using NLog;
using SharpCompress.Common;
using SharpCompress.Readers;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
namespace StabilityMatrix.Helper;

1
StabilityMatrix/Helper/EventManager.cs

@ -1,5 +1,4 @@
using System;
using StabilityMatrix.Models;
using StabilityMatrix.Updater;
namespace StabilityMatrix.Helper;

1
StabilityMatrix/Helper/FileHash.cs

@ -4,7 +4,6 @@ using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
using Blake3;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
namespace StabilityMatrix.Helper;

1
StabilityMatrix/Helper/FileTransfers.cs

@ -4,7 +4,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
namespace StabilityMatrix.Helper;

1
StabilityMatrix/Helper/IPrerequisiteHelper.cs

@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
namespace StabilityMatrix.Helper;

3
StabilityMatrix/Helper/ModelFinder.cs

@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Linq;
using System.Threading.Tasks;
using NLog;
using Refit;

1
StabilityMatrix/Helper/PrerequisiteHelper.cs

@ -8,7 +8,6 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Win32;
using Octokit;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.Python;
using StabilityMatrix.Services;

5
StabilityMatrix/Helper/SettingsManager.cs

@ -115,10 +115,13 @@ public class SettingsManager : ISettingsManager
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>

1
StabilityMatrix/Helper/SnackbarService.cs

@ -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;

3
StabilityMatrix/LaunchPage.xaml.cs

@ -1,5 +1,4 @@
using System;
using System.Windows;
using System.Windows;
using System.Windows.Controls;
using StabilityMatrix.ViewModels;

2
StabilityMatrix/MainWindow.xaml.cs

@ -4,9 +4,7 @@ using System.Diagnostics;
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;

1
StabilityMatrix/Models/CheckpointFile.cs

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;

1
StabilityMatrix/Models/InstalledPackage.cs

@ -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;

1
StabilityMatrix/Services/DownloadService.cs

@ -5,7 +5,6 @@ using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Polly.Contrib.WaitAndRetry;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
namespace StabilityMatrix.Services;

1
StabilityMatrix/Services/IDownloadService.cs

@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
namespace StabilityMatrix.Services;

1
StabilityMatrix/Updater/IUpdateHelper.cs

@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
namespace StabilityMatrix.Updater;

1
StabilityMatrix/Updater/UpdateHelper.cs

@ -9,7 +9,6 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using StabilityMatrix.Extensions;
using StabilityMatrix.Helper;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Configs;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.Services;

1
StabilityMatrix/ViewModels/CheckpointBrowserViewModel.cs

@ -11,7 +11,6 @@ using NLog;
using System.Diagnostics;
using System.Net.Http;
using System.Windows.Data;
using Octokit;
using StabilityMatrix.Api;
using StabilityMatrix.Database;
using StabilityMatrix.Extensions;

1
StabilityMatrix/ViewModels/CheckpointManagerViewModel.cs

@ -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;

1
StabilityMatrix/ViewModels/LaunchViewModel.cs

@ -1,6 +1,5 @@
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

2
StabilityMatrix/ViewModels/MainWindowViewModel.cs

@ -1,5 +1,4 @@
using System;
using System.Dynamic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
@ -12,7 +11,6 @@ using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.Options;
using StabilityMatrix.Helper;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Configs;
using StabilityMatrix.Services;
using StabilityMatrix.Updater;

1
StabilityMatrix/ViewModels/RefreshBadgeViewModel.cs

@ -5,7 +5,6 @@ using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using NLog;
using StabilityMatrix.Controls;
using StabilityMatrix.Models;
using StabilityMatrix.Models.Progress;
using Wpf.Ui.Common;
using Wpf.Ui.Controls;

2
StabilityMatrix/ViewModels/SelectInstallLocationsViewModel.cs

@ -10,8 +10,6 @@ using CommunityToolkit.Mvvm.Input;
using NLog;
using Ookii.Dialogs.Wpf;
using StabilityMatrix.Helper;
using StabilityMatrix.Models;
using StabilityMatrix.Models.FileInterfaces;
using StabilityMatrix.Models.Progress;
using StabilityMatrix.Models.Settings;

1
StabilityMatrix/ViewModels/UpdateWindowViewModel.cs

@ -6,7 +6,6 @@ using System.Windows;
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;

1
StabilityMatrix/WebLoginDialog.xaml.cs

@ -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;

Loading…
Cancel
Save