-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Squirrel version(s)
2.0.1
Description
RestartApp causing AbandonedMutexException
Steps to recreate
- Start up application that is using GitHubUpdateManager
- Leave the application running for 5 minutes (to ensure app has finished update process)
- Select manual user action that calls to UpdateManager.RestartApp();
Expected behavior
The application should restart without causing an exception
Actual behavior
The application does restart but an exception is logged in event log:
"Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Threading.AbandonedMutexException
at Squirrel.SingleGlobalInstance.Finalize()"
This occurs as old version is shutting down.
Additional information
I have a c# winform application with the following code in program.cs:
` static async Task Main()
//static void Main()
{
AppLogging.WriteLog("Checking for updates...");
using (var mgr = UpdateManager.GitHubUpdateManager(Properties.Settings.Default.GitHubPath))
// "https://github.com/grips-tiresoft/webprintingapp"
{
try
{
await mgr.Result.UpdateApp();
mgr.Result.CreateRunAtWindowsStartupRegistry();
}
catch (Exception e)
{
AppLogging.WriteLog(string.Format("Exception: {0} occurred, message: {1}", e.InnerException.GetType().ToString(), e.InnerException.Message));
}
}
AppLogging.WriteLog("Update Check completed");
There is action that user can invoke:
private void Restart_Click(object sender, EventArgs e) { UpdateManager.RestartApp(); }
Additionally, no message was logged in catch statement above, so it is not occurring during the update phase.