mirror of
https://github.com/microsoft/PowerToys
synced 2024-11-22 00:03:48 +00:00
Merge pull request #27 from zsxsoft/master
Fix crash when UAC blocks the program.
This commit is contained in:
commit
e94fed0137
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@ -52,7 +53,19 @@ namespace Wox.Plugin.System
|
||||
}
|
||||
else
|
||||
{
|
||||
Process.Start(c.ExecutePath);
|
||||
try
|
||||
{
|
||||
Process.Start(c.ExecutePath);
|
||||
}
|
||||
catch (Win32Exception)
|
||||
{
|
||||
//Do nothing.
|
||||
//It may be caused if UAC blocks the program.
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}).ToList();
|
||||
@ -127,4 +140,4 @@ namespace Wox.Plugin.System
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user