Active2 months ago
- Windows Installutil Location
- C Windows Service Installutil Reviews
- Windows Service Start Failure Installutil
Here Mudassar Ahmed Khan has explained how to install Windows Service build in C# or VB.Net on a Remote Server Machine using InstallUtil.exe file. In order to install the Windows Service on a Remote Server Machine, first task is to locate the InstallUtil.exe file. TAGs: Windows Service.
![Service Service](/uploads/1/2/5/0/125060071/777730922.jpg)
I have a standard .NET windows service written in C#.
Can it install itself without using InstallUtil?Should I use the service installer class? How should I use it?
I want to be able to call the following:
And it will have the same effect as calling:
K DawG7,27688 gold badges2424 silver badges6060 bronze badges
Yuval PeledYuval Peled2,89588 gold badges2525 silver badges3535 bronze badges
7 Answers
Yes, that is fully possible (i.e. I do exactly this); you just need to reference the right dll (System.ServiceProcess.dll) and add an installer class..
Ian Kemp18.6k1212 gold badges7777 silver badges104104 bronze badges
Marc Gravell♦Marc Gravell825k213213 gold badges22282228 silver badges26242624 bronze badges
Windows Installutil Location
Take a look at the InstallHelper method of the ManagedInstaller class. You can install a service using:
This is exactly what InstallUtil does. The arguments are the same as for InstallUtil.
The benefits of this method are that it involves no messing in the registry, and it uses the same mechanism as InstallUtil.
adrianbanksadrianbanks69.2k1818 gold badges151151 silver badges189189 bronze badges
You can always fall back to the good old WinAPI calls, although the amount of work involved is non-trivial. There is no requirement that .NET services be installed via a .NET-aware mechanism.
To install:
- Open the service manager via
OpenSCManager
. - Call
CreateService
to register the service. - Optionally call
ChangeServiceConfig2
to set a description. - Close the service and service manager handles with
CloseServiceHandle
.
To uninstall:
- Open the service manager via
OpenSCManager
. - Open the service using
OpenService
. - Delete the service by calling
DeleteService
on the handle returned byOpenService
. - Close the service and service manager handles with
CloseServiceHandle
.
The main reason I prefer this over using the
ServiceInstaller
/ServiceProcessInstaller
is that you can register the service with your own custom command line arguments. For example, you might register it as 'MyApp.exe -service'
, then if the user runs your app without any arguments you could offer them a UI to install/remove the service.Running Reflector on
ServiceInstaller
can fill in the details missing from this brief explanation.P.S. Clearly this won't have 'the same effect as calling: InstallUtil MyService.exe' - in particular, you won't be able to uninstall using InstallUtil. But it seems that perhaps this wasn't an actual stringent requirement for you.
Roman Starkov![Install windows service installutil Install windows service installutil](/uploads/1/2/5/0/125060071/472411529.png)
37k2828 gold badges199199 silver badges283283 bronze badges
Here is a class I use when writing services. I usually have an interactive screen that comes up when the service is not called. From there I use the class as needed. It allows for multiple named instances on the same machine -hence the InstanceID field Samsung phone software for windows.
Sample Call
C Windows Service Installutil Reviews
The class itself
Brad BruceBrad Bruce6,44133 gold badges3333 silver badges5656 bronze badges
The above examples didn't really work for me, and the link to the forum as a #1 solution is awful to dig through. Here is a class I wrote (in part), and the other bit is merged from this link I found buried somewhere
To install a service, run the InstallAndStart command as follows:
Panasonic Multi Function Printer KX-MB Drivers Download – Update Panasonic SoftwareMulti Function Printer Series: Kx-jb271 may also clean the feed roller with a lint free cloth that is dampened with alcohol. Panasonic kx mb781 driver. Using outdated kx-mb271 corrupt Panasonic Multi Function Printer KX-MB drivers can cause system errors, crashes, and cause your computer or hardware to fail. More detail, just go to http: He is a lifelong computer geek and loves everything related to kx-mb271, software, and new technology.
Make sure the account that is running the program has permission to install services. You can always 'Run As Administrator' on the program.
I have also included several commands for non-api access which do not install or remove services, but you can list them and control several (start, stop, restart). You really only need to elevate permissions for installing or removing services.
There are a couple of commands for getting and setting environment variables as well, such as
evandrixOPENSSL_CONF
or TEMP
. For the most part, the parameters and method names should be pretty self-explanatory.Windows Service Start Failure Installutil
5,03133 gold badges2424 silver badges3131 bronze badges
Kraang PrimeKraang Prime5,49666 gold badges3737 silver badges8282 bronze badges
In the case of trying to install a command line application as a Windows service try the 'NSSM' utility. Related ServerFault details found here.
Community♦
John MJohn M6,6272828 gold badges8080 silver badges130130 bronze badges
evandrix5,03133 gold badges2424 silver badges3131 bronze badges
MansoorMansoor