1

I have created a Windows Service (called MuskOx) which runs on my development machine (which obviously has Visual Studio installed).

The Bin folder of the project contains the following files:

  • InstallUtil.InstallLog
  • muskox.InstallLog
  • muskox.InstallState
  • MuskOx.exe.config
  • MuskOx.vshost.exe
  • MuskOx.vshost.exe.config
  • MuskOx.vshost.exe.manifest
  • Kctc.dll (a class library used by MuskOx)
  • Kctc.pdb
  • MuskOx.exe
  • MuskOx.pdb

Can anyone tell me what I need to do to install the service on another machine which doesn't have VS installed? I haven't the faintest idea what half of those files do and I'm finding Googling answers a little unproductive.

Thanks

David

David
  • 14,678
  • 20
  • 80
  • 145
  • 1
    +1 for MuskOx as the name of your service. – Matt Davis Jul 01 '10 at 17:12
  • 1
    refer to the link is you would prefer for your service to install/uninstall itself (instead of requiring the use of InstallUtil.exe). http://stackoverflow.com/questions/1195478/how-to-make-a-net-windows-service-start-right-after-the-installation/1195621#1195621 – Matt Davis Jul 01 '10 at 17:15
  • @ Matt: lol, thanks for the point! – David Jul 05 '10 at 09:13

4 Answers4

1

You don't need to ship any of the .vshost.* files. The pdb files are debug files so only ship those if you want symbols in your debug output. And of course when installing the service on another machine, InstallLog and InstallState files should get generated so you don't need to ship those either.

Krip
  • 854
  • 1
  • 7
  • 15
  • Thanks for the details of the files, but how do I actually physically install the service? – David Jul 01 '10 at 14:53
1

Copy MuskOx.exe and Kctc.dll to the target machine. Run installutil.exe to get it registered, its available in c:\windows\microsoft.net\framework\v2.0.50727

Hans Passant
  • 873,011
  • 131
  • 1,552
  • 2,371
0

For .net applications use the installutil.exe as Hans already pointed out. You can also use sc.exe to install and uninstall services.

tobsen
  • 5,228
  • 3
  • 30
  • 48
0

You can do it with your application:

How to install a windows service programmatically in C#?

Community
  • 1
  • 1
jgauffin
  • 95,399
  • 41
  • 227
  • 352