// -------------------------------------------------------------------------------------------------------------------- // // 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; /// /// Version Utility /// public class VersionHelper { /// /// The get build. /// /// /// The . /// public static string GetVersion() { Version version = Assembly.GetEntryAssembly().GetName().Version; return IsNightly() ? string.Format("svn{0} (Nightly Build)", version.Revision) : string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision); } /// /// The is nightly. /// /// /// The . /// public static bool IsNightly() { Version version = Assembly.GetEntryAssembly().GetName().Version; // The MSBuild.xml script sets 0.0.0 for nightly builds. return version.Major == 0 && version.Minor == 0 && version.Build == 0; } /// /// The get platform bitness. /// /// /// The . /// public static string GetPlatformBitnessVersion() { return System.Environment.Is64BitProcess ? "64bit Version" : "32bit Version"; } /// /// Is a 64 bit app. /// /// /// The . /// public static bool Is64Bit() { return System.Environment.Is64BitProcess; } } }