mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 03:37:10 +08:00
Check AppListEntry #198
This commit is contained in:
parent
8de84f03a0
commit
1415f74fe5
@ -77,12 +77,15 @@ namespace Wox.Plugin.Program.Programs
|
|||||||
while (apps.GetHasCurrent() != 0 && i <= Apps.Length)
|
while (apps.GetHasCurrent() != 0 && i <= Apps.Length)
|
||||||
{
|
{
|
||||||
var currentApp = apps.GetCurrent();
|
var currentApp = apps.GetCurrent();
|
||||||
|
var appListEntry = currentApp.GetStringValue("AppListEntry");
|
||||||
|
if (appListEntry != "nonoe")
|
||||||
|
{
|
||||||
Apps[i].UserModelId = currentApp.GetAppUserModelId();
|
Apps[i].UserModelId = currentApp.GetAppUserModelId();
|
||||||
Apps[i].Executable = currentApp.GetStringValue("Executable");
|
Apps[i].Executable = currentApp.GetStringValue("Executable") ?? string.Empty;
|
||||||
Apps[i].BackgroundColor = currentApp.GetStringValue("BackgroundColor");
|
Apps[i].BackgroundColor = currentApp.GetStringValue("BackgroundColor") ?? string.Empty;
|
||||||
Apps[i].LogoPath = Path.Combine(Location, currentApp.GetStringValue("Square44x44Logo"));
|
Apps[i].LogoPath = Path.Combine(Location, currentApp.GetStringValue("Square44x44Logo"));
|
||||||
Apps[i].Location = Location;
|
Apps[i].Location = Location;
|
||||||
|
}
|
||||||
apps.MoveNext();
|
apps.MoveNext();
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@ -107,7 +110,6 @@ namespace Wox.Plugin.Program.Programs
|
|||||||
Console.WriteLine(message);
|
Console.WriteLine(message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Apps = apps.Select(a => new Application
|
Apps = apps.Select(a => new Application
|
||||||
{
|
{
|
||||||
DisplayName = a.DisplayInfo.DisplayName,
|
DisplayName = a.DisplayInfo.DisplayName,
|
||||||
@ -148,21 +150,14 @@ namespace Wox.Plugin.Program.Programs
|
|||||||
|
|
||||||
private static IEnumerable<Package> CurrentUserPackages()
|
private static IEnumerable<Package> CurrentUserPackages()
|
||||||
{
|
{
|
||||||
var user = WindowsIdentity.GetCurrent()?.User;
|
var user = WindowsIdentity.GetCurrent().User;
|
||||||
|
|
||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
var userSecurityId = user.Value;
|
var userSecurityId = user.Value;
|
||||||
var packageManager = new PackageManager();
|
var packageManager = new PackageManager();
|
||||||
var packages = packageManager.FindPackagesForUser(userSecurityId);
|
var packages = packageManager.FindPackagesForUser(userSecurityId);
|
||||||
// cw5n1h2txyewy is PublisherID for unnormal package
|
packages = packages.Where(p => !p.IsFramework && !string.IsNullOrEmpty(p.InstalledLocation.Path));
|
||||||
// e.g. ShellExperienceHost
|
|
||||||
// but WindowsFeedBack is flitered
|
|
||||||
// tested with windows 10 1511
|
|
||||||
const string filteredPublisherID = "cw5n1h2txyewy";
|
|
||||||
packages = packages.Where(
|
|
||||||
p => !p.IsFramework && p.Id.PublisherId != filteredPublisherID
|
|
||||||
);
|
|
||||||
return packages;
|
return packages;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -205,6 +200,7 @@ namespace Wox.Plugin.Program.Programs
|
|||||||
public string PublisherDisplayName { get; set; }
|
public string PublisherDisplayName { get; set; }
|
||||||
public string BackgroundColor { get; set; }
|
public string BackgroundColor { get; set; }
|
||||||
public string LogoPath { get; set; }
|
public string LogoPath { get; set; }
|
||||||
|
public string AppListEntry { get; set; }
|
||||||
|
|
||||||
public int Score { get; set; }
|
public int Score { get; set; }
|
||||||
public string Location { get; set; }
|
public string Location { get; set; }
|
||||||
|
Loading…
Reference in New Issue
Block a user