Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification for win8 changed to snoretoast by KDE . This enables not… #134

Closed
wants to merge 5 commits into from

Conversation

a7ul
Copy link
Contributor

@a7ul a7ul commented Aug 23, 2016

Changed toaster.exe to snoretoast.exe form https://github.com/KDE/snoretoast
This toaster is better than the previous one because it doesnt necessarily require the app to havea start menu shortcut present in windows8 to show notification ,As snoretoast creates it automatically.
The previous toaster.exe was giving me a lot of issues in win8 as my app didnt have a shortcut on startmenu. And i fixed it by replacing it with snoretoast which works seamlessly.

And thus notifications can now come in win8 seamlessly without any issues

…ification to be created by the app without a startmenu shortcut ,as snoretoast creates it automatically. And thus notifications can now come in win8 seamlessly without any issues
@kurisubrooks
Copy link
Collaborator

This looks extremely promising! I'll have @mikaelbr look into this.

@mikaelbr
Copy link
Owner

Looks very promising indeed. Should also remove the existing toaster.exe with this. And I need to verify that everything works as before with the same API on Windows.

@mikaelbr
Copy link
Owner

mikaelbr commented Aug 29, 2016

This seems to cause problems with default behaviour and is broken from the original toaster handling and this one:

https://github.com/master-atul/node-notifier/blob/9668eb8f7eb8ea94271020c9f57929b08801b4b9/lib/utils.js#L251-L255

When using notify cli (npm i -g https://github.com/master-atul/node-notifier) and doing notify -m "Hello, World" it causes an error:

Command failed: C:\...\node-notifier\vendor\snoreToast\SnoreToast.exe -m Hello, World -t Node Notification: -q true

as q is set to true. This should be changed to default to -silent instead to keep the existing behaviour.

@a7ul
Copy link
Contributor Author

a7ul commented Aug 29, 2016

@mikaelbr Changed -q to silent and updated the PR . Thanks for pointing out ! Had missed it . I ll just test it once more

@a7ul
Copy link
Contributor Author

a7ul commented Aug 29, 2016

@mikaelbr Fixed and tested
Can you check now ?

@@ -56,6 +56,13 @@ module.exports.fileCommand = function (notifier, options, cb) {
});
};

module.exports.fileCommandForWin = function (notifier, options, cb) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this used instead of just fileCommand? E.g. it breaks using the CLI (and probably regular invocation). But using fileCommand instead works with the cli on both cmd.exe, powershell, cmder, git bash.

@mikaelbr
Copy link
Owner

@master-atul Thanks for the update! 👍
It seems to not longer work as expected (at least through the cli), though. Also, some tests are now red. Would be wonderful if you can look into this. Again, thanks for your help and contribution 🎉

@a7ul
Copy link
Contributor Author

a7ul commented Aug 30, 2016

@mikaelbr The reason for making an additonal fileCommandForWin is because it is using child_process.spawn instead of execFile. For some reason certain exe files do not work well with execFile. And now all test cases are passing 🎉

@mikaelbr
Copy link
Owner

And now all test cases are passing

Perfect! 👍

For some reason certain exe files do not work well with execFile

We had an issue with this when referring to implicit file ending (without .exe, with the intention to automatically select correct version, either 64bit or x86), where we in some cases got the correct .exe file and other times it didn't work, but as far as I know there aren't any issues with execFile with .exe files? Or do you have other experiences?

The advantage of using execFile is that it executes the file directly instead of using a sub shell. We also don't have to do escaping on the executable when using it.

As I mentioned I had issues when using spawn with the option { shell: true }. It simply doesn't work when I try using the CLI on different shells on my Windows box.

@mikaelbr
Copy link
Owner

Merged manually. E.g. 76d2734

@mikaelbr mikaelbr closed this Jan 19, 2017
@mikaelbr
Copy link
Owner

Thanks for your work 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants