mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 11:39:16 +08:00
Fix a programs bug if custom program folder is not exist.
This commit is contained in:
parent
7926dd9aeb
commit
4121bbc772
@ -32,7 +32,7 @@ namespace Wox.Plugin.SystemPlugins.Program
|
|||||||
switch (Path.GetExtension(file).ToLower())
|
switch (Path.GetExtension(file).ToLower())
|
||||||
{
|
{
|
||||||
case ".exe":
|
case ".exe":
|
||||||
p.ExecuteName = global::System.IO.Path.GetFileName(file);
|
p.ExecuteName = Path.GetFileName(file);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(file);
|
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(file);
|
||||||
|
@ -30,8 +30,10 @@ namespace Wox.Plugin.SystemPlugins.Program.ProgramSources
|
|||||||
public override List<Program> LoadPrograms()
|
public override List<Program> LoadPrograms()
|
||||||
{
|
{
|
||||||
List<Program> list = new List<Program>();
|
List<Program> list = new List<Program>();
|
||||||
GetAppFromDirectory(BaseDirectory, list);
|
if (Directory.Exists(BaseDirectory))
|
||||||
|
{
|
||||||
|
GetAppFromDirectory(BaseDirectory, list);
|
||||||
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,8 +105,19 @@ namespace Wox.Helper
|
|||||||
ThreadPool.QueueUserWorkItem(delegate
|
ThreadPool.QueueUserWorkItem(delegate
|
||||||
{
|
{
|
||||||
Exception exception = null;
|
Exception exception = null;
|
||||||
try { action(); }
|
try
|
||||||
catch (Exception ex) { exception = ex; }
|
{
|
||||||
|
action();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
exception = ex;
|
||||||
|
#if (DEBUG)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
OnItemComplete(state, exception);
|
OnItemComplete(state, exception);
|
||||||
});
|
});
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
Reference in New Issue
Block a user