Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
banner.Message = CoreTools.Translate(
"It looks like WinGet is not working properly. Do you want to attempt to repair WinGet?");
banner.ActionButtonText = CoreTools.Translate("Repair WinGet");
banner.ActionButtonCommand = new AsyncRelayCommand(AvaloniaPackageOperationHelper.HandleBrokenWinGetAsync);

Check warning on line 309 in src/UniGetUI.Avalonia/Views/SoftwarePages/InstalledPackagesPage.cs

View workflow job for this annotation

GitHub Actions / Build (linux-x64)

This call site is reachable on all platforms. 'AvaloniaPackageOperationHelper.HandleBrokenWinGetAsync()' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 309 in src/UniGetUI.Avalonia/Views/SoftwarePages/InstalledPackagesPage.cs

View workflow job for this annotation

GitHub Actions / Build (linux-arm64)

This call site is reachable on all platforms. 'AvaloniaPackageOperationHelper.HandleBrokenWinGetAsync()' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 309 in src/UniGetUI.Avalonia/Views/SoftwarePages/InstalledPackagesPage.cs

View workflow job for this annotation

GitHub Actions / Build (macos-x64)

This call site is reachable on all platforms. 'AvaloniaPackageOperationHelper.HandleBrokenWinGetAsync()' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 309 in src/UniGetUI.Avalonia/Views/SoftwarePages/InstalledPackagesPage.cs

View workflow job for this annotation

GitHub Actions / Build (macos-arm64)

This call site is reachable on all platforms. 'AvaloniaPackageOperationHelper.HandleBrokenWinGetAsync()' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 309 in src/UniGetUI.Avalonia/Views/SoftwarePages/InstalledPackagesPage.cs

View workflow job for this annotation

GitHub Actions / Linux (Avalonia)

This call site is reachable on all platforms. 'AvaloniaPackageOperationHelper.HandleBrokenWinGetAsync()' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 309 in src/UniGetUI.Avalonia/Views/SoftwarePages/InstalledPackagesPage.cs

View workflow job for this annotation

GitHub Actions / Linux (NativeAOT)

This call site is reachable on all platforms. 'AvaloniaPackageOperationHelper.HandleBrokenWinGetAsync()' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
banner.IsClosable = true;
banner.IsOpen = true;
}
Expand Down Expand Up @@ -381,7 +381,7 @@
reinstallOp.OperationFailed += (_, _) => TelemetryHandler.InstallPackage(package, TEL_OP_RESULT.FAILED, TEL_InstallReferral.ALREADY_INSTALLED);
AvaloniaOperationRegistry.Add(uninstallOp);
AvaloniaOperationRegistry.Add(reinstallOp);
_ = uninstallOp.MainThread();
// uninstallOp runs as reinstallOp's prerequisite; launching it directly too would execute it twice concurrently
_ = reinstallOp.MainThread();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,13 @@ private static async Task LaunchUninstallThenUpdate(IPackage? package)
var uninstallOp = new UninstallPackageOperation(package, uninstallOpts);
uninstallOp.OperationSucceeded += (_, _) => TelemetryHandler.UninstallPackage(package, TEL_OP_RESULT.SUCCESS);
uninstallOp.OperationFailed += (_, _) => TelemetryHandler.UninstallPackage(package, TEL_OP_RESULT.FAILED);
var updateOp = new UpdatePackageOperation(package, updateOpts, req: uninstallOp);
// Once uninstalled the package is gone, so the second step must install the new version fresh; a plain update would fail with "no installed package found".
var updateOp = new InstallPackageOperation(package, updateOpts, req: uninstallOp);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're now changing the process to instead install the package, shouldn't we be renaming the menu option to reflect the changes too in order to avoid confusion? For example, changing "Uninstall package, then update it" to "Uninstall package, then install latest".

updateOp.OperationSucceeded += (_, _) => TelemetryHandler.UpdatePackage(package, TEL_OP_RESULT.SUCCESS);
updateOp.OperationFailed += (_, _) => TelemetryHandler.UpdatePackage(package, TEL_OP_RESULT.FAILED);
AvaloniaOperationRegistry.Add(uninstallOp);
AvaloniaOperationRegistry.Add(updateOp);
_ = uninstallOp.MainThread();
// uninstallOp runs as updateOp's prerequisite; launching it directly too would execute it twice concurrently
_ = updateOp.MainThread();
}

Expand Down
Loading