diff --git a/DotN64.Desktop/Updater.cs b/DotN64.Desktop/Updater.cs index 2da7838..8ab2983 100644 --- a/DotN64.Desktop/Updater.cs +++ b/DotN64.Desktop/Updater.cs @@ -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 }