Is this a practical use of a service?

ぐ巨炮叔叔 提交于 2019-12-11 03:37:33

问题


I need to run an application which processes hooks in background. The problem is that I have to start it automatically on systemstart as administrator. I've tried to use the windows task scheduler but on some systems it does not start the program as administrator which causes strange behaviours. I've never written an windows service but would that be a solution to create windows service? And if yes: Does it start automatically as administrator on systemstart? How can i communicate with the service from an configuration program? And as last question: If I am right, I need to install a service through an installer like a msi-package. How would you create such a msi-package. Visual Studio 2012 does not support that anymore.

It would be very nice if someone could help me. Sorry for my bad English but I am giving my best. If you don't understand some parts of my question, just ask me.


回答1:


1) Yes, this sounds a lot like you should write a service.

2) If you configure it so, by default they start with a special service account.

3) You can find a lot of good information about communicating with a service here: How to communicate with a windows service from an application that interacts with the desktop?

4) You don't have to. Do you use C# for example? You can then make use of a nice library called TopShelf to write your service.



来源:https://stackoverflow.com/questions/18041857/is-this-a-practical-use-of-a-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!