Matching ExactName for known Win32 Programs (#6924)

* Matching explorer.exe also for explorer
Added unit test
Optimized multiple iterations for IProgram

* Fixed linter

Co-authored-by: p-storm <paul.de.man@gmail.com>
This commit is contained in:
P-Storm
2020-10-07 18:23:47 +02:00
committed by GitHub
parent a2fce22973
commit 8b66932036
4 changed files with 52 additions and 27 deletions

View File

@@ -20,5 +20,7 @@ namespace Microsoft.Plugin.Program.Programs
string Description { get; set; }
string Location { get; }
bool Enabled { get; set; }
}
}

View File

@@ -170,10 +170,12 @@ namespace Microsoft.Plugin.Program.Programs
public bool QueryEqualsNameForRunCommands(string query)
{
if (query != null && AppType == ApplicationType.RunCommand
&& !query.Equals(Name, StringComparison.OrdinalIgnoreCase))
if (query != null && AppType == ApplicationType.RunCommand)
{
return false;
if (!query.Equals(Name, StringComparison.OrdinalIgnoreCase) && !query.Equals(ExecutableName, StringComparison.OrdinalIgnoreCase))
{
return false;
}
}
return true;