@@ -39,15 +39,20 @@ public string UniqueIdentifier
3939 public string FullPath { get ; set ; }
4040
4141 /// <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
4343 /// </summary>
4444 public string LnkResolvedPath { get ; set ; }
4545
4646 /// <summary>
47- /// Path of the actual executable file. Args are included.
47+ /// Path of the actual executable file
4848 /// </summary>
4949 public string ExecutablePath => LnkResolvedPath ?? FullPath ;
5050
51+ /// <summary>
52+ /// Arguments for the executable.
53+ /// </summary>
54+ public string Args { get ; set ; }
55+
5156 public string ParentDirectory { get ; set ; }
5257
5358 /// <summary>
@@ -261,11 +266,29 @@ public List<Result> ContextMenus(IPublicAPI api)
261266 } ,
262267 IcoPath = "Images/folder.png" ,
263268 Glyph = new GlyphInfo ( FontFamily : "/Resources/#Segoe Fluent Icons" , Glyph : "\xe838 " ) ,
264- }
269+ } ,
265270 } ;
271+ if ( Extension ( FullPath ) == ShortcutExtension )
272+ {
273+ contextMenus . Add ( OpenTargetFolderContextMenuResult ( api ) ) ;
274+ }
266275 return contextMenus ;
267276 }
268277
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+ }
269292
270293 public override string ToString ( )
271294 {
@@ -327,7 +350,7 @@ private static Win32 LnkProgram(string path)
327350 var args = _helper . arguments ;
328351 if ( ! string . IsNullOrEmpty ( args ) )
329352 {
330- program . LnkResolvedPath += " " + args ;
353+ program . Args = args ;
331354 }
332355
333356 var description = _helper . description ;
@@ -624,7 +647,7 @@ public static IEnumerable<T> DistinctBy<T, R>(IEnumerable<T> source, Func<T, R>
624647 private static IEnumerable < Win32 > ProgramsHasher ( IEnumerable < Win32 > programs )
625648 {
626649 var startMenuPaths = GetStartMenuPaths ( ) ;
627- return programs . GroupBy ( p => p . ExecutablePath . ToLowerInvariant ( ) )
650+ return programs . GroupBy ( p => ( p . ExecutablePath + p . Args ) . ToLowerInvariant ( ) )
628651 . AsParallel ( )
629652 . SelectMany ( g =>
630653 {
0 commit comments