mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix issues if didn't has permission to create dir
This commit is contained in:
parent
ba0bda6aa6
commit
72c2fa3863
3 changed files with 25 additions and 3 deletions
|
|
@ -58,6 +58,7 @@ namespace Wox.Core.Plugin
|
||||||
|
|
||||||
private static void ParseUserPlugins(string pluginDirectory)
|
private static void ParseUserPlugins(string pluginDirectory)
|
||||||
{
|
{
|
||||||
|
if (!Directory.Exists(pluginDirectory)) return;
|
||||||
|
|
||||||
string[] directories = Directory.GetDirectories(pluginDirectory);
|
string[] directories = Directory.GetDirectories(pluginDirectory);
|
||||||
foreach (string directory in directories)
|
foreach (string directory in directories)
|
||||||
|
|
@ -138,4 +139,4 @@ namespace Wox.Core.Plugin
|
||||||
return metadata;
|
return metadata;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,6 +5,7 @@ using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Wox.Infrastructure.Http;
|
using Wox.Infrastructure.Http;
|
||||||
|
using Wox.Infrastructure.Logger;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
|
|
||||||
namespace Wox.Core.Plugin
|
namespace Wox.Core.Plugin
|
||||||
|
|
@ -46,6 +47,9 @@ namespace Wox.Core.Plugin
|
||||||
static PluginManager()
|
static PluginManager()
|
||||||
{
|
{
|
||||||
pluginDirectories.Add(DefaultPluginDirectory);
|
pluginDirectories.Add(DefaultPluginDirectory);
|
||||||
|
pluginDirectories.Add(
|
||||||
|
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Plugins"));
|
||||||
|
|
||||||
MakesurePluginDirectoriesExist();
|
MakesurePluginDirectoriesExist();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,7 +59,14 @@ namespace Wox.Core.Plugin
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(pluginDirectory))
|
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.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Wox.Helper;
|
using Wox.Helper;
|
||||||
|
using Wox.Infrastructure.Logger;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox
|
namespace Wox
|
||||||
|
|
@ -18,6 +19,8 @@ namespace Wox
|
||||||
|
|
||||||
static ThemeManager()
|
static ThemeManager()
|
||||||
{
|
{
|
||||||
|
themeDirectories.Add(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Themes"));
|
||||||
|
|
||||||
string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
|
string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
|
||||||
if (userProfilePath != null)
|
if (userProfilePath != null)
|
||||||
{
|
{
|
||||||
|
|
@ -33,7 +36,14 @@ namespace Wox
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(pluginDirectory))
|
if (!Directory.Exists(pluginDirectory))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(pluginDirectory);
|
try
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(pluginDirectory);
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
Log.Error(e.Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue