Fix for PWAs and command prompt not showing up as the first result (#4020)

* Added code which increments the score for the app without any arguments

* Removed magic number and added var
This commit is contained in:
Alekhya
2020-06-05 11:34:16 -07:00
committed by GitHub
parent 6adb47c447
commit c01b76e098
2 changed files with 19 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ namespace Microsoft.Plugin.Program.Programs
public string Description { get; set; }
public bool Valid { get; set; }
public bool Enabled { get; set; }
public bool hasArguments { get; set; } = false;
public string Location => ParentDirectory;
private const string ShortcutExtension = "lnk";
@@ -54,6 +55,12 @@ namespace Microsoft.Plugin.Program.Programs
return null;
}
if(!hasArguments)
{
var noArgumentScoreModifier = 5;
score += noArgumentScoreModifier;
}
var result = new Result
{
SubTitle = "Win32 application",
@@ -191,6 +198,7 @@ namespace Microsoft.Plugin.Program.Programs
program.LnkResolvedPath = program.FullPath;
program.FullPath = Path.GetFullPath(target).ToLower();
program.ExecutableName = Path.GetFileName(target);
program.hasArguments = _helper.hasArguments;
var description = _helper.description;
if (!string.IsNullOrEmpty(description))