Installing a .NET Windows Service using InstallUtil

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

Hello,
I created a Windows Service (c#) and finally deciphered how to add an
Installer to the project. I got all this to work. On my machine I can
install/remove the service by using...
InstallUtil JTEService.exe
and InstallUtil /u JTEService.exe

I tried to install it on another machine with .NET Framework on this other
machine and it won't install. In the install log file it says...

No public installers with the RunInstallerAttribute.Yes attribute could be
found

Does anyone know what I must do at this point to install the service on this
other machine? I thought if the framework was on it all I'd have to do is
use InstallUtil...

Thanks

Cheers :)
 
I had that problem also, in my case the problem was that the path
environment variable was still pointing to an older version of the
framework, v1.0.3705, I had to manually set it to
\WINNT\Microsoft.NET\Framework\v1.1.4322\, and then I had no problem
installing the service. Now I have another problem, the service will no
longer start, it was working just fine before, but I'll just start another
thread about that ;).
 
Randy,

A better solution than using the installutil tool on a client installation
might be to implement a ServiceInstaller into your service and add a custom
action to your deployment project under the Install node. Create an action
that points to your service project and set the Arguments property to
/install

Same deal for /uninstall.

Brandon
 
Thanks for the info...I'll give that a shot. :)


JH said:
I had that problem also, in my case the problem was that the path
environment variable was still pointing to an older version of the
framework, v1.0.3705, I had to manually set it to
\WINNT\Microsoft.NET\Framework\v1.1.4322\, and then I had no problem
installing the service. Now I have another problem, the service will no
longer start, it was working just fine before, but I'll just start another
thread about that ;).
 
Thanks for the info Brandon. This sounds interesting, do you know of a web
site or where I might find more info on this? :)
 
Randy,

Actually, no. I stumbled upon this method on one of the comments on the
bottom of an article that was using the Installutil method.

Let me know if you want me to provide more info; I've been using it this way
ever since!

Brandon
 
I found a great article at http://www.codeproject.com/KB/system/WindowsService.aspx which helped me resolve this issue.

I am using VS 2008

In the project, add a reference to System.Configuration.Install.

Add the WindowsServiceInstaller.cs class from the article.

Modifiy the WindowsServiceInstaller class properties such as Account, Username, Password, DisplayName, StartType, ServiceName if necessary.
 
Back
Top