windows-services

Specify Windows Service Name on install with Setup Project

假如想象 提交于 2019-12-21 03:37:18
问题 Objective: In support of a Windows Service that may have multiple instances on a single machine, use a Setup Project to create an MSI capable of: Receiving user input for Service Name Installing service Serializing Service Name from 1 (so that the proper name can be used in logging and uninstall) My initial hope was to set Service Name in App.config (and then retrieve it during uninstall upon instantiation of the ServiceInstaller. This seems to have been naive, because it is not accessible

How can I change the name of a windows service?

一曲冷凌霜 提交于 2019-12-21 03:36:23
问题 I have a windows service application developed in C#. The same service needs to be run with different config files. To run on these on the same machine I would need to change the name of the service. I can create multiple copies of the solution, but not sure how to change the names of the services. Thanks 回答1: In your win service class that derives from ServiceBase , there is a property that is inherited that you can set called ServiceName . You could make an app.config, add a setting for the

How to hide windows service from task manager in windows desktop

▼魔方 西西 提交于 2019-12-21 02:54:36
问题 I am creating windows service in desktop while running its showing on task manager . So is there any api or any procedure for hide service diagrammatically.can you pls send some sample code for service which can hide from task manager . 回答1: No. TaskManager is designed to list the applications running. You cannot legitimately hide an app from TaskManager Processes tab. You could give your app a clever name to disguise it. But really, there's a security reason that all processes will be listed

c# Granting “Log On As Service” permission to a windows user

二次信任 提交于 2019-12-20 18:34:21
问题 how do I grant a user the LogOnAsService right for a service? I need to do this manually, in the services.msc app I can go to the service, change the password (setting the same that there was before), click apply and I get a message: The account .\postgres has been granted the Log On As Service right. How do I do this from code, because otherwise I have to give this permission by hand each time I run the application and this is not a possibility @Steve static void Main() { // irrelevant stuff

Installing a self-developed Windows Service

浪尽此生 提交于 2019-12-20 17:35:02
问题 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

What is the difference between a windows service and a regular application?

橙三吉。 提交于 2019-12-20 16:33:27
问题 I have only created regular windows applications (C# mostly). What differentiates a windows service from a regular windows application? What makes them different? What can a service do that an application can't? What are the differences seen from a developers point of view? How do you create one? Is it just to create a regular application (Console application maybe, since there are no gui?) and run or install it in a special way, or is it more that has to be done? 回答1: There are a couple of

Converting a Console Application to a service?

删除回忆录丶 提交于 2019-12-20 13:00:55
问题 I'm looking for different ways with strengths/weaknesses for converting a console application we are using long term in to a windows service. We use something called java service wrapper for ActiveMQ, and I believe people have told me you can wrap anything with it. That's not saying that you should wrap anything with it though; we've had our issues with this setup. The console app is a .NET console application that by default logs a lot of info to the console, though this is configurable. Any

Send windows message to a Windows Service

社会主义新天地 提交于 2019-12-20 12:42:23
问题 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. 回答1: 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

How do I fix 'Setup project with custom action file not found' exception?

﹥>﹥吖頭↗ 提交于 2019-12-20 11:14:04
问题 I am trying to create a setup project for a Windows Service. I've followed the directions at http://support.microsoft.com/kb/816169 to create the setup project with no trouble. I want to be able to get a value during the installation in order to update the app.config with the user's desired settings. I added a Textboxes (A) dialog to retrieve the values. I set the Edit1Property property to "TIMETORUN", and in my Primary Output action's CustomActionData property I put in the following:

Windows Service Install Ends in Rollback

旧时模样 提交于 2019-12-20 11:01:35
问题 When I try to install a Windows service: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil I get, what looks to be, some success messages and some failure messages. Part way down: An exception occurred during the Install phase. System.ComponentModel.Win32Exception: The specified service has been marked for deletion At the end: The Rollback phase completed successfully. The transacted install has completed. The installation failed, and the rollback has been performed. The service is