Solved

Setup Project not Stopping/Deleting a Service during Uninstall

Posted on 2007-12-03
15
1,033 Views
Last Modified: 2013-11-26
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
Comment
Question by:Jens Fiederer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
15 Comments
 
LVL 21

Expert Comment

by:surajguptha
ID: 20396869
Can you manually stop the service?
0
 
LVL 21

Accepted Solution

by:
surajguptha earned 500 total points
ID: 20396873
also see if u can manually uninstall it using
installutil -u "path to service exe"
0
 
LVL 23

Author Comment

by:Jens Fiederer
ID: 20397154
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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 21

Expert Comment

by:surajguptha
ID: 20397555
yep... please keep us posted...
0
 
LVL 23

Author Comment

by:Jens Fiederer
ID: 20397617
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
 
LVL 21

Expert Comment

by:surajguptha
ID: 20397860
without removing the code ??
0
 
LVL 23

Author Comment

by:Jens Fiederer
ID: 20397927
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
 
LVL 21

Expert Comment

by:surajguptha
ID: 20398077
Installutil -u would remove all the DLL's that are installed as a part of the service. It wouldnt remove the SOURCE CODE
0
 
LVL 23

Author Comment

by:Jens Fiederer
ID: 20398429
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
 
LVL 21

Expert Comment

by:surajguptha
ID: 20398479
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
 
LVL 23

Author Comment

by:Jens Fiederer
ID: 20398508
Right, that is what I was saying.

So back to the question:  why I my setup project not achieving this?
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20398765
Do you have any specific custom action that you are using to uninstall it?
0
 
LVL 23

Author Comment

by:Jens Fiederer
ID: 20399029
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
 
LVL 21

Expert Comment

by:surajguptha
ID: 20399202
It has worked for me too. There should be some thing different you should be doing..... Lemme think
0
 
LVL 23

Author Comment

by:Jens Fiederer
ID: 20405319
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question