mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Fix for File Not Found exception while indexing invalid Package App (#4971)
* Catching file not found exception * removed unnecessary header files * Added a string.empty check for installed location * reusing package wrapper instead of package installing event args
This commit is contained in:
@@ -35,11 +35,14 @@ namespace Microsoft.Plugin.Program.Storage
|
||||
try
|
||||
{
|
||||
var packageWrapper = PackageWrapper.GetWrapperFromPackage(args.Package);
|
||||
var uwp = new UWP(packageWrapper);
|
||||
uwp.InitializeAppInfo(args.Package.InstalledLocation.Path);
|
||||
foreach (var app in uwp.Apps)
|
||||
if(!string.IsNullOrEmpty(packageWrapper.InstalledLocation))
|
||||
{
|
||||
Add(app);
|
||||
var uwp = new UWP(packageWrapper);
|
||||
uwp.InitializeAppInfo(packageWrapper.InstalledLocation);
|
||||
foreach (var app in uwp.Apps)
|
||||
{
|
||||
Add(app);
|
||||
}
|
||||
}
|
||||
}
|
||||
//InitializeAppInfo will throw if there is no AppxManifest.xml for the package.
|
||||
|
||||
Reference in New Issue
Block a user