From b386af4121c94bdc85b218c68dd0eb1fc4fb63ce Mon Sep 17 00:00:00 2001 From: bao-qian Date: Wed, 6 Jan 2016 22:18:27 +0000 Subject: [PATCH] Add executable directory path --- Wox.Infrastructure/Properties/AssemblyInfo.cs | 6 +++++- Wox.Infrastructure/Wox.Infrastructure.csproj | 1 + Wox.Infrastructure/WoxDirectroy.cs | 13 +++++++++++++ Wox/App.xaml.cs | 5 +++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Wox.Infrastructure/WoxDirectroy.cs diff --git a/Wox.Infrastructure/Properties/AssemblyInfo.cs b/Wox.Infrastructure/Properties/AssemblyInfo.cs index a75487010a..cd4944abf0 100644 --- a/Wox.Infrastructure/Properties/AssemblyInfo.cs +++ b/Wox.Infrastructure/Properties/AssemblyInfo.cs @@ -1,5 +1,9 @@ using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Wox.Infrastructure")] -[assembly: Guid("aee57a31-29e5-4f03-a41f-7917910fe90f")] \ No newline at end of file +[assembly: Guid("aee57a31-29e5-4f03-a41f-7917910fe90f")] +[assembly: InternalsVisibleTo("Wox")] +[assembly: InternalsVisibleTo("Wox.Core")] +[assembly: InternalsVisibleTo("Wox.Test")] \ No newline at end of file diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj index ff9276d5af..b62a1feb71 100644 --- a/Wox.Infrastructure/Wox.Infrastructure.csproj +++ b/Wox.Infrastructure/Wox.Infrastructure.csproj @@ -63,6 +63,7 @@ + diff --git a/Wox.Infrastructure/WoxDirectroy.cs b/Wox.Infrastructure/WoxDirectroy.cs new file mode 100644 index 0000000000..2cf383f28e --- /dev/null +++ b/Wox.Infrastructure/WoxDirectroy.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Wox.Infrastructure +{ + public static class WoxDirectroy + { + public static string Executable { get; internal set; } + } +} diff --git a/Wox/App.xaml.cs b/Wox/App.xaml.cs index 2d950b6892..19ff2c2f17 100644 --- a/Wox/App.xaml.cs +++ b/Wox/App.xaml.cs @@ -1,14 +1,18 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using System.Linq; +using System.Reflection; using System.Threading; using System.Windows; using Wox.CommandArgs; using Wox.Core.Plugin; using Wox.Helper; +using Wox.Infrastructure; using Stopwatch = Wox.Infrastructure.Stopwatch; + namespace Wox { public partial class App : Application, ISingleInstanceApp @@ -33,6 +37,7 @@ namespace Wox Stopwatch.Debug("Startup Time", () => { base.OnStartup(e); + WoxDirectroy.Executable = Directory.GetParent(Assembly.GetExecutingAssembly().Location).ToString(); RegisterUnhandledException(); ThreadPool.QueueUserWorkItem(o => { ImageLoader.ImageLoader.PreloadImages(); }); Window = new MainWindow();