Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class Win32 : IProgram, IEquatable<Win32>
/// Path of the actual executable file.
/// </summary>
public string ExecutablePath => LnkResolvedPath ?? FullPath;
public string WorkingDir => Directory.GetParent(ExecutablePath)?.FullName ?? string.Empty;
public string ParentDirectory { get; set; }
public string ExecutableName { get; set; }
public string Description { get; set; }
Expand Down Expand Up @@ -140,8 +139,8 @@ public Result Result(string query, IPublicAPI api)

var info = new ProcessStartInfo
{
FileName = ExecutablePath,
WorkingDirectory = WorkingDir,
FileName = FullPath,
WorkingDirectory = ParentDirectory,
UseShellExecute = true,
Verb = runAsAdmin ? "runas" : null
};
Expand All @@ -167,8 +166,8 @@ public List<Result> ContextMenus(IPublicAPI api)
{
var info = new ProcessStartInfo
{
FileName = ExecutablePath,
WorkingDirectory = WorkingDir,
FileName = FullPath,
WorkingDirectory = ParentDirectory,
UseShellExecute = true
};

Expand All @@ -187,7 +186,7 @@ public List<Result> ContextMenus(IPublicAPI api)
var info = new ProcessStartInfo
{
FileName = ExecutablePath,
WorkingDirectory = WorkingDir,
WorkingDirectory = ParentDirectory,
Verb = "runas",
UseShellExecute = true
};
Expand Down Expand Up @@ -221,8 +220,7 @@ public override string ToString()
return Name;
}

public static List<FileSystemWatcher> Watchers = new List<FileSystemWatcher>();

private static List<FileSystemWatcher> Watchers = new List<FileSystemWatcher>();

private static Win32 Win32Program(string path)
{
Expand Down Expand Up @@ -573,6 +571,7 @@ public static IEnumerable<T> DistinctBy<T, R>(IEnumerable<T> source, Func<T, R>

private static IEnumerable<Win32> ProgramsHasher(IEnumerable<Win32> programs)
{
// TODO: Unable to distinguish multiple lnks to the same excutable but with different params
return programs.GroupBy(p => p.ExecutablePath.ToLowerInvariant())
.AsParallel()
.SelectMany(g =>
Expand Down