diff --git a/Wox.Plugin.System/IProgramSource.cs b/Wox.Plugin.System/IProgramSource.cs index e243c5c5c..837b854f8 100644 --- a/Wox.Plugin.System/IProgramSource.cs +++ b/Wox.Plugin.System/IProgramSource.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Diagnostics; namespace Wox.Plugin.System { @@ -29,6 +30,18 @@ namespace Wox.Plugin.System ExecutePath = file }; + switch (global::System.IO.Path.GetExtension(file).ToLower()) + { + case ".exe": + p.ExecuteName = global::System.IO.Path.GetFileNameWithoutExtension(file); + try + { + FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(file); + if (versionInfo.FileDescription != null && versionInfo.FileDescription != string.Empty) p.Title = versionInfo.FileDescription; + } + catch (Exception) { } + break; + } return p; } } diff --git a/Wox.Plugin.System/Programs.cs b/Wox.Plugin.System/Programs.cs index 05c7f9ab2..943273db5 100644 --- a/Wox.Plugin.System/Programs.cs +++ b/Wox.Plugin.System/Programs.cs @@ -35,6 +35,7 @@ namespace Wox.Plugin.System public string AbbrTitle { get; private set; } public string IcoPath { get; set; } public string ExecutePath { get; set; } + public string ExecuteName { get; set; } public int Score { get; set; } public IProgramSource Source { get; set; } } @@ -98,6 +99,7 @@ namespace Wox.Plugin.System if (program.AbbrTitle != null && (program.Score = matcher.Score(program.AbbrTitle)) > 0) return true; if ((program.Score = matcher.Score(program.Title)) > 0) return true; if ((program.Score = matcher.Score(program.PinyinTitle)) > 0) return true; + if (program.ExecuteName != null && (program.Score = matcher.Score(program.ExecuteName)) > 0) return true; return false; }