PowerToys/Wox.Infrastructure/Wox.cs

44 lines
1.9 KiB
C#
Raw Normal View History

2019-08-20 19:29:30 +08:00
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Wox.Infrastructure
{
2016-05-19 02:38:43 +08:00
public static class Constant
{
2019-08-20 19:29:30 +08:00
public static string DetermineDataDirectory()
{
string portableDataPath = Path.Combine(ProgramDirectory, "UserData");
if (Directory.Exists(portableDataPath))
{
return portableDataPath;
}
else
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Wox);
}
}
2016-05-19 02:38:43 +08:00
public const string Wox = "Wox";
public const string Plugins = "Plugins";
2016-05-08 02:16:13 +08:00
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
2017-04-01 19:54:05 +08:00
public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location.NonNull()).ToString();
2016-05-19 02:38:43 +08:00
public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Wox + ".exe");
2019-08-20 19:29:30 +08:00
public static readonly string DataDirectory = DetermineDataDirectory();
public static readonly string PluginsDirectory = Path.Combine(DataDirectory, Plugins);
2016-05-19 02:38:43 +08:00
public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
public const string Repository = "https://github.com/Wox-launcher/Wox";
public const string Issue = "https://github.com/Wox-launcher/Wox/issues/new";
2017-04-01 19:54:05 +08:00
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion;
2016-07-20 09:01:47 +08:00
public static readonly int ThumbnailSize = 64;
2016-08-20 08:02:47 +08:00
public static readonly string DefaultIcon = Path.Combine(ProgramDirectory, "Images", "app.png");
public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png");
2016-07-20 09:01:47 +08:00
public static string PythonPath;
public static string EverythingSDKPath;
}
}