windows-services

Access denied using Py2exe

社会主义新天地 提交于 2019-12-01 00:02:33
问题 I'm using Py2exe to create an executable as a windows service. When I run the script I get this error: File "C:\TeamCity\buildAgent\work\582d895bd5b431ac\winpython\WinPython-32bit-2.7.3.3\python-2.7.3\lib\site-packages\py2exe\build_exe.py", line 860, in build_executable add_resource(ensure_unicode(exe_path), script_bytes, u"PYTHONSCRIPT", 1, True) RuntimeError: EndUpdateResource: Access is denied. This is the call to py2exe: setup( name = NAME, description = DESCRIPTION, version = '1.0.133.43

How can I replace the current Java process, like a unix-style exec?

瘦欲@ 提交于 2019-11-30 23:53:18
I have a server written in Java that runs as a Windows service (thanks to Install4J). I want this service to be able to download the latest version of the JAR file it runs from, and start running the new code. The stitch is that I don't want the Windows service to fully exit. Ideally, I would accomplish this by a unix-style exec() call to stop the current version and run the new one. How can I best accomplish this? Here is a complicated, but portable, way. Split your code into two jars. One very small jar is there just to manage process startup. It creates a ClassLoader that holds the other

How to create multiple instance of window service?

家住魔仙堡 提交于 2019-11-30 23:43:55
I want to run multiple instances of a window service installed on a server without installing window service again. How is this possible? A service "installation" is really just adding a mapping between a name, an executable, and a few other bits of metadata. A service, once installed, is either running (once), or it isn't. To have multiple instances running as services , they would have to be registered with different names, which basically means installing it multiple times. That does not , however, mean that you need multiple different copies of the executable. The way I do it is to

SignalR self hosted windows service, listening for messages

♀尐吖头ヾ 提交于 2019-11-30 23:23:39
I'm attempting to build a windows service that's self-hosting SignalR. I have read through tutorials such as SignalR Self-Host on ASP.Net I'm noticing that, least it seems, that they're based around broadcasting messages, and can't seem to find anything around listening. I need to listen to messages from within the service, as well as broadcast. We already have our backplane setup - it's the same one that the site uses. In a web site I can join a group, via Javascript. How do I join a group in a self-hosted SignalR service. In a web site I register a callback on a hub. How do i register the

Running Windows Service Application without installing it

梦想与她 提交于 2019-11-30 23:16:33
问题 Whem I'm writing a Windows Service and just hit F5 I get the error message that I have to install it using installutil.exe and then run it. In practice this means everytime I change a line of code: compile switch to Developer Command Prompt remove old version install new version start service That is very inconvenient. Is there a better way to do it? 回答1: I usually put the bulk of the service implementation into a class library, and then create two "front-ends" for running it - one a service

SpecialFolder.MyDocuments giving correct value in a console application but not on a Windows Service

独自空忆成欢 提交于 2019-11-30 22:51:17
I have a windows service running on my machine. When I do a Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) it gives me empty string but when I do the same thing in a console application it gives me the correct location of my MyDocuments folder. Any ideas as to why it might be happening? That is because when you run the application as a Console you are running signed in to the computer as you, the user, and can therefore access your "My Documents". When the Windows Service is running (by default) it will run as Local System which doesn't have a "My Documents" folder.

Windows service / A new guard page for the stack cannot be created

与世无争的帅哥 提交于 2019-11-30 22:40:11
问题 I have a windows service that does some intensive work every one minute (actually it is starting a new thread each time in which it syncs to different systems over http). The problem is, that after a few days it suddenly stops without no error message. I have NLog in place and I have registered for 'AppDomain.CurrentDomain.UnhandledException'. The last entry in the textfile-log is just a normal entry without any problems. Looking in the EventLog, I also can't find any message in the

Launching GUI App from Windows Service - Window Does Not Appear

梦想的初衷 提交于 2019-11-30 20:47:50
I have written a simple windows service which will launch a exe specified in the onstart() method of the service. After starting the service the exe got launched it only presents in the memory but it doesnt show in the explorer. I'm trying to launch a calc.exe from my code.it shows the exe in the memory but it doesnt comes into my view(i.e) in the explorer. Below is my code to launch the exe in the onStart() method Process pr=new Process(); pr.StartInfo.FileName="calc.exe"; pr.StartInfo.WindowStyle=ProcessWindowStyle.Maximized; pr.StartInfo.CreateNoWindow=false; pr.Start(); // pr.WaitForExit()

Debugger.Launch() on windows service in Windows 8

北慕城南 提交于 2019-11-30 20:46:23
After I installed Windows 8 perfectly legit statement like this doesn't work anymore: #if DEBUG Debugger.Launch(); #endif Service starts ignoring that thing. Yes, I am building the project in a debug mode. if I change that to a Debugger.Break() - the service just fails, and still there's no dialog for attaching a debugger. Debugger.Launch would launch an application with a visual GUI. By default services do not interact with a desktop and thus anything they do cannot be "seen". Support for interacting with the desktop has slowly been removed from Windows services ("Interact with the desktop"

Debug.WriteLine() is not hit

青春壹個敷衍的年華 提交于 2019-11-30 20:27:52
问题 I am debugging a Windows service (by hitting F5 in Visual Studio 2010) using the following code: In Program.cs file: static void Main() { if (!Environment.UserInteractive) { // We are not in debug mode, startup as service ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new MyServer() }; ServiceBase.Run(ServicesToRun); } else { // We are in debug mode, startup as application MyServer service = new MyServer(); service.StartService(); System.Threading.Thread.Sleep(System