windows-services

Create GUI from Windows Service with a Network Log on

百般思念 提交于 2019-12-06 00:34:59
I have been reading a lot about executing a GUI application from a Windows Service. The "Allow service to interact with desktop" check box worked for me when the Service runs as the SYSTEM user (I am using Windows XP). Now I need the Service to run as a User defined in a domain (from the network). Everything works fine (even if no user is logged into the machine) but the GUIs are not shown (even if the same network user is logged in!). I know that the GUIs are running, it's just that they are hidden. Why is that? Is there a way to show them if a user is logged on (like when created by the

How to communicate between Windows Services

安稳与你 提交于 2019-12-06 00:18:33
问题 I have 2 windows services that I created using C#. I would like one of the services to call a function in the second windows service. How should I do it? EDIT: The issue is That I have to application that running ( I don't need them to be Rather service Process is good too) but I need this 2 application to communicate, this 2 application are on the same server, 回答1: Sure. There are a bunch of IPC mechanisms you could use. Remoting, TCP/HTTP Listeners, etc. Does either service provide

How to pass parameters in windows service from Installer to Main function in Program.cs?

送分小仙女□ 提交于 2019-12-05 23:00:36
I have successfully passed parameters from Installutil to my serviceinstaller but i cannt seem to pass these parameters to the Main(string[ args] function. Here is how i am trying to do this ....if there is any better wayto do what i am doing please let me know protected override void OnAfterInstall(IDictionary savedState) { base.OnAfterInstall(savedState); string[] args = new string[2]; args[0] = Context.Parameters["username"]; args[0] = Context.Parameters["password"]; new ServiceController(this.dataLoaderServiceInstaller.ServiceName).Start(args); } and this is my Program.cs static void Main

Virtual Service Account without Network Access, like NT AUTHORITY\\LocalService

只谈情不闲聊 提交于 2019-12-05 20:56:48
Background: I'm writing a service and want to give it as few privileges as necessary. Virtual Accounts (sometimes "Virtual Service Accounts") are sparsely documented feature new to Windows 7/2008R2 that are automatically managed accounts for services that need minimal privileges but access the network with a computer identity in a domain environment. My service doesn't need network access, so I'm using LocalService, but I don't like the fact that if I grant access to a file/etc I granting access to all services running as that account. Is there a least privileged account I can use? You don't

Failed installing 'tomcat 7' service

▼魔方 西西 提交于 2019-12-05 20:19:58
问题 I tried to install Tomcat as a service with the service.bat file in CATALINA_HOME\bin\ but it ends just showing the error: Failed installing 'tomcat 7' service Any clue? 回答1: Finally, it was easier. First, try to remove any other Tomcat service already installed service.bat remove . Second, install the service service.bat install and voilà! Thanks for your time. 回答2: It appears to be a permission issue, where are you running the installation from, I had this issue when trying to install from

Windows Service is giving Description: <Failed to read description error code 2>

耗尽温柔 提交于 2019-12-05 20:17:54
问题 I have tired to uninstall a disabled windows service through registry It is removed from registry but it is still showing in Services.msc with Description: Failed to read description error code 2 回答1: Intuition/How you got there - I am assuming you did either or both of these to land in this error message. a.Deleted the key manually from registry by HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services and deleted the service from here) b.This service was in "automatic" start - so on deleting

unhandled exceptions in a windows service

旧城冷巷雨未停 提交于 2019-12-05 19:59:18
I have created a .net c# windows service that runs multiple tasks. I included exception handling in it but I would like to set up a global handler to catch unhandled exceptions in the windows service, how can I do this? I included exception handling in it but I would like to set up a global handler to catch unhandled exceptions in the windows service You could use AppDomain.UnhandledException . In your case however, your entire call to your service can be wrapped in a try/catch block. Since you haven't provided details for what you plan to do with this unhandled exception, your correct path I

Problem stopping Windows Service from Installer Class. Events fire too late

…衆ロ難τιáo~ 提交于 2019-12-05 19:36:35
I'm using Visual Studio 2010 with .NET 4.0. I have a windows service that is installed from a Visual Studio Setup Project. In the setup project I have the RemovePreviousVersion property set to True. In the project that contains the service I have an installer class that will be used to stop the service when upgrading from a previous version. So when upgrading the software the service will already exist and could be running. If it is running then during the installation the installer prompts that the file is already in use and gives the option to Try Again, Continue or Exit Installation. At

How do I install a C# Windows service without creating an installer?

陌路散爱 提交于 2019-12-05 19:11:16
问题 Does anyone know if there is a way to install a Windows service created in C# without making an installer? 回答1: You can use installutil . From the command line: installutil YourWinService.exe This utility is installed with the .NET Framework 回答2: I include a class that does the installation for me. I call the application using command line parameters to install or uninstall the app. I have also in the past included a prompt to the user whether they wanted the service installed when started

Windows Service doesn't start automatically

ぐ巨炮叔叔 提交于 2019-12-05 18:59:34
I have a windows service written in .Net 3.5 set to be automatically start, but it wouldn't start when system reboots. As I understand, it may be caused by my service's dependency aren't started when the services tries to start. I don't know what my service depends on. I tried the workaround by adding windows print spooler as one of my service's dependencies, since print spooler is one of the services start quite late during the boot-up. Well, the work around doesn't work neither. I'm using windows server 2003 r2. so the "delayed automatically restart" option is not available to me. and I can