Bug: Sometimes system tray icon disappears, app must be force quit
What happened?
Sometimes 2FAGuard doesn't show up in the system tray, but is still running in the background. Then if I try to run 2FAGuard from the Windows Start Menu (or any other way of starting), I get a message box saying "App is already running" "This app can only be executed once at a time". I'm not a Windows programmer but as far as I know you can switch execution to the existing process rather than put up the message box. Whether or not it's caused by the system tray process it seems like it would be an improvement to always switch the active process rather than scolding the user.
As far as the system tray maybe just refreshing whatever call loads it into the tray from time to time. I hibernate pretty often and I don't know that's related. Certainly sometimes it hibernates and wakes up without the problem. I'll report back if I notice that the problem only happens on recovery. Anyway I think your app should get a Windows Message on wakeup so maybe adding code to refresh the tray icon would help.
Once it stops getting shown in the tray the only workaround is to use Task Manager to force quit 2FA an open it again. My other suggestion above would mitigate the issue since it would be very easy to reload from the Start menu
BTW, I use 2FA every day, thanks for providing it. The Windows Hello integration is great.
Provide the error message / stack trace
"App is already running" "This app can only be executed once at a time"
What version of Windows are you using?
Windows: Edition Windows 11 Pro Version 23H2 Installed on 2022-12-23 OS build 22631.4037 Experience Windows Feature Experience Pack 1000.22700.1027.0
What version of the app are you using?
v1.4.0.0 Desktop
Thank you for your detailed bug report / feature request. Will improve the user experience for opening multiple instances and investigate the system tray issue.
The reason for this may be https://github.com/lepoco/wpfui/issues/147. When I restart the Windows Explorer process, the tray icon is not displayed anymore.
Partially fixed in version 1.5.1. You can now open the app when it is minimized to the tray and the existing window is brought to the foreground.
Hi @jdunham22, are you still facing this issue? If yes, did you find out if it only happens on recovery? The biggest effects of this issue (manually stopping 2FAGuard) should be solved.
I didn't find any new information but with the recent app changes it has been working great for me, thanks. I haven't needed to kill the app at all since the updates.