Skip to content

Commit cf7d512

Browse files
authored
Merge branch 'dev' into AddTimeFormat
2 parents 2daf1ff + 9b9704c commit cf7d512

File tree

1 file changed

+7
-8
lines changed
  • Plugins/Flow.Launcher.Plugin.Program/Programs

1 file changed

+7
-8
lines changed

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public class Win32 : IProgram, IEquatable<Win32>
3737
/// Path of the actual executable file.
3838
/// </summary>
3939
public string ExecutablePath => LnkResolvedPath ?? FullPath;
40-
public string WorkingDir => Directory.GetParent(ExecutablePath)?.FullName ?? string.Empty;
4140
public string ParentDirectory { get; set; }
4241
public string ExecutableName { get; set; }
4342
public string Description { get; set; }
@@ -140,8 +139,8 @@ public Result Result(string query, IPublicAPI api)
140139

141140
var info = new ProcessStartInfo
142141
{
143-
FileName = ExecutablePath,
144-
WorkingDirectory = WorkingDir,
142+
FileName = FullPath,
143+
WorkingDirectory = ParentDirectory,
145144
UseShellExecute = true,
146145
Verb = runAsAdmin ? "runas" : null
147146
};
@@ -167,8 +166,8 @@ public List<Result> ContextMenus(IPublicAPI api)
167166
{
168167
var info = new ProcessStartInfo
169168
{
170-
FileName = ExecutablePath,
171-
WorkingDirectory = WorkingDir,
169+
FileName = FullPath,
170+
WorkingDirectory = ParentDirectory,
172171
UseShellExecute = true
173172
};
174173

@@ -187,7 +186,7 @@ public List<Result> ContextMenus(IPublicAPI api)
187186
var info = new ProcessStartInfo
188187
{
189188
FileName = ExecutablePath,
190-
WorkingDirectory = WorkingDir,
189+
WorkingDirectory = ParentDirectory,
191190
Verb = "runas",
192191
UseShellExecute = true
193192
};
@@ -221,8 +220,7 @@ public override string ToString()
221220
return Name;
222221
}
223222

224-
public static List<FileSystemWatcher> Watchers = new List<FileSystemWatcher>();
225-
223+
private static List<FileSystemWatcher> Watchers = new List<FileSystemWatcher>();
226224

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

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

0 commit comments

Comments
 (0)