mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
Fix issues if didn't has permission to create dir
This commit is contained in:
@@ -58,6 +58,7 @@ namespace Wox.Core.Plugin
|
||||
|
||||
private static void ParseUserPlugins(string pluginDirectory)
|
||||
{
|
||||
if (!Directory.Exists(pluginDirectory)) return;
|
||||
|
||||
string[] directories = Directory.GetDirectories(pluginDirectory);
|
||||
foreach (string directory in directories)
|
||||
@@ -138,4 +139,4 @@ namespace Wox.Core.Plugin
|
||||
return metadata;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using Wox.Infrastructure.Http;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Core.Plugin
|
||||
@@ -46,6 +47,9 @@ namespace Wox.Core.Plugin
|
||||
static PluginManager()
|
||||
{
|
||||
pluginDirectories.Add(DefaultPluginDirectory);
|
||||
pluginDirectories.Add(
|
||||
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Plugins"));
|
||||
|
||||
MakesurePluginDirectoriesExist();
|
||||
}
|
||||
|
||||
@@ -55,7 +59,14 @@ namespace Wox.Core.Plugin
|
||||
{
|
||||
if (!Directory.Exists(pluginDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(pluginDirectory);
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(pluginDirectory);
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Log.Error(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox
|
||||
@@ -18,6 +19,8 @@ namespace Wox
|
||||
|
||||
static ThemeManager()
|
||||
{
|
||||
themeDirectories.Add(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Themes"));
|
||||
|
||||
string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
|
||||
if (userProfilePath != null)
|
||||
{
|
||||
@@ -33,7 +36,14 @@ namespace Wox
|
||||
{
|
||||
if (!Directory.Exists(pluginDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(pluginDirectory);
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(pluginDirectory);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.Error(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user