summaryrefslogtreecommitdiffstats
path: root/win/CS/Program.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-03-31 20:11:30 +0000
committersr55 <[email protected]>2011-03-31 20:11:30 +0000
commit3c4b07d3cfb12d0d3318b37f790c0d7f872a68ab (patch)
treeea699a2a4066423ef18ba63f4cfe4eedb49023b7 /win/CS/Program.cs
parentb08d9e92f647fc005397b96d37853cb4a36910f3 (diff)
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
Diffstat (limited to 'win/CS/Program.cs')
-rw-r--r--win/CS/Program.cs30
1 files changed, 19 insertions, 11 deletions
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.