windows-services

How to update an installed Windows service?

那年仲夏 提交于 2019-12-03 04:36:01
I have written a Windows service in C#. I have since installed it on my machine, and it runs just fine. When you install a service, does the exe get copied somewhere? Or does it point to my bin folder? This is for me to know that when I update my code from time to time, do I have to uninstall and re-install my service to update it? If the Windows service's location has not changed and the name of its executable has not changed, you should not have to uninstall and reinstall it. You can simply stop the service, update its executable with a new version, and start it again. This approach worked

Installing a self-developed Windows Service

梦想的初衷 提交于 2019-12-03 04:15:56
I'm trying to deploy a service that I wrote. Here's the InstallLog file: Installing assembly 'c:\Users\brwatson\Development\Projects\TweetLinks\TweetLinkQueue\bin\Debug\TweetLinkQueue.exe'. Affected parameters are: logtoconsole = assemblypath = c:\Users\brwatson\Development\Projects\TweetLinks\TweetLinkQueue\bin\Debug\TweetLinkQueue.exe logfile = c:\Users\brwatson\Development\Projects\TweetLinks\TweetLinkQueue\bin\Debug\TweetLinkQueue.InstallLog Installing service TweetLinkService... Creating EventLog source TweetLinkService in log Application... Rolling back assembly 'c:\Users\brwatson

Creating Windows service without Visual Studio

此生再无相见时 提交于 2019-12-03 04:02:36
So creating a Windows service using Visual Studio is fairly trivial. My question goes a bit deeper as to what actually makes an executable installable as a service & how to write a service as a straight C application. I couldn't find a lot of references on this, but I'm presuming there has to be some interface I can implement so my .exe can be installed as a service. Setting up your executable as a service is part of it, but realistically it's usually handled by whatever installation software you're using. You can use the command line SC tool while testing (or if you don't need an installer).

Error in installing Windows service developed in .Net

拈花ヽ惹草 提交于 2019-12-03 04:02:21
问题 I have developed a windows service using C#,visual studio 2008. I have windows xp sp2 installed on my machine. When I try to install the service using installutil tool, after entering the username and password, I get following error. An exception occurred during the Install phase. System.ComponentModel.Win32Exception: The account name is invalid or does not exist, or the password is invalid for the account name specified. But the user does exist. I had created the user through control panel-

From WindowsService how can I find currently logged in user from C#?

妖精的绣舞 提交于 2019-12-03 04:01:28
I am running windows service under Administrator account and I would like to find out who is the currently logged in user. It will be different from account WindowService is currently running under. Is there any easy way to get it from c#? It is not: System.Security.Principal.WindowsIdentity.GetCurrent() neither System.Environment.UserName thanks edit I am interested who is currently logged in with Console session. thanks jadarnel27 I am not interested in other remote sessions since this is not my case scenario. Dmitry 1) Cassia should be able to give you a list of currently logged in users

Send windows message to a Windows Service

徘徊边缘 提交于 2019-12-03 03:54:38
Is there any tool to send (mimic) a windows message like 'WM_ENDSESSION' to a windows service? OR How can I send a windows message to a process using C#? (I know only C#) EDIT: Purpose: Basically I have to debug a windows service for fixing a bug that occurs only on system shut down. Generally, services don't have windows (let alone message pumps) to receive a windows message. If the bug really does only happen on shutdown (as opposed to just stopping the service), it may be the case that something depends on a resource that is going away, which is not being handled gracefully (in which case,

Simple and flexible method to run java as a windows service

怎甘沉沦 提交于 2019-12-03 03:54:05
I read SO q&a about launch java as windows service wrappers, but can't find/choose product, suitable for my requirements : Wrapper reads all java launch parameters from config file. In registry must be only commands to run wrapper itself - path to exe and maybe path to config. Always grant admin rights to change app parameters in registry is not comfortable. Working dir and path to application also must be in config. I want to place all wrapper files deep into program, because user not intrested in it. No dependencies(.net, python, etc). I don't want to extend requirements of my program. Free

What is the accepted pattern for an application that can be run as a service or as a console application

不羁岁月 提交于 2019-12-03 03:50:37
I have a project that is deployed to production as a windows service. However for local development purposes it would be useful to run it as a console application. At the moment I have a class Called ReportingHost that provides my core functionality, And a class called ReportingServiceHost that inherits from ServiceBase and allows me to run the application as a service. There is also a program class with a main method that calls ServiceBase.Run on my ReportingServiceHost. I think I need to write a ReportingConsoleHost class that allows me to run the functionality in a console. Then I need to

Check for environment variable in another process?

淺唱寂寞╮ 提交于 2019-12-03 03:33:18
In Windows, is there a way to check for the existence of an environment variable for another process? Just need to check existence, not necessarily get value. I need to do this from code. If you know the virtual address at which the environment is stored, you can use OpenProcess and ReadProcessMemory to read the environment out of the other process. However, to find the virtual address, you'll need to poke around in the Thread Information Block of one of the process' threads. To get that, you'll need to call GetThreadContext() after calling SuspendThread() . But in order to call those, you

running Elastic Search as a Windows service

有些话、适合烂在心里 提交于 2019-12-03 03:09:44
问题 Is there a way to run Elastic Search as a Windows service? It may not be possible, but I thought I would see. 回答1: As of 0.90.5+, support for running ElasticSearch as a Windows Service is officially included in the Windows distribution. http://www.elasticsearch.org/blog/0-90-5-released/ From the bin folder: > service.bat Usage: service.bat install|remove|start|stop|manager [SERVICE_ID] > service install Installing service : 'elasticsearch-service-x64' Using JAVA_HOME (64-bit): c:jvmjdk1.7 The