mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use AppListEntry to construct app
This commit is contained in:
parent
6fdf2f101b
commit
e4733207b3
1 changed files with 22 additions and 0 deletions
|
|
@ -411,6 +411,16 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
|
||||
public Application() { }
|
||||
|
||||
public Application(AppListEntry appListEntry)
|
||||
{
|
||||
UserModelId = appListEntry.AppUserModelId;
|
||||
UniqueIdentifier = appListEntry.AppUserModelId;
|
||||
DisplayName = appListEntry.DisplayInfo.DisplayName;
|
||||
Description = appListEntry.DisplayInfo.Description;
|
||||
//Package = package;
|
||||
Enabled = true;
|
||||
}
|
||||
|
||||
public Result Result(string query, IPublicAPI api)
|
||||
{
|
||||
string title;
|
||||
|
|
@ -604,6 +614,18 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
|||
return false;
|
||||
}
|
||||
|
||||
internal static bool IfAppCanRunElevated(XmlNode appNode, XmlNamespaceManager namespaceManager)
|
||||
{
|
||||
// According to https://learn.microsoft.com/windows/apps/desktop/modernize/grant-identity-to-nonpackaged-apps#create-a-package-manifest-for-the-sparse-package
|
||||
// and https://learn.microsoft.com/uwp/schemas/appxpackage/uapmanifestschema/element-application#attributes
|
||||
|
||||
var entryPointNode = appNode.SelectSingleNode($"//*[local-name()='Application' and @EntryPoint]", namespaceManager);
|
||||
var trustLevelNode = appNode.SelectSingleNode($"//*[local-name()='Application' and @uap10:TrustLevel]", namespaceManager);
|
||||
|
||||
return entryPointNode?.Attributes["EntryPoint"]?.Value == "Windows.FullTrustApplication" ||
|
||||
trustLevelNode?.Attributes["uap10:TrustLevel"]?.Value == "mediumIL";
|
||||
}
|
||||
|
||||
internal string ResourceFromPri(string packageFullName, string packageName, string rawReferenceValue)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(rawReferenceValue) || !rawReferenceValue.StartsWith("ms-resource:"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue