I'm try to install service from C# and using ServiceTools.dll
(Source - Dll - Refer) and also using from InstallUtil.exe
but service is not installed or don't start after install !
when i use from InstallUtil.exe
: (32bit and 64bit / with .net 1-...-4)
use from this commend :
InstallUtil "Service File Path"
"C:\Windows\Microsoft.NET\Framework64\v4.0.303\InstallUtil.exe" "C:\Program Files (x86)\Kerio\VPN Client\kvpncsvc.exe"
But i get following error :
Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 'file:///C:\Prog ram Files (x86)\Kerio\VPN Client\kvpncsvc.exe' or one of its dependencies. The m odule was expected to contain an assembly manifest..
and also if install service with ServiceTools.dll
use from this commend :
ServiceInstaller.InstallAndStart("Service Name", "Service Display Name", "Service File Path");
ServiceInstaller.InstallAndStart("KrSVC", "Krio service", "C:\Program Files (x86)\Kerio\VPN Client\kvpncsvc.exe");
It's work and service installed but Service don't start and i get following error :
Windows could not start the KrSVC service on a local computer
Error 1053: The service did not respond to the start or control request in a timely fashion
Note :
- when i install kerio vpn client sevice correctly installed and worked and also can start /stop/etc...
- For install service first of all i remove kerio vpn client or unistall kvpncsvc service
- kvpncsvc have a service however can start with user interface and if double click on it it's open like desktop app.
- and also i was checked InstallUtil 32 bit and 64 bit from .net 2 or etc..
- kerio vpn client is her : 32bit - 64bit - site
Now i want to know how can i install or start this service ?