ServiceInstaller.Uninstall Method (IDictionary)
Uninstalls the service by removing information about it from the registry.
Assembly: System.ServiceProcess (in System.ServiceProcess.dll)
The Service Control Manager could not be opened.
The system could not get a handle to the service.
Uninstall first attempts to stop the service before uninstalling it. If the service cannot be stopped, no exception is caught, and the method continues with the removal of the service.
Normally, you will not call the methods on ServiceInstaller within your code; they are generally called only by the install utility. InstallUtil is used to uninstall services as well as install them; uninstalling takes a switch in the command line call.
An application's uninstall routine maintains information automatically about the components being uninstalled, using the project installer's Installer.Context. This state information, passed into as the savedState parameter, is continuously updated as the ServiceProcessInstaller instance and each ServiceInstaller instance is installed by the utility. It is usually unnecessary for your code to modify this state information explicitly.
For all classes deriving from the Installer class, the state of the Installers collection must be the same in the Install and methods. However, you can avoid the maintenance of the collection across the Install and methods if you add installer instances to the Installers collection in your custom installer class constructor.
There is no rollback mechanism for uninstalling, so if one service fails to uninstall, this does not affect the other services (usually within the same installation project) being uninstalled.
Available since 1.1