From 3c4b07d3cfb12d0d3318b37f790c0d7f872a68ab Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 31 Mar 2011 20:11:30 +0000 Subject: WinGui: - Add code to attempt an automatic recovery if config files get corrupted. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3893 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/Program.cs | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'win/CS/Program.cs') diff --git a/win/CS/Program.cs b/win/CS/Program.cs index f8a9c8683..ec23be6ca 100644 --- a/win/CS/Program.cs +++ b/win/CS/Program.cs @@ -57,18 +57,26 @@ namespace Handbrake } // Attempt to upgrade / keep the users settings between versions - if (Settings.Default.UpdateRequired) + try { - Settings.Default.Upgrade(); - // Reset some settings - Settings.Default.UpdateRequired = false; - Settings.Default.CliExeHash = null; - Settings.Default.hb_build = 0; - Settings.Default.hb_platform = null; - Settings.Default.hb_version = null; - - // Re-detect the CLI version data. - Functions.Main.SetCliVersionData(); + if (Settings.Default.UpdateRequired) + { + Settings.Default.Upgrade(); + // Reset some settings + Settings.Default.UpdateRequired = false; + Settings.Default.CliExeHash = null; + Settings.Default.hb_build = 0; + Settings.Default.hb_platform = null; + Settings.Default.hb_version = null; + + // Re-detect the CLI version data. + Functions.Main.SetCliVersionData(); + } + } + catch (Exception) + { + Functions.Main.RecoverFromCorruptedLocalApplicationConfig(); + return; } // Check were not running on a screen that's going to cause some funnies to happen. -- cgit v1.2.3