windows service - installutil.exe

  • Thread starter Thread starter scarred wind
  • Start date Start date
S

scarred wind

when i run my program, an error message prompt me that i should add the
installutil.exe. How do i checked for the installutil.exe? How can i add
it to my Timer program?
 
What you should actually add is an installer class for registering the
service within the system. I believe MSDN has pretty detailed documentation
on how to deploy Windows services with custom actions (namely, installer
classes launched by the Windows Installer) so you should start from getting
acquainted with this info. I might sound not very friendly, but this is not
because I don't want to help you, it's just MSDN writers explained the
things much better than I'd do.
 
You can manually install the service - it's pretty easy.

If you have the VS.NET command prompt, just type installutill <service>,
where <service> is the complete path to the executable file in your bin
directory. This will install the service for you, where you can control it
from the services manager under Administrative tools in your control panel.
To uninstall the service, just type installutil -u <service>.

If you do not have a VS.NET command prompt, it's no big deal, you just have
to specify the full path for the installutil program, which is I think by
default under <your windows dir>\Microsoft.Net\framework\<framework version
dir\installutil.exe.

I hope this helps!
 
Thank you very much to those who have helped me.

My Error Prompt:

Window Service Start Failure:
Cannot start service from the command line or debugger. A Windows
Service must first be installed (using installutil.exe) and then started
with the ServerExplorer, Windows Service Administrative tool or the NET
START command.

I still can't figure it out, I hope you can be patient with me, I'm
quite new to C#. I thank you very much for helping me get around this
thing.
 
Services are a little bit different from regular executables. In order to
run a service, it first need to be registered within the system, as it will
be started not by launching the .exe file, but by means of Service Control
Manager - a part of Windows managing all services. There's a kind of
protocol (namely, a sequence of SCM calls to your service) being executed
when a service starts.

To register the service with SCM, you need to add an installer class for the
service. To the best of my knowledge, there is a prepackaged installer class
in the framework designed just to register services within the system (and
this is documented in MSDN). This installer class will be invoked by the
installutil.exe utility to perform the registration. Now, that the service
is known to the Service Control Manager, it can be started by the ways
described in the error message you are getting.
 
thank you again to all of you...

would it be possible for any of you to give me sample code, so that i
can refer to it?

thanks again.
 
thank you all, very very much! i think i've solved the that error now.
But my installation is unsuccessful, and a Rollback is performed. What
could have caused it to install unsuccessfully?

Thank you,
 
Back
Top