gen2brain / beeep

Go cross-platform library for sending desktop notifications, alerts and beeps
BSD 2-Clause "Simplified" License
1.43k stars 89 forks source link

win 8.1 - no alerts nor notifications #21

Closed ChangePlaces closed 4 years ago

ChangePlaces commented 5 years ago

Can't get this to display in win 8.1. Instead it comes up with an error "2019/01/13 02:15:38 exec: "msg": executable file not found in %PATH%"

What msg executable?

gen2brain commented 5 years ago

That command, msg replaced net send, I think since Vista. Toasts are used only on Windows 10. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/msg

ChangePlaces commented 5 years ago

From a bit of research, I found out that msg is only on the professional and above versions of windows 8, so, what's a valid workaround?

gen2brain commented 5 years ago

Well, not sure if https://github.com/go-toast/toast can work on 8.1, you can try that, change check for version 10 in https://github.com/gen2brain/beeep/blob/master/notify_windows.go and try to Notify().

Without msg I don't think it is possible to work on older versions, for older Popup/Notification to show, like in Windows 7, app must create window and add tray icon to systray to be able to do that.

ChangePlaces commented 5 years ago

Could you do a syscall to the Windows API/MFC that has bubbles appear on an icon in the systray? I have read about people copying msg.exe from xp / vista to 8.1 with success

gen2brain commented 5 years ago

For bubbles app needs window created and it needs icon in systray connected with that window, probably needs to be also visible in order to show bubble, and that is up to user to decide I think, what is visible/hidden. So for every Notify() it will need to do all that and then to remove all that, doesn't sound good if possible at all.

gen2brain commented 5 years ago

I added "baloon" notifications in https://github.com/gen2brain/beeep/commit/6be9b2e884c0b6bdc4202095ed8bf1dede7ac2ba . It will try that first and fallback to "msg" if Windows version is not 10 .

martinlindhe commented 5 years ago

Windows 8.1 was end-of-lifed January 9, 2018 [1]. Not sure you want to stay on it or bother with supporting it.

1: https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet

gen2brain commented 4 years ago

Not a big deal to support older versions, if what we have now works there. The code for that is simple. Closing this issue.