mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
Fix non exe lnk
for lnk like control panel.lnk, it has no target and no exe extension.
This commit is contained in:
@@ -150,10 +150,9 @@ namespace Wox.Plugin.Program.Programs
|
||||
const uint SLGP_SHORTPATH = 1;
|
||||
link.GetPath(buffer, buffer.Capacity, ref data, SLGP_SHORTPATH);
|
||||
var target = buffer.ToString();
|
||||
if (!string.IsNullOrEmpty(target) && Extension(target) == ExeExtension)
|
||||
var extension = Extension(target);
|
||||
if (!string.IsNullOrEmpty(target) && (extension == ExeExtension))
|
||||
{
|
||||
program.Valid = true;
|
||||
|
||||
buffer = new StringBuilder(MAX_PATH);
|
||||
link.GetDescription(buffer, MAX_PATH);
|
||||
var description = buffer.ToString();
|
||||
@@ -170,10 +169,6 @@ namespace Wox.Plugin.Program.Programs
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
program.Valid = false;
|
||||
}
|
||||
return program;
|
||||
}
|
||||
catch (Exception)
|
||||
|
||||
Reference in New Issue
Block a user