Solved

Setup Project not Stopping/Deleting a Service during Uninstall

Posted on 2007-12-03
15
1,022 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Installations often have prerequisites, such as “Microsoft .Net framework is required for this product”. The usual implementation in MSI installations is system search for a particular registry setting representing the required prerequisite, followe…
I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now