Updater: Complete Windows update even in case of unhandled exceptions.

master
Nabile Rahmani 2018-12-11 21:19:13 +01:00
parent 719107d459
commit 3cadb9a179
1 changed files with 4 additions and 1 deletions

View File

@ -150,12 +150,15 @@ namespace DotN64.Desktop
scriptFile.Attributes |= FileAttributes.Hidden;
AppDomain.CurrentDomain.ProcessExit += (s, e) => Process.Start(new ProcessStartInfo(scriptFile.FullName)
void RunScript() => Process.Start(new ProcessStartInfo(scriptFile.FullName)
{
UseShellExecute = false,
CreateNoWindow = true,
WorkingDirectory = InstallDirectory
});
AppDomain.CurrentDomain.ProcessExit += (s, e) => RunScript();
AppDomain.CurrentDomain.UnhandledException += (s, e) => RunScript();
}
#endregion
}