Installing service without admin rights

a 夏天 提交于 2019-12-13 07:38:16

问题


Yesterday I was playing with the WindowsService project option on Visual Studio and when trying to install my service I was facing errors, after a few tries it finally occurred to me that I would probably need admin rights to install a service. And it did install when I switched to "Run as Administrator". But what it got me thinking, is that, how are other programs, like PunkBuster, AMD Drivers, Adobe Acrobat Update Service, Filezilla Server FTP... and so on, capable of installing a service by simply running an executable and not showing any kind of window to request admin rights? I mean, if I really wanted to, how would I go about doing the same with an application created by me?


回答1:


This is not the answer you want to hear, nonetheless it is the answer: That's not possible. You do need admin rights to install Windows services, and there is no way around this.

The other programs you mentioned most likely got the admin rights already (like requested it when started) or asked the user for these rights at runtime.




回答2:


you can make a install package, for example, use installshield, this tool can do something for you: register COM objects, install/uninstall services.



来源:https://stackoverflow.com/questions/22114417/installing-service-without-admin-rights

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