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

Installed as Windows service the screenshot is always a black image instead of the actual screen #208

Closed
kwoxer opened this issue Jun 2, 2021 · 2 comments
Labels

Comments

@kwoxer
Copy link

kwoxer commented Jun 2, 2021

Describe the bug
Installed as a Windows service the screenshot is always a black image instead of the actual screen.

To Reproduce 1
Steps to reproduce the behavior:

  1. Have a server.js with screenshot-desktop
  2. Run server.js with node-windows
  3. Now the screenshot is just a black image

To Reproduce 2
Steps to check when it works:

  1. Have a server.js with screenshot-desktop
  2. Run server.js without node-windows (in command line)
  3. Now the screenshot is correct

Expected behavior
The image should ALWAYS contain the current screen.

Environment (please complete the following information):

  • Window Server 2019 (but same also on usual Windows 10)
  • Latest node packages

Additional context
This is the command I installed the screenshot server

var Service = require('node-windows').Service;
var svc = new Service({
  name: 'Screenshot tool',
  script: 'C:\\path\\server.js'
});
svc.on('install', function(){
  svc.start();
});
svc.install();

Idea

So far what I have seen that the issue is the session ID. So the session 0 is never a real user. So it always stays black.

image

But maybe to set the resolution somewhere or changing the session ID? Is that possible maybe in this node package directly?

@kwoxer kwoxer added the bug label Jun 2, 2021
@bencevans
Copy link
Owner

Hi @kwoxer, thanks for the detailed report. I'm afraid I've just closed an issue covering the same at #185. A PR would be welcome if you find a way to solve it but shall close this as per the last comment on #185. If there's an option in the service setup to run as a particular user this may help but I believe when I tried it was still sandboxed away from the "real" desktop session.

@kwoxer
Copy link
Author

kwoxer commented Jun 3, 2021

Ok thanks, will have a look on the node-windows package.

coreybutler/node-windows#286

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

No branches or pull requests

2 participants