473,387 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Uninstall a service from code without using InstallUtil.exe

Hi,

I was wondering if it's possible to install/uninstall a service from code
without using the InstalUtil.exe tool with the /i and /u flags. As far as I
can Google everyone is doing it that way and MicroSoft also mentions this.
There's something like the ServiceBase class from which you ought to derive
your own class. This has a Uninstall() and a Install() method, but I'm not
getting access to these methods. MicroSoft says that this class is not
intended to be used directly, it's there for the InstalUtil.exe utility.

Stopping and starting a service is easy. I use the ServiceController class
for this.

Any suggestions?

Thanks!
Apr 27 '06 #1
3 4862
Hi,

Why don't you want to use it?

If you dont want it to be seen , just run it as a non-windowed program.

"Marcel Brekelmans" <ma****@marcel-art.com> wrote in message
news:TO********************@giganews.com...
Hi,

I was wondering if it's possible to install/uninstall a service from code
without using the InstalUtil.exe tool with the /i and /u flags. As far as
I can Google everyone is doing it that way and MicroSoft also mentions
this. There's something like the ServiceBase class from which you ought to
derive your own class. This has a Uninstall() and a Install() method, but
I'm not getting access to these methods. MicroSoft says that this class is
not intended to be used directly, it's there for the InstalUtil.exe
utility.

Stopping and starting a service is easy. I use the ServiceController class
for this.

Any suggestions?

Thanks!

May 1 '06 #2
Yes, thats' the way I've implemented it right now, with all the flags to
have it run without user-interaction (/qb+). I was just wondering if I could
have the job done without instantiating a Process. More or less triggered by
the fact that MicroSoft discouraged it :)

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
schreef in bericht news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi,

Why don't you want to use it?

If you dont want it to be seen , just run it as a non-windowed program.

"Marcel Brekelmans" <ma****@marcel-art.com> wrote in message
news:TO********************@giganews.com...
Hi,

I was wondering if it's possible to install/uninstall a service from code
without using the InstalUtil.exe tool with the /i and /u flags. As far
as I can Google everyone is doing it that way and MicroSoft also mentions
this. There's something like the ServiceBase class from which you ought
to derive your own class. This has a Uninstall() and a Install() method,
but I'm not getting access to these methods. MicroSoft says that this
class is not intended to be used directly, it's there for the
InstalUtil.exe utility.

Stopping and starting a service is easy. I use the ServiceController
class for this.

Any suggestions?

Thanks!


May 1 '06 #3
There is no problem with spawning a process to do what can not be done
otherwise.
Can you post a reference where Microsoft is discouraging using Process.Start
to start a process?

And finally, is there any particular reason you are refering to Microsoft as
MicroSoft?

"Marcel Brekelmans" <ma****@marcel-art.com> wrote in message
news:e5********************@giganews.com...
Yes, thats' the way I've implemented it right now, with all the flags to
have it run without user-interaction (/qb+). I was just wondering if I
could
have the job done without instantiating a Process. More or less triggered
by
the fact that MicroSoft discouraged it :)

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
schreef in bericht news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi,

Why don't you want to use it?

If you dont want it to be seen , just run it as a non-windowed program.

"Marcel Brekelmans" <ma****@marcel-art.com> wrote in message
news:TO********************@giganews.com...
Hi,

I was wondering if it's possible to install/uninstall a service from
code without using the InstalUtil.exe tool with the /i and /u flags. As
far as I can Google everyone is doing it that way and MicroSoft also
mentions this. There's something like the ServiceBase class from which
you ought to derive your own class. This has a Uninstall() and a
Install() method, but I'm not getting access to these methods. MicroSoft
says that this class is not intended to be used directly, it's there for
the InstalUtil.exe utility.

Stopping and starting a service is easy. I use the ServiceController
class for this.

Any suggestions?

Thanks!



May 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: sidd | last post by:
Hi All, i have some doubts on .net windows services.. please see if some one could help me understand this.. 1)is it possible to install a windows service which does not have a installer added...
1
by: bob | last post by:
I have created a simple Windows service in VB.Net which installs fine using InstallUtil.exe to install it to, for example "c:\test", or "c:\Windows\YellowBanana", but if I install it to "c:\Program...
1
by: Lucky | last post by:
uninstall service using installUtil /u says it was succesfull, but the entry is still shown in the services. Tried also deleting from HKLM\SYSTEM\CurrentControlSet\Services\.., makes no difference....
2
by: Fan Wang | last post by:
Hi All, I wrote a windows service with C# as below. But I can't install it with installutil.exe. I got an error message " Exception occurred while initializing the installation:...
1
by: amirmira | last post by:
I would like to set command line arguments to a service at install time. I need to do this because I need to get information from different registry locations depending on my command line argument....
3
by: DC | last post by:
Hi, I have developed a windows service in C# and I am using a Visual Studio 2003 installer to install it. When I am updating the service, I usually stop the service in control panel, close...
1
by: John A Grandy | last post by:
I have a server with a custom .NET Windows Service installed. The folder containing the service's .exe and .dll files is long gone. I need to uninstall the service. InstallUtil.exe /u...
5
by: eliasen | last post by:
Hi I have created a Windows Service using C# and .NET2.0. The service is quite simple - right now it doesn't do anything except throwing an exception in the OnStart method. It used to something...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.