Hi,<br>I'm creating an application that needs to run CherryPy as a background service.<br>It currently works fine in Linux and Mac OS X, but I'm a bit struggling to make the windows version as I'm new to win development.<br>
<br>My code is a barely modified version of what can be found here : <a href="http://tools.cherrypy.org/wiki/WindowsService">http://tools.cherrypy.org/wiki/WindowsService</a><br>I've compiled it using py2exe and can run it without any problem logged as an administrator.<br>
The thing is that when I try to install the service on a default user account, I get an error 5 — "Access is denied" from OpenSCManager.<br><br>C:\cherrypy_service\cherrypy_service.exe -install<br>Traceback (most recent call last):<br>
File "boot_service.py", line 158 in <module><br> File "win32serviceutil.pyo", line 156, in InstallService<br>pywintypes.error: (5, ’OpenSCManager’, ’Access is denied.’)<br><br>I've tried to install it with "sc create cherryPyService binPath=C:\cherrypy_service\cherrypy_service.exe", even with specifying the username and password, but the result is the same : <br>
<br>[SC] OpenSCManager FAILED 5:<br>Access is denied.<br><br>What is the correct way to install a service for a non-admin account on windows ?<br><br>Since I'd also like to create an installer for my app (I need to append a new entry in the %SystemRoot%\system32\drivers\etc\hosts file), I guess that I could install my service in the same time using admin privileges. Would that be possible ? What tool would you recommand for this ?<br>