473,748 Members | 2,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ServiceControll er class
for this.

Any suggestions?

Thanks!
Apr 27 '06 #1
3 4877
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****@marce l-art.com> wrote in message
news:TO******** ************@gi ganews.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 ServiceControll er 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.mach in AT dot.state.fl.us >
schreef in bericht news:%2******** ********@TK2MSF TNGP04.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****@marce l-art.com> wrote in message
news:TO******** ************@gi ganews.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 ServiceControll er
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****@marce l-art.com> wrote in message
news:e5******** ************@gi ganews.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.mach in AT dot.state.fl.us >
schreef in bericht news:%2******** ********@TK2MSF TNGP04.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****@marce l-art.com> wrote in message
news:TO******** ************@gi ganews.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 ServiceControll er
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
3685
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 to it, using installutil.exe OR is it must to have an installer to the service project to be able to
1
3287
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 Files\Test" it installs ok but will not start (no useful error message is given other than the usual annoying suggestion about having sufficient privileges). The problem only seems to happen with spaces, not long filenames. I have found a...
1
477
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. Thanks for any help
2
7985
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: System.IO.FileNotFoundException: File or assembly name windowsservice1, or one of its dependencies, was not found.. " I am new to C# environment. Any idea any clue will be appreciated. Thanks using System;
1
7900
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. I have to do it this way as the consumer of the service should not be able to change the argument - except by uninstalling and reinstalling the service. I created the service and the service itself works great. However, when I try to install...
3
8207
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 control panel (if I don't close, the service will often not properly uninstall), use software uninstallation to remove the service and install the new version via setup.exe.
1
4140
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 "<service name>" does not work. What are my other alternatives for uninstalling this service ?
5
4723
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 more, but I couldn't get it working, so I boiled it down to the exception to test. Anyway, the service can be installed using InstalUtil but when starting the service, I just get the message that the service stopped again withour reporting any...
5
3306
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? Why do I need to set a property within my code to the service name? Are all these required or am I just doing this for consistency purposes?
0
8994
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9329
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9250
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8247
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4878
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.