Skip to content

Commit a1fe98c

Browse files
authored
Merge pull request LykosAI#1095 from ionite34/backport/main/pr-1094
[dev to main] backport: Fix missing .net 8 and remember sidebar open state (1094)
2 parents cb4a732 + 822fd51 commit a1fe98c

File tree

6 files changed

+156
-124
lines changed

6 files changed

+156
-124
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to Stability Matrix will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

8+
## v2.14.3
9+
### Changed
10+
- The main sidebar now remembers whether it was collapsed or expanded between restarts.
11+
### Fixed
12+
- Fixed missing .NET 8 dependency for SwarmUI installs in certain cases
13+
814
## v2.14.2
915
### Changed
1016
- Changed Nvidia GPU detection to use compute capability level instead of the GPU name for certain feature gates / torch indexes

StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ IPyRunner pyRunner
4646

4747
private DirectoryPath DotnetDir => AssetsDir.JoinDir("dotnet");
4848
private string DotnetPath => Path.Combine(DotnetDir, "dotnet");
49-
private bool IsDotnetInstalled => File.Exists(DotnetPath);
49+
private string Dotnet7SdkExistsPath => Path.Combine(DotnetDir, "sdk", "7.0.405");
50+
private string Dotnet8SdkExistsPath => Path.Combine(DotnetDir, "sdk", "8.0.101");
5051
private string Dotnet7DownloadUrlMacOs =>
5152
"https://download.visualstudio.microsoft.com/download/pr/5bb0e0e4-2a8d-4aba-88ad-232e1f65c281/ee6d35f762d81965b4cf336edde1b318/dotnet-sdk-7.0.405-osx-arm64.tar.gz";
5253
private string Dotnet8DownloadUrlMacOs =>
@@ -103,19 +104,17 @@ public async Task InstallPackageRequirements(
103104

104105
public async Task InstallDotnetIfNecessary(IProgress<ProgressReport>? progress = null)
105106
{
106-
if (IsDotnetInstalled)
107-
return;
107+
var downloadUrl = Compat.IsMacOS ? Dotnet8DownloadUrlMacOs : Dotnet8DownloadUrlLinux;
108108

109-
if (Compat.IsMacOS)
110-
{
111-
await DownloadAndExtractPrerequisite(progress, Dotnet7DownloadUrlMacOs, DotnetDir);
112-
await DownloadAndExtractPrerequisite(progress, Dotnet8DownloadUrlMacOs, DotnetDir);
113-
}
114-
else
109+
var dotnet8SdkExists = Directory.Exists(Dotnet8SdkExistsPath);
110+
111+
if (dotnet8SdkExists && Directory.Exists(DotnetDir))
115112
{
116-
await DownloadAndExtractPrerequisite(progress, Dotnet7DownloadUrlLinux, DotnetDir);
117-
await DownloadAndExtractPrerequisite(progress, Dotnet8DownloadUrlLinux, DotnetDir);
113+
Logger.Info("Dotnet 8 SDK already installed at {DotnetDir}", DotnetDir);
114+
return;
118115
}
116+
117+
await DownloadAndExtractPrerequisite(progress, downloadUrl, DotnetDir);
119118
}
120119

121120
private async Task InstallVirtualenvIfNecessary(IProgress<ProgressReport>? progress = null)

StabilityMatrix.Avalonia/Helpers/WindowsPrerequisiteHelper.cs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ IPyRunner pyRunner
7474
private string Dotnet8DownloadPath => Path.Combine(AssetsDir, "dotnet-sdk-8.0.101-win-x64.zip");
7575
private string DotnetExtractPath => Path.Combine(AssetsDir, "dotnet");
7676
private string DotnetExistsPath => Path.Combine(DotnetExtractPath, "dotnet.exe");
77+
private string Dotnet7SdkExistsPath => Path.Combine(DotnetExtractPath, "sdk", "7.0.405");
78+
private string Dotnet8SdkExistsPath => Path.Combine(DotnetExtractPath, "sdk", "8.0.101");
7779
private string VcBuildToolsDownloadPath => Path.Combine(AssetsDir, "vs_BuildTools.exe");
7880

7981
private string VcBuildToolsExistsPath =>
@@ -500,21 +502,25 @@ public async Task InstallNodeIfNecessary(IProgress<ProgressReport>? progress = n
500502
[SupportedOSPlatform("windows")]
501503
public async Task InstallDotnetIfNecessary(IProgress<ProgressReport>? progress = null)
502504
{
503-
if (File.Exists(DotnetExistsPath))
504-
return;
505+
if (!Directory.Exists(Dotnet7SdkExistsPath))
506+
{
507+
await DownloadAndExtractPrerequisite(
508+
progress,
509+
Dotnet7DownloadUrl,
510+
Dotnet7DownloadPath,
511+
DotnetExtractPath
512+
);
513+
}
505514

506-
await DownloadAndExtractPrerequisite(
507-
progress,
508-
Dotnet7DownloadUrl,
509-
Dotnet7DownloadPath,
510-
DotnetExtractPath
511-
);
512-
await DownloadAndExtractPrerequisite(
513-
progress,
514-
Dotnet8DownloadUrl,
515-
Dotnet8DownloadPath,
516-
DotnetExtractPath
517-
);
515+
if (!Directory.Exists(Dotnet8SdkExistsPath))
516+
{
517+
await DownloadAndExtractPrerequisite(
518+
progress,
519+
Dotnet8DownloadUrl,
520+
Dotnet8DownloadPath,
521+
DotnetExtractPath
522+
);
523+
}
518524
}
519525

520526
[SupportedOSPlatform("windows")]

StabilityMatrix.Avalonia/ViewModels/MainWindowViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public partial class MainWindowViewModel : ViewModelBase
6060
[ObservableProperty]
6161
private object? selectedCategory;
6262

63+
[ObservableProperty]
64+
public partial bool IsPaneOpen { get; set; }
65+
6366
[ObservableProperty]
6467
private List<PageViewModelBase> pages = new();
6568

@@ -164,6 +167,13 @@ protected override async Task OnInitialLoadedAsync()
164167
return;
165168
}
166169

170+
settingsManager.RelayPropertyFor(
171+
this,
172+
vm => vm.IsPaneOpen,
173+
settings => settings.IsMainWindowSidebarOpen,
174+
true
175+
);
176+
167177
// Initialize Discord Rich Presence (this needs LibraryDir so is set here)
168178
discordRichPresenceService.UpdateState();
169179

0 commit comments

Comments
 (0)