mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
Merge branch 'master' into fix_error_message
This commit is contained in:
@@ -111,7 +111,8 @@ namespace Wox.Plugin.Program.Logger
|
|||||||
private static bool IsKnownUWPProgramError(Exception e, string callingMethodName)
|
private static bool IsKnownUWPProgramError(Exception e, string callingMethodName)
|
||||||
{
|
{
|
||||||
if (((e.HResult == -2147024774 || e.HResult == -2147009769) && callingMethodName == "ResourceFromPri")
|
if (((e.HResult == -2147024774 || e.HResult == -2147009769) && callingMethodName == "ResourceFromPri")
|
||||||
|| (e.HResult == -2147024894 && callingMethodName == "LogoPathFromUri"))
|
|| (e.HResult == -2147024894 && (callingMethodName == "LogoPathFromUri" || callingMethodName == "ImageFromPath"))
|
||||||
|
|| (e.HResult == -2147024864 && callingMethodName == "InitializeAppInfo"))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (callingMethodName == "XmlNamespaces")
|
if (callingMethodName == "XmlNamespaces")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -86,6 +86,8 @@ namespace Wox.Plugin.Program.Programs
|
|||||||
var e = Marshal.GetExceptionForHR((int)hResult);
|
var e = Marshal.GetExceptionForHR((int)hResult);
|
||||||
ProgramLogger.LogException($"|UWP|InitializeAppInfo|{path}" +
|
ProgramLogger.LogException($"|UWP|InitializeAppInfo|{path}" +
|
||||||
"|Error caused while trying to get the details of the UWP program", e);
|
"|Error caused while trying to get the details of the UWP program", e);
|
||||||
|
|
||||||
|
Apps = new List<Application>().ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,11 +198,20 @@ namespace Wox.Plugin.Program.Programs
|
|||||||
ps = ps.Where(p =>
|
ps = ps.Where(p =>
|
||||||
{
|
{
|
||||||
bool valid;
|
bool valid;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var f = p.IsFramework;
|
||||||
|
var d = p.IsDevelopmentMode;
|
||||||
|
var path = p.InstalledLocation.Path;
|
||||||
|
valid = !f && !d && !string.IsNullOrEmpty(path);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
ProgramLogger.LogException("|UWP|CurrentUserPackages|An unexpected error occured and "
|
||||||
|
+ $"unable to verify if package is valid", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var f = p.IsFramework;
|
|
||||||
var d = p.IsDevelopmentMode;
|
|
||||||
var path = p.InstalledLocation.Path;
|
|
||||||
valid = !f && !d && !string.IsNullOrEmpty(path);
|
|
||||||
|
|
||||||
return valid;
|
return valid;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user