• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1055
  • 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 FiedererTest Developer/ValidatorAuthor 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
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
surajgupthaCommented:
yep... please keep us posted...
0
 
Jens FiedererTest Developer/ValidatorAuthor 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 FiedererTest Developer/ValidatorAuthor 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 FiedererTest Developer/ValidatorAuthor 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 FiedererTest Developer/ValidatorAuthor 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 FiedererTest Developer/ValidatorAuthor 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 FiedererTest Developer/ValidatorAuthor 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

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