I have no experience writing batch scripts, but I was wondering if there was a way to install a .NET Windows service using installutil.exe
using such a script, or uninstall the service if it is already installed, ideally with some kind of confirmation that I actually would like to perform the uninstall (e.g. press y to uninstall).
Here are some details:
C:\Program Files\Data Service
directoryprogram.log
, also in this directory) after the service has been installedC:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
If you feel this could be done in a better way it would be nice to hear other suggestions. I could always write a service installer but that is not a priority.
You could setup your service exe to support self registration / unregistration using command line arguments (-i -u etc) instead of writing a batch file to do the same thing.
Information on creating Self Installing Services In .NET
http://anotherlab.rajapet.net/2006/06/self-installing-services-in-net.html
http://www.gotnet.biz/WindowsServiceSelfInstaller.ashx
Also adding a Setup Project to your solution and having Visual Studio build an install package might be faster.
How to create a Setup project for a Windows Service in Visual Basic .NET or in Visual Basic 2005