mirror of https://github.com/Jackett/Jackett
44 lines
982 B
C#
44 lines
982 B
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
|
|
namespace Jackett.Common.Utils
|
|
{
|
|
public static class EnvironmentUtil
|
|
{
|
|
|
|
public static string JackettVersion()
|
|
{
|
|
var assembly = Assembly.GetExecutingAssembly();
|
|
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
|
|
return $"v{fvi.ProductVersion}";
|
|
}
|
|
|
|
public static string JackettInstallationPath()
|
|
{
|
|
return Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
|
|
}
|
|
|
|
public static string JackettExecutablePath()
|
|
{
|
|
return Assembly.GetEntryAssembly()?.Location;
|
|
}
|
|
|
|
public static bool IsWindows => Environment.OSVersion.Platform == PlatformID.Win32NT;
|
|
|
|
public static bool IsDebug
|
|
{
|
|
get
|
|
{
|
|
#if DEBUG
|
|
return true;
|
|
#else
|
|
return false;
|
|
#endif
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|