mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
- Removed IWshRuntimeLibrary. It is no longer needed for the plugin.
- Added ShortcutHelper for invocation calls.
This commit is contained in:
@@ -5,7 +5,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using IWshRuntimeLibrary;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Plugin.Program.ProgramSources;
|
||||
using Wox.Infrastructure.Logger;
|
||||
@@ -50,14 +49,6 @@ namespace Wox.Plugin.Program
|
||||
return results;
|
||||
}
|
||||
|
||||
static string ResolveShortcut(string filePath)
|
||||
{
|
||||
// IWshRuntimeLibrary is in the COM library "Windows Script Host Object Model"
|
||||
WshShell shell = new WshShell();
|
||||
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(filePath);
|
||||
return shortcut.TargetPath;
|
||||
}
|
||||
|
||||
private bool MatchProgram(Program program, FuzzyMatcher matcher)
|
||||
{
|
||||
var scores = new List<string> { program.Title, program.PinyinTitle, program.AbbrTitle, program.ExecuteName };
|
||||
@@ -224,7 +215,7 @@ namespace Wox.Plugin.Program
|
||||
if (Path.EndsWith(".lnk"))
|
||||
{
|
||||
//get location of shortcut
|
||||
var resolved = ResolveShortcut(Path);
|
||||
var resolved = ShortcutHelper.ResolveShortcut(Path);
|
||||
if(!string.IsNullOrEmpty(resolved))
|
||||
Path = resolved;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user