windows-services

Wix installer to replace INSTSRV and SRVANY for user defined service installation

半腔热情 提交于 2019-11-27 09:22:40
I created an executable MyService.exe using Visual Studio C# Express. There are no options in the Express version to create a service. In the past, this has been manually installed as a user defined service using the INSTSRV and SRVANY as described in the MSDN Article 'How To Create a User-Defined Service' Is it possible to create a wix 3.5 installer for this file that doesn't require the existence of the SRVANY.exe and INSTRV.exe files on the target machine does not use INSTSRV.exe as a custom action WiX does support installing Windows services, but only native ones. This means that the

Check if a Windows service exists and delete in PowerShell

為{幸葍}努か 提交于 2019-11-27 09:14:47
问题 I am currently writing a deployment script that installs a number of Windows services. The services names are versioned, so I want to delete the prior Windows service version as part of the installs of the new service. How can I best do this in PowerShell? 回答1: You can use WMI or other tools for this since there is no Remove-Service cmdlet until Powershell 6.0 (See Remove-Service doc) For example: $service = Get-WmiObject -Class Win32_Service -Filter "Name='servicename'" $service.delete() Or

Installing multiple instances of the same windows service on a server

醉酒当歌 提交于 2019-11-27 09:04:53
问题 So we've produced a windows service to feed data to our client application and everything is going great. The client has come up with a fun configuration request that requires two instances of this service running on the same server and configured to point at separate databases. So far I haven't been able to get this to happen and was hoping my fellow stackoverflow members might be able to give some hints as to why. Current setup: I've set up the project that contains the windows service, we

How to solve “The specified service has been marked for deletion” error

怎甘沉沦 提交于 2019-11-27 08:55:09
问题 I try to remove a Windows Service with sc delete <service name> , and encounter the following error: [SC] DeleteService FAILED 1072: The specified service has been marked for deletion. What I've already done: Stopped the service, obviously. The sc queryex "<service name>" gives the following result: SERVICE_NAME: Stub service TYPE : 10 WIN32_OWN_PROCESS STATE : 1 STOPPED WIN32_EXIT_CODE : 1067 (0x42b) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 PID : 0 FLAGS : Ensured that

How do I uninstall a Windows service if the files do not exist anymore?

放肆的年华 提交于 2019-11-27 08:54:28
问题 How do I uninstall a .NET Windows Service, if the service files does not exists anymore? I installed a .NET Windows Service using InstallUtil. I have since deleted the files but forgot to run InstallUtil /u first. So the service is still listed in the Services MMC. Do I have to go into the registry? Or is there a better way? 回答1: You have at least three options. I have presented them in order of usage preference. Method 1 - You can use the SC tool (Sc.exe) included in the Resource Kit.

Unable to create connectionstring for a remote desktop for a C# application

廉价感情. 提交于 2019-11-27 08:47:15
问题 I want to create a Windows service which will copy data from one database to another database. The source database is in a remote location, below is the function using SqlConnectionStringBuilder and creating the connection string: public string CreateConnectionString() { SqlConnectionStringBuilder b = new SqlConnectionStringBuilder(); b.DataSource = "ABCKOL-BCKOFF\\SQLEXPRESS"; b.InitialCatalog = "netXs"; b.IntegratedSecurity = false; b.UserID = "userid"; b.Password = "password"; return

wix service install not enough permission

谁说胖子不能爱 提交于 2019-11-27 08:38:10
问题 I'm trying to create an installer with WiX for a window service, I tried all the answers that I had found and nothing. The installer created with WiX still won't install because of permission, not enough permission... this is my code... <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'><?define G_TargetDir=$(var.G.TargetDir)?> <Product Id="*" Name="G.Installer" Language="1033" Version="1.0.0

How do I change a Windows Service's startup type in .NET (post-install)?

自古美人都是妖i 提交于 2019-11-27 08:14:50
I have a program that installs a service, and I'd like to be able to give the user the option later on to change the startup type to "Automatic". The OS is XP - if it makes any difference (Windows APIs?). How can I do this in .NET? C# if possible! :) You can use the OpenService() and ChangeServiceConfig() native Win32 APIs for that purpose. I believe that there is some information on pinvoke.net and of course on MSDN . You might want to check out the P/Invoke Interopt Assistant . I wrote a blog post on how to do this using P/Invoke. Using the ServiceHelper class from my post you can do the

windows service screen capture returns black screen

给你一囗甜甜゛ 提交于 2019-11-27 08:08:41
问题 I'm trying to create windows service application to capture screen. Previously i had problem of starting the service. Anyhow I'm able to solved it and now I'm having another problem. Now image is saving but it saves as a black screen. for this also there's lot of questions asked in SOF, but i couldn't able to solve my problem. Here what i have tried so far: public partial class ScreenCaptureService : ServiceBase { private static Bitmap bmpScreenshot; //private static Graphics gfxScreenshot;

Delphi 2009: How to communicate between Windows service & desktop application under Vista?

我只是一个虾纸丫 提交于 2019-11-27 07:55:27
How can a desktop application communicate with a Windows service under Vista/Windows2008/Windows7? The application needs to send small strings to the service and receive string responses back. Both are written in Delphi 2009. (Please provide sample code also) The way to go is named pipes , you'll probably have to take a look at the communication across different Integrity levels . This article explores how to do this in vista. Although it's written in c++ it's just basic Windows API calls, so it should translate fast enough to Delphi. If you want to search for more on this subject, this