p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# 2005 (http://p2p.wrox.com/forumdisplay.php?f=138)
-   -   how to Uninstall a service (http://p2p.wrox.com/showthread.php?t=51193)

MadJac December 6th, 2006 02:27 AM

how to Uninstall a service
 
ok, well i figured out how to install a service.

but how do uninstall it. incase a users wants to uninstall and re-install the service

i use a setup project to install it. now i need tobe able to uninstall.

when i run the uninstaller it removes the files and leaves the entry in the "control panel"->"services" controller.


Imar December 6th, 2006 03:02 AM

Hi there,

To "register" the service:
%windir%\Microsoft.NET\Framework\v2.0.50727\Instal lUtil.exe ServiceName.exe

To "unregister" it:

%windir%\Microsoft.NET\Framework\v2.0.50727\Instal lUtil.exe /U ServiceName.exe

Note that unregistering it is different from uninstalling it....

HtH,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

MadJac December 6th, 2006 11:14 AM

isn't there anyway to unregister it in a program using code and not having to use the console todo it?

if your createing a professional program that uses a service you want the program tobe able to do the work not to have the end users have todo it.

i know about "installutil" but frankly it's kind of a dumb way todo things when the program is suppose todo it


Imar December 6th, 2006 11:48 AM

You could wrap the call to InstallUtil.exe in your custom installer.

I think when you have a professional installer package, you can execute custom tasks.

Don't know of any other way; sorry...

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.


All times are GMT -4. The time now is 07:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.