Request - gracefully exit on windows shutdown

Would it be possible to make emclient exit gracefully when the os is shutting down.

I have a habit of not closing each app manually before restarting windows. That makes emclient always check its database when I start it again. The wait is annoying and I feel like I’m hurting the poor little thing. :joy:

I think windows sends a exit signal to the apps for which an app should be able to react. It’s not a hard kill, sind something like unsaved changes in notepad can actually prevent the shutdown. So I’m guessing it should be possible.

No other app I know of reacts this sensible.

I’d really love to see an improvement, since I stopped using em because of this. It’s a little thing but it somehow annoys me this much. I cannot be the only one…

Would it be possible to make emclient exit gracefully when the os is shutting down.

No due the Windows OS does not allow a graceful shutdown “of an open SQL light database that eM Client uses”, so the OS then just normally kills the database and can potentially corrupt it and then cause a repair database on reopen of eM Client.

So the only option to avoid corrupting the database if you leave eM Client open, is to either “close / exit eM Client before you shutdown Windows”, or “shutdown in sleep mode” which alot of users do.

1 Like

Can’t you react on SystemEvents.SessionEnding Event and do the db shutdown yourself?

Sleep obviously doesn’t help with Windows Updates or restarts for other housekeeping reasons…

We have no support on the Windows OS. You would need to contact Microsoft tech support.

Sleep obviously doesn’t help with Windows Updates or restarts for other housekeeping reasons.

I personally use Shutdown in sleep mode with Windows 11 and eM Client V10.3 and works fine for me with updates etc.

1 Like

I guess a workaround could be to create a scheduled task that triggers on EventId 1074 (that’s shutdown) and executes a let’s say autohotkey script which closes the window. But the user shouldn’t have to do that…

EmClient does run on Windows. Why can’t it access it’s API?

EmClient does run on Windows. Why can’t it access it’s API?

We don’t have any info on the programming side of eM Client on this free community forum other than the database is SQL Lite.

1 Like

sorry, I thought the developers also read here.

But you’re right. It does actually work. EmClient actually closes gracefully on shutdown. I just didn’t notice it, since my laptop likes to crash on hibernation and there’s no way to recover from that…

Yes, we read this. eM Client should of course exit on Windows shutdown gracefully and it does in most cases. However there might be some circumstances when it does not work that well.

For diagnosing purposes we would need:

  1. Import the attached .reg file
  2. After next shutdown go to Menu > Help > Open Log Directory in eM Client
  3. Send us the log files with names starting with “WM Tracing”

shutdown.reg

the shutdown.reg as shown contains:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\eM Client\Logging]
“Shutdown”=dword:00000001

Unfortunately, in windows 10, the registry has only one folder under eM Client, and that is “profiles”.

So, do we add the one for “shutdown”, and the value as shown?

imho, I would have suspected that the update that enabled that capability would have added that.

And while it has not been stated in this thread (yet), is the case where one is called away from the computer (working from home), and does not get back it. Later that day, some system/application update gets installed, and it forces a system reboot afterwards.

This is the situation that I get caught in most times, and when I get back to the computer, and am greeted with windows logon screen, I know it will be a long time until I have mail back.

Granted, my mail_data.dat file is just shy of 8gb. I migrated off Outlook because the PST/OST got corrupted, and Outlook was unable to fix it. EMC was able to recover the file without dropping anything, and I have been very happy withall support EXCEPT for this problem.

I think I started while I was on win7, and as I recall, shutdowns waited for EMC to go away. This new “feature” appeared (from memory) with win10. And with a 8gb mail file, it takes a while to validate that there were no corruptions.

:frowning: