Install service to server 2012
Asked Answered
R

3

5

I developed new service using .net 4.0 c#, I want now to install to hosting server which does not contain visual studio command promot and installUtil.exe . How can Install the service to the server? It is required to install the VS version ?

Ricardoricca answered 28/1, 2016 at 8:54 Comment(3)
Did you try ServiceName.exe /install?Batty
Error message appeared. must install using installUtilRicardoricca
InstallUtil.exe is part of .NET Framework and can be located in %WINDIR%\Microsoft.NET\Framework[64]\<framework_version>.Batty
R
1

I find the solution :

1- copy 'InstallUtil.exe' file to c: dirve in the server.

2- copy to the service execution file to same place.

3- open command promot in 'administrator mode'(run as admin)

4- write the following command : c:\InstallUtil c:\serviceName.exe

Note : ensure that the service and Installer are both 32-bit or 64-bit

Ricardoricca answered 28/1, 2016 at 11:37 Comment(1)
You don't need to copy 'InstallUtil.exe'. It's already in the following directories: C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exeFestal
F
9
  1. Go to "C:\Windows\System32"

  2. Right click on "cmd.exe" and "Run as administrator"

  3. And run "InstallUtil.exe" like that:

    "C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" "C:\src\Service.exe"

    • The first parameter is the full path of InstallUtil.exe

      For 64 bit executables use following:

      C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe

      For 32 bit executables use following:

      C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe

    • The second parameter is the full path of Service.exe to be installed.

Festal answered 20/7, 2018 at 11:39 Comment(0)
R
1

I find the solution :

1- copy 'InstallUtil.exe' file to c: dirve in the server.

2- copy to the service execution file to same place.

3- open command promot in 'administrator mode'(run as admin)

4- write the following command : c:\InstallUtil c:\serviceName.exe

Note : ensure that the service and Installer are both 32-bit or 64-bit

Ricardoricca answered 28/1, 2016 at 11:37 Comment(1)
You don't need to copy 'InstallUtil.exe'. It's already in the following directories: C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exeFestal
M
0

I suggest you a small refactor to implement the whole service using Topshelf and you'll be able to install your Windows services with no additional tool than the service executable itself.

For example, yourexecutable install, yourexecutable uninstall, yourexecutable stop, yourexecutable start...

Mattison answered 28/1, 2016 at 8:58 Comment(3)
Error message appeared. must install using installUtilRicardoricca
@RaedAlsaleh Have you checked the link? I'm suggesting you another way of implementing Windows services...Cookstove
How can I use install topshlef?Ricardoricca

© 2022 - 2024 — McMap. All rights reserved.