diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/AppCache.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/AppCache.cs index fcbf7301da..a0c3f7c363 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/AppCache.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/AppCache.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.CmdPal.Ext.Apps.Programs; @@ -46,7 +47,19 @@ public sealed partial class AppCache : IDisposable UpdateUWPIconPath(ThemeHelper.GetCurrentTheme()); }); - Task.WaitAll(a, b); + try + { + Task.WaitAll(a, b); + } + catch (AggregateException ex) + { + ManagedCommon.Logger.LogError("One or more errors occurred while indexing apps"); + + foreach (var inner in ex.InnerExceptions) + { + ManagedCommon.Logger.LogError(inner.Message, inner); + } + } AllAppsSettings.Instance.LastIndexTime = DateTime.Today; } @@ -57,7 +70,14 @@ public sealed partial class AppCache : IDisposable { foreach (UWPApplication app in _packageRepository) { - app.UpdateLogoPath(theme); + try + { + app.UpdateLogoPath(theme); + } + catch (Exception ex) + { + ManagedCommon.Logger.LogError($"Failed to update icon path for app {app.Name}", ex); + } } } } diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/UWP.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/UWP.cs index 15d7c079db..9be6cc9eb2 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/UWP.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Programs/UWP.cs @@ -128,14 +128,6 @@ public partial class UWP public static UWPApplication[] All() { - var windows10 = new Version(10, 0); - var support = Environment.OSVersion.Version.Major >= windows10.Major; - - if (!support) - { - return Array.Empty(); - } - var appsBag = new ConcurrentBag(); Parallel.ForEach(CurrentUserPackages(), p => diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Storage/PackageRepository.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Storage/PackageRepository.cs index 3373393080..3a12958f1e 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Storage/PackageRepository.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Storage/PackageRepository.cs @@ -115,11 +115,7 @@ internal sealed partial class PackageRepository : ListRepository public void IndexPrograms() { - var windows10 = new Version(10, 0); - var support = Environment.OSVersion.Version.Major >= windows10.Major; - - var applications = support ? Programs.UWP.All() : Array.Empty(); - + var applications = UWP.All(); SetList(applications); } } diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Storage/Win32ProgramRepository.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Storage/Win32ProgramRepository.cs index ab8139b1e2..6fdb5e49f6 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Storage/Win32ProgramRepository.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Storage/Win32ProgramRepository.cs @@ -267,8 +267,7 @@ internal sealed partial class Win32ProgramRepository : ListRepository