windows-services

Kill windows service forcefully in WIX

点点圈 提交于 2019-11-28 14:43:05
I have windows service which will get installed as part of wix installation . Problem is that, currently service is in production and it is not responding to stop due to some poorly written code in service OnStop method . So next time when the user tries to install upgraded version installation will fail because service will never stop when wix tries to stop the service . Is there any way in which i come to know if wix is taking too much time to uninstall and i can kill the process if i get that notification ? Also, is there any way i can kill process based on product version ? Thanks I

Restarting windows service during WIX upgrade

你。 提交于 2019-11-28 14:38:57
We have a windows service installed as a part of our msi WIX installer . During upgrade we are trying to just restart service instead of doing complete reinstall to safe guard the service user creds. A lot of posts discussed in this regard but nothing is conclusive. Tried out disabling DeleteServices during upgrade by doing below, <InstallExecuteSequence> <DeleteServices>NOT UPGRADINGPRODUCTCODE</DeleteServices> </InstallExecuteSequence> Note: The above code is in old MSI as well But still saw service getting actually deleted and reinstalled. Tried disabling installservice during upgrade as

How to create Windows Service in C/C++? [closed]

故事扮演 提交于 2019-11-28 14:29:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I want to create Windows Service (application running in background) using C/C++ language. How can I do this, can you give me a tutorial ? 回答1: Another platform independent way is to use boost::application Example how to use can be found here. 来源: https://stackoverflow.com/questions/18557325/how-to-create

wix service install not enough permission

久未见 提交于 2019-11-28 14:20: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.0" Manufacturer="" UpgradeCode="PUT-GUID-HERE"> <Package InstallerVersion="200" Compressed="yes"

Screenshot of process under Windows Service

天涯浪子 提交于 2019-11-28 13:47:13
We have to run a process from a windows service and get a screenshot from it. We tried the BitBlt and PrintWindow Win32 calls, but both give blank (black) bitmaps. If we run our code from a normal user process, it works just fine. Is this something that is even possible? Or could there be another method to try? Things we tried: Windows service running as Local System, runs process as Local System -> screenshot fails Windows service running as Administrator, runs process as Administrator -> screenshot fails. Windows application running as user XYZ, runs a process as XYZ -> screenshot works with

How to get windows service name from app.config

爷,独闯天下 提交于 2019-11-28 13:42:58
i have a app.config <appSettings> <add key="ServiceName" value="HasService"/> <add key="ServiceDisplayName" value="HasService"/> </appSettings> my service installer class [RunInstaller(true)] public class MyServiceInstaller : System.Configuration.Install.Installer { public MyServiceInstaller() { var process = new ServiceProcessInstaller {Account = ServiceAccount.LocalSystem}; var serviceAdmin = new ServiceInstaller { StartType = ServiceStartMode.Manual, ServiceName = "HasService", DisplayName = "HasService" }; Installers.Add(process); Installers.Add(serviceAdmin); } } i want to get service

How to run excel vba code from a Windows Service

假如想象 提交于 2019-11-28 12:54:42
问题 I want to run some excel vba code from my Windows Service. The Service is using a fileSystemWatcher to monitor a directory for an xml file to be added. Once a file is added the content of the xml file is deserialized into object properties. At this stage I want to open an excel file and pass these values in to certain cells and run vba code from that work book. I have this working perfectly from a windows forms application but I cant get it working from my Windows Service application. I

How can a WPF application be launched before I logon to Windows?

强颜欢笑 提交于 2019-11-28 12:33:26
问题 I would like to run WPF application before logging in to Windows. It shouldn't do any of existing UI just call ApplicationStartup event - it would trigger the functions I need. Currently I'm using a windows service in conjunction with app, so service runs before logging in. The downside now is that my app doesn't know what the service is doing without polling it. And this is a requirement as machines can crash and restart itself, but Windows should still be running application anyway after

Cannot access files on drive mapped network share from a Windows service

旧城冷巷雨未停 提交于 2019-11-28 12:13:44
I have a network shared folder mapped to a drive letter, which is accessible from Windows Explorer, from the command prompt as well as from my WinForms application without problem. It is also accessible from my Windows service using a UNC path. However, when I attempt to access this network location using a mapped drive letter from the Windows service, access fails. The Windows service is configured to use my personal "Log On" account credentials, which is the same in all the above cases. I am an administrator. Many customer sites utilize drive letters for network shares and I cannot always

How to make Windows Service start as “Automatic (Delayed Start)”

时间秒杀一切 提交于 2019-11-28 11:54:14
Scenario: A WCF service running as a Windows Service. Account is "User". What is done: I have overridden the OnBeforeInstall in the projectinstaller to be able to set username and password from a config file. What I would be able to do: I'd like to be able to set the starttype as Automatic (Delayed Start) What I have tried: I put the following coderow in the overridden OnBeforeInstall serviceInstaller1.StartType = ServiceStartMode.Automatic + 1; Figured I would trick the ServiceStartMode enum into representing Automatic (Delayed Start), didn't work. Haven't tried anything more simply because I