@@ -37,7 +37,6 @@ public class Win32 : IProgram, IEquatable<Win32>
37
37
/// Path of the actual executable file.
38
38
/// </summary>
39
39
public string ExecutablePath => LnkResolvedPath ?? FullPath ;
40
- public string WorkingDir => Directory . GetParent ( ExecutablePath ) ? . FullName ?? string . Empty ;
41
40
public string ParentDirectory { get ; set ; }
42
41
public string ExecutableName { get ; set ; }
43
42
public string Description { get ; set ; }
@@ -140,8 +139,8 @@ public Result Result(string query, IPublicAPI api)
140
139
141
140
var info = new ProcessStartInfo
142
141
{
143
- FileName = ExecutablePath ,
144
- WorkingDirectory = WorkingDir ,
142
+ FileName = FullPath ,
143
+ WorkingDirectory = ParentDirectory ,
145
144
UseShellExecute = true ,
146
145
Verb = runAsAdmin ? "runas" : null
147
146
} ;
@@ -167,8 +166,8 @@ public List<Result> ContextMenus(IPublicAPI api)
167
166
{
168
167
var info = new ProcessStartInfo
169
168
{
170
- FileName = ExecutablePath ,
171
- WorkingDirectory = WorkingDir ,
169
+ FileName = FullPath ,
170
+ WorkingDirectory = ParentDirectory ,
172
171
UseShellExecute = true
173
172
} ;
174
173
@@ -187,7 +186,7 @@ public List<Result> ContextMenus(IPublicAPI api)
187
186
var info = new ProcessStartInfo
188
187
{
189
188
FileName = ExecutablePath ,
190
- WorkingDirectory = WorkingDir ,
189
+ WorkingDirectory = ParentDirectory ,
191
190
Verb = "runas" ,
192
191
UseShellExecute = true
193
192
} ;
@@ -221,8 +220,7 @@ public override string ToString()
221
220
return Name ;
222
221
}
223
222
224
- public static List < FileSystemWatcher > Watchers = new List < FileSystemWatcher > ( ) ;
225
-
223
+ private static List < FileSystemWatcher > Watchers = new List < FileSystemWatcher > ( ) ;
226
224
227
225
private static Win32 Win32Program ( string path )
228
226
{
@@ -573,6 +571,7 @@ public static IEnumerable<T> DistinctBy<T, R>(IEnumerable<T> source, Func<T, R>
573
571
574
572
private static IEnumerable < Win32 > ProgramsHasher ( IEnumerable < Win32 > programs )
575
573
{
574
+ // TODO: Unable to distinguish multiple lnks to the same excutable but with different params
576
575
return programs . GroupBy ( p => p . ExecutablePath . ToLowerInvariant ( ) )
577
576
. AsParallel ( )
578
577
. SelectMany ( g =>
0 commit comments