• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1051
  • Last Modified:

Setup Project not Stopping/Deleting a Service during Uninstall

I have implemented a service that handles WCF requests.

I have created a setup project for that  (VS 2005 setup project)

It installs (apparently) fine, and I have a custom action implemented that will start the service after the install completes (this part works).

However, during uninstall, even on a machine that has had this installed only once, the service is not stopped, and not deleted (to check, I also did this with a sample "Hello world" type service, and THAT one was stopped fine during uninstall.  The uninstall completes reporting success.

Here is what I believe to be the lines in the log where the stop/delete is attempted:
MSI (s) (60:9C) [09:49:29:798]: Doing action: StopServices
Action 9:49:29: StopServices. Stopping services
Action start 9:49:29: StopServices.
MSI (s) (60:9C) [09:49:29:798]: Note: 1: 2262 2: ServiceControl 3: -2147287038
Action ended 9:49:29: StopServices. Return value 1.
MSI (s) (60:9C) [09:49:29:798]: Doing action: DeleteServices
Action 9:49:29: DeleteServices. Deleting services
Action start 9:49:29: DeleteServices.
MSI (s) (60:9C) [09:49:29:798]: Note: 1: 2262 2: ServiceControl 3: -2147287038
Action ended 9:49:29: DeleteServices. Return value 1.
0
Jens Fiederer
Asked:
Jens Fiederer
  • 8
  • 7
1 Solution
 
surajgupthaCommented:
Can you manually stop the service?
0
 
surajgupthaCommented:
also see if u can manually uninstall it using
installutil -u "path to service exe"
0
 
Jens FiedererAuthor Commented:
Yes, manually stopping the service with
     net stop servicename
works fine.
Manually deleting it with
sc delete servicename
ALSO works fine.

I will try installutil to see if I get any interesting messages.
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
surajgupthaCommented:
yep... please keep us posted...
0
 
Jens FiedererAuthor Commented:
Well, I had to try installutil BEFORE the uninstall.  I did get some messages (from a failed attempt to stop the service within my CustomActions that I had not remembered to remove: "System.ComponentModel.Win32Exception: The specified service does not exist as an installed service"), but removing that extraneous code removed the error messages without solving the problem.

Now, using installutil -u stops and deletes the service (without removing the code)

Using setup removes the code without stopping or deleting the service.
0
 
surajgupthaCommented:
without removing the code ??
0
 
Jens FiedererAuthor Commented:
Right - I believe that is standard behavior, it only triggers the installer classes in the target.  After doing an
     installutil -u <path>
I can run setup (with removal) and get rid of the actual code.
0
 
surajgupthaCommented:
Installutil -u would remove all the DLL's that are installed as a part of the service. It wouldnt remove the SOURCE CODE
0
 
Jens FiedererAuthor Commented:
I am not talking about source, I mean the exe/dll.

Even doing this on the Example program (which works fine with setup), doing an installutil -u does not remove the .exe.

0
 
surajgupthaCommented:
yep the uninstall would merely remove the services from the windows services list. The files would continue to stay there. so you will have to installutil -u and then remove the files...
0
 
Jens FiedererAuthor Commented:
Right, that is what I was saying.

So back to the question:  why I my setup project not achieving this?
0
 
surajgupthaCommented:
Do you have any specific custom action that you are using to uninstall it?
0
 
Jens FiedererAuthor Commented:
Custom actions for all four items are set to primary output from the Service (except commit, which also calls an executable to do the
net start servicename
).


Nothing special was written for the uninstall, I am counting on what MS included with the generated service installer (which works with the sample service).
0
 
surajgupthaCommented:
It has worked for me too. There should be some thing different you should be doing..... Lemme think
0
 
Jens FiedererAuthor Commented:
I don't think it really matters anymore - apparently SOMETHING is a bit messed up with the setup project, but I'll never know what.


I made a "copy: of the original setup project for QA purposes (created a new one from scratch with the same structure, it only takes about 5 or 6 operations).  THAT one worked perfectly!

I then made another one as an alternate, and that one worked perfectly as well, so I am going to use THAT and abandon the original (which still does not work for some mysterious reason).

Your suggestion to use installutil really DID help my diagnostic progress, thank you!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now