windows-services

Delphi - Gracefully Closing Created Process in Service. (using tprocess / createProcess)

你离开我真会死。 提交于 2019-12-13 12:42:52
问题 I have a Windows Service written in Delphi which runs a number of programs. On Stopping the service, I want to also close these programs. When the service was originally written, this worked fine, but I think I've updated the tProcess component and now - The subordinate programs are not being closed. in tProcess - Here's the code which starts the new processes. if CreateProcess( nil , PChar( FProcess.Command ) , nil , nil , False , NORMAL_PRIORITY_CLASS , nil , Directory , StartupInfo ,

Global handling exception in window service

本秂侑毒 提交于 2019-12-13 12:28:13
问题 I have a windows service run as a server. However, the server sometime stops immediately by an error which is un-handled. Please help me how to handle global exception. Thanks. 回答1: It sounds to me like you're trying to solve the problem the wrong way around... When your program (or service) crashes because of an unhandled error, the solution is not to figure out where and how to "handle" all unhandled errors so that you can ignore them and continue execution. I've hashed out that view more

WMI lib to start windows service remotely

六月ゝ 毕业季﹏ 提交于 2019-12-13 11:08:55
问题 How do I start a service using the WMI library? The code below throws the exception: AttributeError: 'list' object has no attribute 'StopService' import wmi c = wmi.WMI ('servername',user='username',password='password') c.Win32_Service.StartService('WIn32_service') 回答1: There is documentation regarding the library on github: https://github.com/tjguk/wmi/blob/master/docs/cookbook.rst I believe the above code is throwing an error because you are not specifying which service to start. Assuming

How to add dependencies to a windows service

冷暖自知 提交于 2019-12-13 09:03:26
问题 How to add dependencies to a windows service in InstallShield? My winservice depend on the two following services, so they must run before the service starts: COMSysApp SENS Note: I have used InstallShield project to install my service and not windows installer class so i could not use the way that mr. Jerry.Wang suggested in his article. EDIT: How to add a dependency to SEN Service in installshield? 回答1: If you have dependencies on other services, the ServiceInstall table has the

Launching an exe from Procrun

限于喜欢 提交于 2019-12-13 07:48:37
问题 How can I launch an exe file from Procrun? Apart from that I also tried to launch a frame from the service code itself by specifying the following line in my install script. But that too doesn't work as no GUI is launched though the service is started successfully. set PR_TYPE=interactive If I am to launch an exe using procrun, how am I to do that and if I am to launch a JFrame, how am I to do that? I can't find any similar questions in procrun as all the other interactive java service

Installing service without admin rights

a 夏天 提交于 2019-12-13 07:38:16
问题 Yesterday I was playing with the WindowsService project option on Visual Studio and when trying to install my service I was facing errors, after a few tries it finally occurred to me that I would probably need admin rights to install a service. And it did install when I switched to "Run as Administrator". But what it got me thinking, is that, how are other programs, like PunkBuster, AMD Drivers, Adobe Acrobat Update Service, Filezilla Server FTP... and so on, capable of installing a service

Logic for Windows Services & Getting Updates

主宰稳场 提交于 2019-12-13 07:34:10
问题 I developed a Windows service using vb.net which does the following using OnStart Even... Grabs all Entries from a SQL Table Creates Schedules from returned rows it works fine, schedules fire on their time and stuff. Problem: Whenever I have to ADD a new row to my Table, I have to restart the Service, So it can Grab the Newly created rows. This is causing problems for me...there could be a task which is running already and restarting service might break the system. So what is the best way to

How do I alter a .NET application/user settings on installation?

房东的猫 提交于 2019-12-13 07:30:32
问题 In a Windows Service project, with a Project Installer I tried the following: [RunInstaller(true)] public partial class ProjectInstaller : Installer { public ProjectInstaller() { InitializeComponent(); } protected override void OnBeforeInstall(System.Collections.IDictionary savedState) { base.OnBeforeInstall(savedState); Settings.Default.ASetting = "aValue"; Settings.Default.Save(); } protected override void OnAfterInstall(System.Collections.IDictionary savedState) { base.OnAfterInstall

ServiceName is not changing properly

£可爱£侵袭症+ 提交于 2019-12-13 07:22:28
问题 I have a need to be able to install the same service multiple times on a single machine. That part I have working! But I also need the ServiceName's to be different. That part is not. Below is the code within my Installer.cs: [RunInstaller(true)] public partial class ProjectInstaller : System.Configuration.Install.Installer { public ProjectInstaller() { InitializeComponent(); } public override void Install(IDictionary stateSaver) { RetrieveServiceName(); base.Install(stateSaver); } public

Print Job Accepting and routing Software

北城余情 提交于 2019-12-13 07:09:35
问题 I want to create a software which can accept Print Jobs from other computers, and then route those print jobs to PCs on LAN with printers attached. How it's going to happen -> 1- When that software called "Virtual Printer" is installed on a computer "X", Windows should think that it is a print driver/attached printer to that computer. 2- Then administrator of that PC goes to "Devices and Printers" in windows and select the "Virtual Printer", right click and view properties and select the