Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js windows service , cannot spawn GUI app from service

I am running a Node.js application inside a windows service using NSSM , Once a day i check a remote API and spawn an executable file that pops a notification balloon in the system tray .
When i run this from a console session this works as expected , but when running from a windows service , i see the notification executable in running processes list , but the balloon does not show up . I guess that a service isn't supposed to have a user interface . But there must be a way to do it ..

When i run services.msc , Select my service > Properties > Log On > Mark 'Allow service to interact with desktop` does not help .

The code is : spawn("notify.exe", {cwd: path.resolve(__dirname, "/tools")});

What can cause such behavior ?

like image 545
Alexander Avatar asked May 20 '26 13:05

Alexander


1 Answers

You are running headlong into "Session 0 Isolation", a security enhancement present in Windows Vista and later. The notification balloon in the system tray created by your service will never be shown on any user's desktop irrespective of the "Allow service to interact with desktop" setting, which is now misleading.

like image 82
CoreTech Avatar answered May 22 '26 03:05

CoreTech



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!