// --------------------------------------------------------------------------------------------------------------------
//
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
//
//
// Version Utility
//
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.ApplicationServices.Utilities
{
using System;
using System.Reflection;
using HandBrake.ApplicationServices.Interop;
using HandBrake.ApplicationServices.Interop.Interfaces;
///
/// Version Utility
///
public class VersionHelper
{
///
/// The get build.
///
///
/// The .
///
public static string GetVersion()
{
IHandBrakeInstance instance = HandBrakeInstanceManager.GetScanInstance(1);
return IsNightly() ? string.Format("Nightly {0} ({1})", instance.Version, instance.Build) : string.Format("{0} ({1})", instance.Version, instance.Build);
}
///
/// The is nightly.
///
///
/// The .
///
public static bool IsNightly()
{
IHandBrakeInstance instance = HandBrakeInstanceManager.GetScanInstance(1);
// 01 = Unofficial Builds. 00 = Official Tagged Releases.
return instance.Build.ToString().EndsWith("01");
}
///
/// The get platform bitness.
///
///
/// The .
///
public static string GetPlatformBitnessVersion()
{
return System.Environment.Is64BitProcess ? "64bit" : "32bit";
}
///
/// Is a 64 bit app.
///
///
/// The .
///
public static bool Is64Bit()
{
return System.Environment.Is64BitProcess;
}
}
}