Fix issues if didn't has permission to create dir

This commit is contained in:
qianlifeng
2014-12-29 22:09:54 +08:00
parent ba0bda6aa6
commit 72c2fa3863
3 changed files with 25 additions and 3 deletions

View File

@@ -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);
}
}
}
}