Skip to content

Commit

Permalink
fix: Auto Updater failing, due to being unable to delete WebView2 files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorixon committed Nov 10, 2023
1 parent 4f8a34c commit 34d0587
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/GIMI-ModManager.WinUI/ViewModels/ModUpdateVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public partial class ModUpdateVM : ObservableRecipient

[ObservableProperty] private DateTime _lastUpdateCheck = DateTime.Now;

[ObservableProperty] private bool _isOpenDownloadButtonEnabled = false;


public ObservableCollection<UpdateCheckResult> Results = new();
private readonly ILogger _logger = App.GetService<ILogger>().ForContext<ModUpdateVM>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
Grid.Column="1"
Margin="8,0"
Click="ButtonBase_OnClick"
Content="Downloads" />
Content="Downloads"
IsEnabled="{x:Bind ViewModel.IsOpenDownloadButtonEnabled, Mode=OneWay}" />
<ProgressRing
x:Name="ModPageLoadingRing"
Grid.Column="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public ModUpdateAvailableWindow(Guid notificationId)
ModPageBrowser.CoreWebView2.NavigationCompleted += async (_, _) =>
{
ModPageLoadingRing.IsActive = false;
ViewModel.IsOpenDownloadButtonEnabled = true;

// This automatically opens the author side pane
// However, it covered the update date and was annoying so I disabled it
Expand Down
12 changes: 12 additions & 0 deletions src/JASM.AutoUpdater/MainPageVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,18 @@ private async Task InstallLatestVersion()
continue;
}

if (fileSystemInfo.Name.Equals("JASM - Just Another Skin Manager.exe.WebView2",
StringComparison.OrdinalIgnoreCase))
{
continue;
}

if (fileSystemInfo.Name.Equals("logs",
StringComparison.OrdinalIgnoreCase))
{
continue;
}

if (fileSystemInfo is DirectoryInfo directoryInfo)
directoryInfo.Delete(true);
else
Expand Down

0 comments on commit 34d0587

Please sign in to comment.