Windows service is not getting uninstalled from Control Panel - windows-services

I have created a Windows service to do some batch processing. The service has been running well till last week. Last week i have re installed my OS. and installed the windows service again using the MSI package. But after installation the Service is not getting Displayed in the Service.msc however the Control panel shows the entry for the service. Now the problem is im not able to uninstall the service from control panel. When i tried to uninstall it is throwing Error1: The specified service does not exists as an installed service. Sc delete option also not able to delete the service from control panel.
Thanks in advance!!

To paraphrase:
As I understand it you're wanting to delete a service which hasn't installed cleanly?
You can either:
Use sc delete <myservice> (which I'm presuming from your question is unavailable?)
Delete the associated windows registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services (search for your subkey)
Hope that helps!

Related

Virtuoso Windows service not getting created

As per the instructions in virtuoso-t --help:
To create a windows service 'MyService' using the configuration file c:\database\virtuoso.ini:
virtuoso-t +service create +instance MyService +configfile c:\database\virtuoso.ini
I ran
virtuoso-t +service create +instance my-virtuoso +configfile D:\SOFT\Virtuoso\database\my-virtuoso.ini
got
[Using my-virtuoso.ini in D:\SOFT\Virtuoso\database]
The Virtuoso_my-virtuoso service has been registered
and is associated with the executable d:\soft\virtuoso\bin\virtuoso-t.exe
Service not showing in Windows services and not accessible on the port.
Is there a way to register a Virtuoso service on Windows 7?
BTW, OpenLink people (as I am pretty sure you are reading this), your instructions say To create a windows service 'MyService' but the result of the command run reports equivalent to Virtuoso_MyService. Might want to correct that in your next release, in addition to the actual service creation or maybe the instructions.
Thanks for the flag on the incorrect -? output. There are a few things that have changed and not been reflected properly there. That will be fixed.
One of these is that you should find the Service is listed in the control panel as OpenLink Virtuoso Server [MyService], which Windows knows as Virtuoso_MyService, and Virtuoso knows as MyService -- so the -? output should show --
To start this service in the command-line, use
sc start Virtuoso_MyService
or
virtuoso-t +service start +instance MyService
To work with this service in the Services or Component Services control panel, look for OpenLink Virtuoso Server [MyService].
Creating the Service does not start it; that's why it's not listening.
I have tested and confirmed all of the above on Windows 7, with both Open Source and Commercial Edition builds of version 7.2.4.2 (07.20.3217).

Upgrade (unisntall/install) Windows Service using InstallShield Setup Project

My question, is there a way to configure the InstallShield setup and deployment project so that when I attempt to install the service it will uninstall the previously installed version of the service.
I've created a Windows Service and an InstallShield setup and deployment project to be able to install it onto my machine. The process of installing and uninstalling the service all works fine. When I go to update the service, at the moment, I need to stop the service, uninstall the service manually, and then run the installer. What I am trying to get to is a point where I can run the installer and it will uninstall the previous version of the service before installing the current version.
I have seen this process of running the install and having the previous versions uninstalled work. Through creating a test project using a windows form application. I was able to install the application. Then I: incremented the product version, created a new product code, added a new upgrade entry in the upgrade path area, and configured that upgrade entry setting the min and max version. After doing this, I rebuilt the setup project and ran the installer and the upgrade from version A to version B was complete.
The only difference I believe from the original test project (where I saw the process work) and my Windows Service project is that my test project was a Windows Forms application versus a Windows Service. In all the research I have been doing I have seen people ask similar questions, but I have not seen any real suggestions on what actions to take. So if anyone knows if this is possible or has any suggestions that I could try to accomplish this task they would be greatly appreciated.
I was able to resolve this issue, so it is possible. The setting I mentioned above are the correct settings needed to allow the service to update. This was just a case of human error that was causing my problems.

MSI Installer fails during uninstall when serivce was already removed

I've an Installer with some custom actions & the designer fancy to install a windows service.
From times to times, when I made a mistake in my custom actions (or in the MSI configuration) the upgrade process may fail. Solution is to uninstall the Application and do a fresh installation.
But sometimes I'm ending in the situation, where I can't uninstall the Application because the "custom actions" for the service claims, that the service is not registered in the system. OK, maybe, no problem. I'm uninstalling the App. The problem: my app don't get uninstalled. It remains. I have to manually add the service to the registry again and restart the uninstall process.
Question: What do I have to configure/develop/program/etc. to tell the service (un)installer not to fail during uninstall when the service is already removed.
BTW: My custom actions do NOTHING during uninstallation. Only during installation/upgrade, I'm asking the user for some configuration and do some custom config stuff - only related to my app. Not related to the service.
EDIT: forgot to mention: VS 2008, default installer project, no fancy stuff, target machine is Windows XP
Yeah, that's one of the many reasons I say not to use VDPROJ and InstallUtil custom actions. You need to put a try catch block in your uninstall custom action and handle that scenario.
Hopefully you are testing on a VM and can just revert but in case this is your dev box use the Windows SC command to recreate the service so you can get the uninstall to work for now.
If you really want to do this right, you want to do something like this:
Augmenting InstallShield using Windows Installer XML - Windows Services
The same concept applies you'll just be adding the WiX merge module to your VDPROJ installer.

Windows Service doesn't start automatically

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't use windows server 2008 just for this.
I'm out of ideas at the moment. Any suggestion would be appreciated.
A few suggestions to try out:
Check the system even logs
Add logging to your service, e.g. to system event log or use log4net
Strip the service down to a single message in the start-up or create a new stripped-down minimal service with as little dependencies as possible. See whether this starts
Check under which account your service is running and whether this account has the permission to "Run As A Service"

Uninstall before installing a windows service

I am reading about how you can create an .exe that will install a windows service to the server.
Say I already have the windows service installed and I want to perform an update. Is there a way for the installer to uninstall (stop the service, delete it, uninstall it) the currently running service and then install the updated version?
Don't be that drastic -- if possible, just stop the service, replace the files you need to, and then (optionally) restart the service.
If you delete the service from the SCM, you lose any post-install configuration done by the user -- custom logon credentials, the settings that dictate what to do when the service crashes, etc.
You shouldn't need to create an exe to do this, the "sc" command can uninstall, update, and install services on Windows for you. See:
Using SC.EXE to Develop Windows NT Services
How to create a Windows service by using Sc.exe
If you still really want to do this by creating your own executable you certainly can, if you can let us know what language you're working in code samples can be provided.

Resources