Installation of a Windows Service

  • Thread starter Thread starter Jan Eliasen
  • Start date Start date
J

Jan Eliasen

Hi

I am writing a Windows Service in VB.NET

I read a walkthrough on the net about how to do it, and it states that
I should use the "installutil" that comes with the .NET framework to
get the Windows Service running as a service.

What if I'd like to install the Windows Service on a machine that does
not have .NEt framework installed? Does anyone have an idea?

Thanks in advance
 
Hallo Jan,

Whatever program you want to use a dotnet program that uses managed code you
need the framework. The programs that make managed code are C#, J# and
Vb.net and C++ but with that you can also make unmanaged code.

It is very simple your program is compiled to intermidiate code (when you
see the framework as an old Cobol or VB runtimer you got the same idea).

But I would do the framework no good when I was really comparing it with
that.
Because it has so many more possibilitys.

I hope this explains it a little bit?

Cor
 
Hi Jan

I never like to try to sway other peoples opinions or choices on how to do
thier work, but I had some trouble with the InstallUtil so I opted out and
went for a regular Setup project to install the Service for me. I'm sure the
InstallUtil is very good at doing this, but I had an example project that
used the Setup project and it worked fine for me, so I used it.

You can then move the Setup.exe to the other machine and run it as a regular
setup (assuming the .NET Framework is already installed as Cor suggested, as
the Setup will pick up on it as a dependency)

I got the example as part of a package you can download from an MS site.
It's called something like '101 Code samples'

Just to let you know that there is an alternative :o)

Regards,
Steve.
 
Jan,

I have done several windows services in vb.net and using
the installutil.exe is great to assist with debugging.

To Install:
-------------
c:\windows\microsoft.net\framework\v1.1.4322
\installutil.exe c:\mywindowsService.exe

To Uninstall:
-------------
c:\windows\microsoft.net\framework\v1.1.4322
\installutil.exe /u c:\mywindowsService.exe

Sidenote:
-------------
To debug is complicated but once you get the hang of its
easy.

'somewhere in your class:
System.Diagnostics.Debugger.Break()

1) install your service

2) then w/the IDE up and running start the service from
the Services Panel.

3) then your service will stop at that line of code so you
can step through.

link:
 
Jan,

First you could create a setup project for your windows service. Then you
could include your msi file with the Setup.exe BootStrapper sample. The
BootStrapper sample is an application that installs the .NET Framework
redistributable package and then launches a Windows Installer package. See
the three articles below for more details.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/vsredistdeploy.asp

http://msdn.microsoft.com/library/d...kthroughcreatingwindowsserviceapplication.asp

http://msdn.microsoft.com/library/d...kaddinginstallerstoyourserviceapplication.asp

Hope this helps.
 
Back
Top