Make more mono friendly

This commit is contained in:
Matt Nadareski
2016-04-12 16:23:17 -07:00
parent 3e7c53840e
commit d1f630baac

View File

@@ -14,6 +14,14 @@ namespace SabreTools.Helper
get { return "0.6.0.0"; }
}
/// <summary>
/// Returns true if running in a Mono environment
/// </summary>
public static bool MonoEnvironment
{
get { return (Type.GetType("Mono.Runtime") != null); }
}
/// <summary>
/// The path to the root of the 7z binaries and DLLs
/// </summary>
@@ -21,9 +29,8 @@ namespace SabreTools.Helper
{
get
{
bool isMono = (Type.GetType("Mono.Runtime") != null);
char delim = (Environment.CurrentDirectory.Contains("\\") ? '\\' : '/');
return Environment.CurrentDirectory + delim + (!isMono && Environment.Is64BitOperatingSystem ? "x64" : "x86") + delim;
return Environment.CurrentDirectory + delim + (!MonoEnvironment && Environment.Is64BitOperatingSystem ? "x64" : "x86") + delim;
}
}