summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-03-19 21:48:51 +0000
committersr55 <[email protected]>2013-03-19 21:48:51 +0000
commit97a88523f2b6352847d705cbf527fd5ee0f5247b (patch)
treecbab432a54aa755707eaf4b33632e36cc913da66 /win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs
parentfd9089288f0644a4ce568b2e17abffebffeb65db (diff)
WinGui: Part 1: Fix numerous issues around app versioning. Hopefully the GUI and CLI will no longer be out of sync.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5350 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs57
1 files changed, 57 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs b/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs
new file mode 100644
index 000000000..a8860f5ee
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs
@@ -0,0 +1,57 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="VersionHelper.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Version Utility
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Utilities
+{
+ using System;
+ using System.Reflection;
+
+ /// <summary>
+ /// Version Utility
+ /// </summary>
+ public class VersionHelper
+ {
+ /// <summary>
+ /// The get build.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="int"/>.
+ /// </returns>
+ 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);
+ }
+
+ /// <summary>
+ /// The is nightly.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="string"/>.
+ /// </returns>
+ 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;
+ }
+
+ /// <summary>
+ /// The get platform bitness.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="bool"/>.
+ /// </returns>
+ public static string GetPlatformBitnessVersion()
+ {
+ return System.Environment.Is64BitProcess ? "64bit Version" : "32bit Version";
+ }
+ }
+}