From 97a88523f2b6352847d705cbf527fd5ee0f5247b Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 19 Mar 2013 21:48:51 +0000 Subject: 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 --- .../ASUserSettingConstants.cs | 5 - .../HandBrake.ApplicationServices.csproj | 2 + .../Properties/AssemblyInfo.cs.Nightly.tmpl | 42 ++++++ .../Services/Base/EncodeBase.cs | 4 +- .../Services/LibScan.cs | 9 +- .../Services/PresetService.cs | 4 +- .../Services/ScanService.cs | 4 +- .../Services/ServerService.cs | 4 +- .../Utilities/GeneralUtilities.cs | 10 +- .../Utilities/VersionHelper.cs | 57 ++++++++ win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 3 +- win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs | 2 - win/CS/HandBrakeWPF/Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs.Nightly.tmpl | 60 +++++++++ .../Services/Interfaces/IUpdateVersionService.cs | 22 ---- win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs | 2 +- .../HandBrakeWPF/Services/UpdateVersionService.cs | 146 --------------------- win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs | 1 - win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs | 9 +- win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 7 +- win/CS/HandBrakeWPF/defaultsettings.xml | 8 -- win/CS/build.xml | 19 ++- 22 files changed, 190 insertions(+), 232 deletions(-) create mode 100644 win/CS/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs.Nightly.tmpl create mode 100644 win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs create mode 100644 win/CS/HandBrakeWPF/Properties/AssemblyInfo.cs.Nightly.tmpl delete mode 100644 win/CS/HandBrakeWPF/Services/Interfaces/IUpdateVersionService.cs delete mode 100644 win/CS/HandBrakeWPF/Services/UpdateVersionService.cs (limited to 'win/CS') diff --git a/win/CS/HandBrake.ApplicationServices/ASUserSettingConstants.cs b/win/CS/HandBrake.ApplicationServices/ASUserSettingConstants.cs index 2a4aa18c0..7e3ee4583 100644 --- a/win/CS/HandBrake.ApplicationServices/ASUserSettingConstants.cs +++ b/win/CS/HandBrake.ApplicationServices/ASUserSettingConstants.cs @@ -49,11 +49,6 @@ namespace HandBrake.ApplicationServices /// public const string SaveLogCopyDirectory = "SaveLogCopyDirectory"; - /// - /// HandBrakes version - /// - public const string HandBrakeVersion = "HandBrakeVersion"; - /// /// HandBrakes build /// diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index efeeffb47..445b09c36 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -106,6 +106,7 @@ + @@ -160,6 +161,7 @@ + diff --git a/win/CS/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs.Nightly.tmpl b/win/CS/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs.Nightly.tmpl new file mode 100644 index 000000000..faa879725 --- /dev/null +++ b/win/CS/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs.Nightly.tmpl @@ -0,0 +1,42 @@ +/* AssemblyInfo.cs $ + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HandBrake")] +[assembly: AssemblyDescription("HandBrake is a GPL-licensed, multiplatform, multithreaded video transcoder.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("HandBrake Team")] +[assembly: AssemblyProduct("HandBrake")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5e4e3f97-5252-41f6-aae9-3846f62cbc66")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.0.0.$WCREV$")] +[assembly: NeutralResourcesLanguage("")] diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs index 555b004f2..db4ef3abd 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs @@ -66,9 +66,7 @@ namespace HandBrake.ApplicationServices.Services.Base this.userSettingService = userSettingService; this.logBuffer = new StringBuilder(); header = - GeneralUtilities.CreateCliLogHeader( - userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), - userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeBuild)); + GeneralUtilities.CreateCliLogHeader(); this.LogIndex = 0; } diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs index 850c3b860..55aefd7ea 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs @@ -71,19 +71,14 @@ namespace HandBrake.ApplicationServices.Services /// /// Initializes a new instance of the class. /// - /// - /// The user Setting Service. - /// /// /// The hand Brake Instance. /// - public LibScan(IUserSettingService userSettingService, IHandBrakeInstance handBrakeInstance) + public LibScan(IHandBrakeInstance handBrakeInstance) { logging = new StringBuilder(); - header = GeneralUtilities.CreateCliLogHeader( - userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), - userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeBuild)); + header = GeneralUtilities.CreateCliLogHeader(); instance = handBrakeInstance; instance.Initialize(1); diff --git a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs index 5edfb4e1e..5e7d461f5 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/PresetService.cs @@ -306,7 +306,7 @@ namespace HandBrake.ApplicationServices.Services { Category = category, Name = presetName[0].Replace("+", string.Empty).Trim(), - Version = this.userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), + Version = VersionHelper.GetVersion(), Description = string.Empty, // Maybe one day we will populate this. IsBuildIn = true, UsePictureFilters = true, @@ -354,7 +354,7 @@ namespace HandBrake.ApplicationServices.Services List preset = this.presets.Where(p => p.IsBuildIn).ToList(); if (preset.Count > 0) { - if (preset[0].Version != this.userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion)) + if (preset[0].Version != VersionHelper.GetVersion()) { this.UpdateBuiltInPresets(); return true; diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index 40329f14d..1ad531dfe 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -74,9 +74,7 @@ namespace HandBrake.ApplicationServices.Services this.userSettingService = userSettingService; this.logBuffer = new StringBuilder(); - header = GeneralUtilities.CreateCliLogHeader( - userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), - userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeBuild)); + header = GeneralUtilities.CreateCliLogHeader(); } #region Events diff --git a/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs b/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs index d8966c192..199e371a9 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ServerService.cs @@ -173,8 +173,8 @@ namespace HandBrake.ApplicationServices.Services // Setup the services we are going to use. IHandBrakeInstance instance = new HandBrakeInstance(); - scanService = new LibScan(new UserSettingService(), instance); // TODO this needs wired up with castle - encodeService = new LibEncode(new UserSettingService(), instance); + scanService = new LibScan(instance); + encodeService = new LibEncode(new UserSettingService(), instance); // TODO this needs wired up with castle shutdownFlag = new ManualResetEvent(false); shutdownFlag.WaitOne(); diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs index 378898c05..097663f9c 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs @@ -84,20 +84,14 @@ namespace HandBrake.ApplicationServices.Utilities /// /// Add the CLI Query to the Log File. /// - /// - /// The version. - /// - /// - /// The build. - /// /// /// The create cli log header. /// - public static StringBuilder CreateCliLogHeader(string version, int build) + public static StringBuilder CreateCliLogHeader() { var logHeader = new StringBuilder(); - logHeader.AppendLine(String.Format("HandBrake {0} {1}", version, build)); + logHeader.AppendLine(String.Format("HandBrake {0} - {1}", VersionHelper.GetVersion(), VersionHelper.GetPlatformBitnessVersion())); logHeader.AppendLine(String.Format("OS: {0}", Environment.OSVersion)); logHeader.AppendLine(String.Format("CPU: {0}", SystemInfo.GetCpuCount)); logHeader.Append(String.Format("Ram: {0} MB, ", SystemInfo.TotalPhysicalMemory)); 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 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// 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"; + } + } +} diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 7622293d2..09270768b 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -207,8 +207,6 @@ - - @@ -317,6 +315,7 @@ + SettingsSingleFileGenerator diff --git a/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs b/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs index ee0df3b88..cfafe3cec 100644 --- a/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs @@ -87,7 +87,6 @@ namespace HandBrakeWPF.Helpers int.TryParse(build, out buildValue); userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeBuild, buildValue); - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeVersion, version); success = true; } @@ -119,7 +118,6 @@ namespace HandBrakeWPF.Helpers { userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeBuild, 0); userSettingService.SetUserSetting(UserSettingConstants.HandBrakePlatform, string.Empty); - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeVersion, string.Empty); userSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, string.Empty); errorService.ShowError( diff --git a/win/CS/HandBrakeWPF/Properties/AssemblyInfo.cs b/win/CS/HandBrakeWPF/Properties/AssemblyInfo.cs index a202e0bbb..77106e397 100644 --- a/win/CS/HandBrakeWPF/Properties/AssemblyInfo.cs +++ b/win/CS/HandBrakeWPF/Properties/AssemblyInfo.cs @@ -56,5 +56,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.9.9.5314")] +[assembly: AssemblyVersion("0.0.0.5311")] [assembly: NeutralResourcesLanguage("")] \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Properties/AssemblyInfo.cs.Nightly.tmpl b/win/CS/HandBrakeWPF/Properties/AssemblyInfo.cs.Nightly.tmpl new file mode 100644 index 000000000..0a30129c7 --- /dev/null +++ b/win/CS/HandBrakeWPF/Properties/AssemblyInfo.cs.Nightly.tmpl @@ -0,0 +1,60 @@ +/* AssemblyInfo.cs $ + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HandBrake")] +[assembly: AssemblyDescription("HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video transcoder.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("HandBrake")] +[assembly: AssemblyProduct("HandBrake")] +[assembly: AssemblyCopyright("Copyright © HandBrake Team 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.0.0.$WCREV$")] +[assembly: NeutralResourcesLanguage("")] \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/Interfaces/IUpdateVersionService.cs b/win/CS/HandBrakeWPF/Services/Interfaces/IUpdateVersionService.cs deleted file mode 100644 index 3a84e68fc..000000000 --- a/win/CS/HandBrakeWPF/Services/Interfaces/IUpdateVersionService.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the IUpdateVersionService type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.Services.Interfaces -{ - /// - /// The IUpdateVersionService Interface - /// - public interface IUpdateVersionService - { - /// - /// Get's HandBrakes version data from the CLI. - /// - void SetCliVersionData(); - } -} \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs b/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs index 9cb6707f9..f66aff538 100644 --- a/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs +++ b/win/CS/HandBrakeWPF/Services/ScanServiceWrapper.cs @@ -68,7 +68,7 @@ namespace HandBrakeWPF.Services else { HandbrakeInstance = new HandBrakeInstance(); - this.scanService = new LibScan(userSettingService, HandbrakeInstance); + this.scanService = new LibScan(HandbrakeInstance); } } catch(Exception exc) diff --git a/win/CS/HandBrakeWPF/Services/UpdateVersionService.cs b/win/CS/HandBrakeWPF/Services/UpdateVersionService.cs deleted file mode 100644 index e0de1d88a..000000000 --- a/win/CS/HandBrakeWPF/Services/UpdateVersionService.cs +++ /dev/null @@ -1,146 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the UpdateVersionService type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrakeWPF.Services -{ - using System; - using System.Diagnostics; - using System.IO; - using System.Security.Cryptography; - using System.Text.RegularExpressions; - using System.Windows; - - using HandBrake.ApplicationServices; - using HandBrake.ApplicationServices.Services.Interfaces; - - using HandBrakeWPF.Services.Interfaces; - - /// - /// Update Version Service - Handlers Update and Versioning. - /// - public class UpdateVersionService : IUpdateVersionService - { - /// - /// The Backing field for the user setting service - /// - private readonly IUserSettingService userSettingService; - - /// - /// The Error Service Backing field. - /// - private readonly IErrorService errorService; - - /// - /// Initializes a new instance of the class. - /// - /// - /// The user setting service. - /// - /// - /// The error Service. - /// - public UpdateVersionService(IUserSettingService userSettingService, IErrorService errorService) - { - this.userSettingService = userSettingService; - this.errorService = errorService; - } - - /// - /// Get's HandBrakes version data from the CLI. - /// - public void SetCliVersionData() - { - string line; - - // 0 = SVN Build / Version - // 1 = Build Date - - // Get the SHA1 Hash of HandBrakeCLI - byte[] hash; - string starupPath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); - - using (Stream stream = File.OpenRead(Path.Combine(starupPath, "HandBrakeCLI.exe"))) - { - hash = SHA1.Create().ComputeHash(stream); - } - string base64Hash = Convert.ToBase64String(hash); - - // Compare the hash with the last known hash. If it's the same, return. - if (userSettingService.GetUserSetting(UserSettingConstants.HandBrakeExeHash) == base64Hash) - { - return; - } - - // It's not the same, so start the CLI to get it's version data. - Process cliProcess = new Process(); - ProcessStartInfo handBrakeCli = new ProcessStartInfo("HandBrakeCLI.exe", " -u -v0") - { - UseShellExecute = false, - RedirectStandardError = true, - RedirectStandardOutput = true, - CreateNoWindow = true - }; - cliProcess.StartInfo = handBrakeCli; - - try - { - cliProcess.Start(); - - // Retrieve standard output and report back to parent thread until the process is complete - TextReader stdOutput = cliProcess.StandardError; - - while (!cliProcess.HasExited) - { - line = stdOutput.ReadLine() ?? string.Empty; - Match m = Regex.Match(line, @"HandBrake ([svnM0-9.]*) \(([0-9]*)\)"); - Match platform = Regex.Match(line, @"- ([A-Za-z0-9\s ]*) -"); - - if (m.Success) - { - string version = m.Groups[1].Success ? m.Groups[1].Value : string.Empty; - string build = m.Groups[2].Success ? m.Groups[2].Value : string.Empty; - - int buildValue; - int.TryParse(build, out buildValue); - - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeBuild, buildValue); - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeVersion, version); - } - - if (platform.Success) - { - userSettingService.SetUserSetting(UserSettingConstants.HandBrakePlatform, platform.Value.Replace("-", string.Empty).Trim()); - } - - if (cliProcess.TotalProcessorTime.Seconds > 10) // Don't wait longer than 10 seconds. - { - Process cli = Process.GetProcessById(cliProcess.Id); - if (!cli.HasExited) - { - cli.Kill(); - } - } - } - - userSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, base64Hash); - } - catch (Exception e) - { - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeBuild, string.Empty); - userSettingService.SetUserSetting(UserSettingConstants.HandBrakePlatform, string.Empty); - userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeVersion, string.Empty); - userSettingService.SetUserSetting(UserSettingConstants.HandBrakeExeHash, string.Empty); - - this.errorService.ShowError("Unable to Initialise HandBrake", "This error is unrecoverable. Maybe try restarting.", e); - - Application.Current.Shutdown(); - } - } - } -} diff --git a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs index ae0369d7f..6f3428de3 100644 --- a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs +++ b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs @@ -76,7 +76,6 @@ namespace HandBrakeWPF.Startup this.windsorContainer.Register(Component.For().ImplementedBy().LifeStyle.Is(LifestyleType.Singleton)); this.windsorContainer.Register(Component.For().ImplementedBy().LifeStyle.Is(LifestyleType.Singleton)); this.windsorContainer.Register(Component.For().ImplementedBy().LifeStyle.Is(LifestyleType.Singleton)); - this.windsorContainer.Register(Component.For().ImplementedBy().LifeStyle.Is(LifestyleType.Singleton)); this.windsorContainer.Register(Component.For().ImplementedBy().LifeStyle.Is(LifestyleType.Singleton)); this.windsorContainer.Register(Component.For().ImplementedBy().LifeStyle.Is(LifestyleType.Singleton)); diff --git a/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs index 2fa4913a6..cb9cef3e7 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs @@ -9,7 +9,7 @@ namespace HandBrakeWPF.ViewModels { - using HandBrake.ApplicationServices; + using HandBrake.ApplicationServices.Utilities; using HandBrakeWPF.ViewModels.Interfaces; @@ -33,12 +33,7 @@ namespace HandBrakeWPF.ViewModels { get { - string nightly = UserSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion).Contains("svn") ? " (SVN / Nightly Build)" : string.Empty; - return string.Format( - "{0} ({1}) {2}", - UserSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), - UserSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeBuild), - nightly); + return string.Format("{0} - {1}", VersionHelper.GetVersion(), VersionHelper.GetPlatformBitnessVersion()); } } diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 4f2bc251b..af4dce85b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -1355,12 +1355,7 @@ namespace HandBrakeWPF.ViewModels { get { - string nightly = UserSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion).Contains("svn") ? " (SVN / Nightly Build)" : string.Empty; - return string.Format( - "{0} ({1}) {2}", - UserSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), - UserSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeBuild), - nightly); + return string.Format("{0} - {1}", VersionHelper.GetVersion(), VersionHelper.GetPlatformBitnessVersion()); } } diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml index 0b10fc645..75810a442 100644 --- a/win/CS/HandBrakeWPF/defaultsettings.xml +++ b/win/CS/HandBrakeWPF/defaultsettings.xml @@ -112,14 +112,6 @@ 00010101 - - - HandBrakeVersion - - - NotSet - - updateStatus diff --git a/win/CS/build.xml b/win/CS/build.xml index b64c12461..7d667af0d 100644 --- a/win/CS/build.xml +++ b/win/CS/build.xml @@ -27,7 +27,7 @@ - PreBuild;BuildRelease;NightlyPostBuild + NightlyPreBuild;BuildRelease;NightlyPostBuild @@ -47,12 +47,19 @@ - + + + + + + + + - - - - + + + + -- cgit v1.2.3