|
I'm trying to learn how to work with Windows Services, so I've written a trivial one--actually, I've ripped off the code from some example on the Web. I think it was msdn.
I developed it in C# using VS2008. Everything compiles, and I have the ServiceInstaller and ServiceProcessInstaller classes set up. But when I run InstallUtil to install it, I get the error in bold below.
nstalling service mcWinService... Service mcWinService has been successfully installed. Creating EventLog source mcWinService in log Application... Installing service mcWinService... Creating EventLog source mcWinService in log Application...
An exception occurred during the Install phase. System.ComponentModel.Win32Exception: The specified service already exists
It looks very much like installUtil is trying to do this twice. Contrariwise, when using the /u parameter, the service is not recognized as being there:
Service mcWinService is being removed from the system... An exception occurred during the uninstallation of the System.ServiceProcess.Ser viceInstaller installer. System.ComponentModel.Win32Exception: The specified service does not exist as an installed service An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalle d after the uninstall is complete. Removing EventLog source mcWinService.
At no time ever does my service appear to exist, via either the Services window under Admin Tools, or the DOS command line [/b]sc query tool, or the Uninstall/Install Programs tool in Control panel. This is on a Vista Business OS.
Can anyone help? Why does InstallUtil try to install twice?
|