Re: Installing Multiple Copies of a Service

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



The best way to install a windows service initially is to use a VS.Net setup project to create an MSI file. Once you add an installer to the Windows Service project (by right-clicking the service file and selecting "Add Installer"), the setup project will properly configure the service in your environment.

Afterwards, you can just replace the executable and config files in place as long as you stop the Windows Service beforehand.

The key to a simple windows service is simplicity. I create a service file that contains only a timer which is configured started in the OnStart method and stopped in the OnStop method. I use the event handler for the timer to call a method that encapsulates the business logic and subsequent calls. This allows you to use a WinForms app as a test harness.


Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com




"jctebo" <jctebo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:61520E2D-68A6-4901-A58E-2537B746CD6A@xxxxxxxxxxxxx:

Hi. I am having difficulties getting a service to work. I tested the service
using a windows application that has one button (simulating the start service
command). Everything works fine. The application works as intended. I then
copy and paste the code into a windows service application, and when I
install the service, it stops immediately after it has been started. I think
it could have to do with installing a service multiple times, because I am
installing the service that I installed before.

My code contains code from multiple namespaces, including a dll I imported
that we use here at Chevron for encryption.

What is the best practice for updating a windows service? (Should I just
replace exe where the service runs, run installutil.exe to uninstall and
re-install application?)
What is a good source for windows services written in vb.net?

Thanks for your help.

--
John C. Thibeaux II
Application Developer
Chevron Information Technology Company

.



Relevant Pages

  • Re: Question about Windows Service and Setup projects
    ... 'configuring' a windows service, in the sense of passing it string values ... options within this same setup project, in order to update operating settings ... ServiceProcessInstaller) and will call the install methods of those classes ... Setup project for a Windows Service in Visual Basic .NET or in Visual ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Permissions to use installutil.exe
    ... ..Net Windows Service encapsulates the Win32 Windows Service API to implement ... The tool then executes either the Install ... We are concerning the first SCM security. ...
    (microsoft.public.dotnet.framework)
  • RE: Installing WindowsService to system without Visual Studio Tool
    ... So, for my production machine, which is a Windows 2003 Server, it worked well. ... you've built a .NET windows service project and can ... What you need is an additional Setup project for your service projecct's ... project and use installer class for install. ...
    (microsoft.public.vsnet.setup)
  • Re: Adding another EXE to a windows service
    ... As Phil suggests simply add the second EXE to your setup project. ... with a Windows App, a Windows Service, a Class Library, and a Setup Project. ... > I have another small vb.net exe that I would like to install when I ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Adding another EXE to a windows service
    ... As Phil suggests simply add the second EXE to your setup project. ... with a Windows App, a Windows Service, a Class Library, and a Setup Project. ... > I have another small vb.net exe that I would like to install when I ...
    (microsoft.public.dotnet.general)