Deploying a Windows service

M

Mark Rae

Hi,

I've written a Windows service and added a Setup project to the solution.

Is the only way to get the installation to run the InstallUtil part to
actually install the executable as a service to add a Custom Action? And, if
so, do I need to include InstallUtil.exe within the Setup.msi?

Any assistance gratefully received.

Mark Rae
 
M

Mark Rae

"Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk> wrote in message

Hi Dan,
check the latter half of this on how to create a simple service setup
project.
http://www.codeproject.com/dotnet/simplewindowsservice.asp

The final thing I need now is to be able to provide a description for my
service which displays in the Services MMC snap-in.

According to this article
http://www.codeproject.com/dotnet/dotnetscmdescription.asp, this property
was omitted from the ServiceProcessInstaller object in the .NET Framework.
The article goes on to say that the only way of adding a description is to
write it directly into the Registry.

This article http://www.codeproject.com/csharp/CSharpWindowsServiceInst.asp
suggests a way of achieving this via the AfterInstall event of the
ProjectInstaller object.

I'd be interested to know if this is the only way to do this, or if there is
a better way.

Any assistance gratefully received.

Mark
 
G

Guest

Dan,

Thanks for the link this helped me alot. I am writing a windows service
that is to be deployed into a production environment on multiple servers. My
tech lead gave me some help setting up the install project and in his defense
he did what he thought was right.

However when we setup the install project the only custom action we setup
was "Install". This caused problems when uninstalling and attempting to
re-install as the user would have to go into the registry and remove the
keys, and then reboot the box because the services manager would not update.
The follow post is intended to help anyone else that has this problem because
it is not readily apparent in the article but that is what finally lead me
down the correct path.

When you define your windows setup project you must define custom Actions
for all for of the groups ( Install, Commit, Rollback, and Uninstall ). The
simpliest way is to assign them all to your windows service project( e.g.
MyNewService ).

Not that I have all four Custom Action groups assigned to my windows service
project, the service can be installed and uninstalled without any registry
hacking and best of all the servers do not have to be rebooted.

Thanks again and I hope this helps someone :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top