@@ -39,15 +39,20 @@ public string UniqueIdentifier
39
39
public string FullPath { get ; set ; }
40
40
41
41
/// <summary>
42
- /// Path of the executable for .lnk, or the URL for .url. Arguments are included if any.
42
+ /// Path of the executable for .lnk, or the URL for .url
43
43
/// </summary>
44
44
public string LnkResolvedPath { get ; set ; }
45
45
46
46
/// <summary>
47
- /// Path of the actual executable file. Args are included.
47
+ /// Path of the actual executable file
48
48
/// </summary>
49
49
public string ExecutablePath => LnkResolvedPath ?? FullPath ;
50
50
51
+ /// <summary>
52
+ /// Arguments for the executable.
53
+ /// </summary>
54
+ public string Args { get ; set ; }
55
+
51
56
public string ParentDirectory { get ; set ; }
52
57
53
58
/// <summary>
@@ -261,11 +266,29 @@ public List<Result> ContextMenus(IPublicAPI api)
261
266
} ,
262
267
IcoPath = "Images/folder.png" ,
263
268
Glyph = new GlyphInfo ( FontFamily : "/Resources/#Segoe Fluent Icons" , Glyph : "\xe838 " ) ,
264
- }
269
+ } ,
265
270
} ;
271
+ if ( Extension ( FullPath ) == ShortcutExtension )
272
+ {
273
+ contextMenus . Add ( OpenTargetFolderContextMenuResult ( api ) ) ;
274
+ }
266
275
return contextMenus ;
267
276
}
268
277
278
+ private Result OpenTargetFolderContextMenuResult ( IPublicAPI api )
279
+ {
280
+ return new Result
281
+ {
282
+ Title = api . GetTranslation ( "flowlauncher_plugin_program_open_target_folder" ) ,
283
+ Action = _ =>
284
+ {
285
+ api . OpenDirectory ( Path . GetDirectoryName ( ExecutablePath ) , ExecutablePath ) ;
286
+ return true ;
287
+ } ,
288
+ IcoPath = "Images/folder.png" ,
289
+ Glyph = new GlyphInfo ( FontFamily : "/Resources/#Segoe Fluent Icons" , Glyph : "\xe8de " ) ,
290
+ } ;
291
+ }
269
292
270
293
public override string ToString ( )
271
294
{
@@ -327,7 +350,7 @@ private static Win32 LnkProgram(string path)
327
350
var args = _helper . arguments ;
328
351
if ( ! string . IsNullOrEmpty ( args ) )
329
352
{
330
- program . LnkResolvedPath += " " + args ;
353
+ program . Args = args ;
331
354
}
332
355
333
356
var description = _helper . description ;
@@ -624,7 +647,7 @@ public static IEnumerable<T> DistinctBy<T, R>(IEnumerable<T> source, Func<T, R>
624
647
private static IEnumerable < Win32 > ProgramsHasher ( IEnumerable < Win32 > programs )
625
648
{
626
649
var startMenuPaths = GetStartMenuPaths ( ) ;
627
- return programs . GroupBy ( p => p . ExecutablePath . ToLowerInvariant ( ) )
650
+ return programs . GroupBy ( p => ( p . ExecutablePath + p . Args ) . ToLowerInvariant ( ) )
628
651
. AsParallel ( )
629
652
. SelectMany ( g =>
630
653
{
0 commit comments