mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[PTRun][Program]Run commands: Support for MSC and CPL (#23668)
* code changes * spell fix * dev docs * update tests * Code improvement
This commit is contained in:
@@ -17,6 +17,8 @@ namespace Microsoft.Plugin.Program
|
||||
|
||||
public List<string> ProgramSuffixes { get; set; } = new List<string>() { "bat", "appref-ms", "exe", "lnk", "url" };
|
||||
|
||||
public List<string> RunCommandSuffixes { get; set; } = new List<string>() { "bat", "appref-ms", "exe", "lnk", "url", "cpl", "msc" };
|
||||
|
||||
public bool EnableStartMenuSource { get; set; } = true;
|
||||
|
||||
public bool EnableDesktopSource { get; set; } = true;
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
private const string ShortcutExtension = "lnk";
|
||||
private const string ApplicationReferenceExtension = "appref-ms";
|
||||
private const string InternetShortcutExtension = "url";
|
||||
private static readonly HashSet<string> ExecutableApplicationExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "exe", "bat", "bin", "com", "msc", "msi", "cmd", "ps1", "job", "msp", "mst", "sct", "ws", "wsh", "wsf" };
|
||||
private static readonly HashSet<string> ExecutableApplicationExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "exe", "bat", "bin", "com", "cpl", "msc", "msi", "cmd", "ps1", "job", "msp", "mst", "sct", "ws", "wsh", "wsf" };
|
||||
|
||||
private const string ProxyWebApp = "_proxy.exe";
|
||||
private const string AppIdArgument = "--app-id";
|
||||
@@ -255,6 +255,12 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
},
|
||||
};
|
||||
|
||||
// Adjust title of RunCommand result
|
||||
if (AppType == ApplicationType.RunCommand)
|
||||
{
|
||||
result.Title = ExecutableName;
|
||||
}
|
||||
|
||||
result.TitleHighlightData = StringMatcher.FuzzySearch(query, result.Title).MatchData;
|
||||
|
||||
// Using CurrentCulture since this is user facing
|
||||
@@ -1005,7 +1011,7 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
// Run commands are always set as AppType "RunCommand"
|
||||
var runCommandSources = new (bool IsEnabled, Func<IEnumerable<string>> GetPaths)[]
|
||||
{
|
||||
(settings.EnablePathEnvironmentVariableSource, () => PathEnvironmentProgramPaths(settings.ProgramSuffixes)),
|
||||
(settings.EnablePathEnvironmentVariableSource, () => PathEnvironmentProgramPaths(settings.RunCommandSuffixes)),
|
||||
};
|
||||
|
||||
var disabledProgramsList = settings.DisabledProgramSources;
|
||||
|
||||
Reference in New Issue
Block a user