diff --git a/BizHawk.Client.EmuHawk/Program.cs b/BizHawk.Client.EmuHawk/Program.cs index a6a5e5a538..47d97f0f1b 100644 --- a/BizHawk.Client.EmuHawk/Program.cs +++ b/BizHawk.Client.EmuHawk/Program.cs @@ -121,8 +121,19 @@ namespace BizHawk.Client.EmuHawk HawkFile.ArchiveHandlerFactory = new SevenZipSharpArchiveHandler(); string iniPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config.ini"); - Global.Config = ConfigService.Load(iniPath); + + try + { + Global.Config = ConfigService.Load(iniPath); + } catch (Exception e) { + new ExceptionBox(e).ShowDialog(); + new ExceptionBox("Since your config file is corrupted, we're going to recreate it. Back it up before proceeding if you want to investigate further.").ShowDialog(); + File.Delete(iniPath); + Global.Config = ConfigService.Load(iniPath); + } + Global.Config.ResolveDefaults(); + BizHawk.Client.Common.StringLogUtil.DefaultToDisk = Global.Config.MoviesOnDisk; BizHawk.Client.Common.StringLogUtil.DefaultToAWE = Global.Config.MoviesInAWE;