ServiceProcessInstaller.Install Method

Writes service application information to the registry. This method is meant to be used by installation tools, which call the appropriate methods automatically.

Namespace:  System.ServiceProcess
Assembly:  System.ServiceProcess (in System.ServiceProcess.dll)

public override void Install(
	IDictionary stateSaver
)

Parameters

stateSaver
Type: System.Collections.IDictionary

An IDictionary that contains the context information associated with the installation.

ExceptionCondition
ArgumentException

The stateSaver is null.

Normally, you do not call the methods on ServiceProcessInstaller within your code; they are generally called only by the install utility. The install utility automatically calls the ServiceProcessInstaller.Install method during the installation process. It backs out failures, if necessary, by calling Rollback on all previously installed components. This method passes the installation to the base class Installer.Install method.

Normally, you will not call the methods on ServiceInstaller within your code; they are generally called only by the install utility. The install utility automatically calls the ServiceProcessInstaller.Install and ServiceInstaller.Install methods during the installation process. It backs out failures, if necessary, by calling Rollback (or ServiceInstaller.Rollback) on all previously installed components

An application's install routine maintains information automatically about the components already installed, using the project installer's Installer.Context. This state information, passed into Install as the stateSaver 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.

Install passes to the calling method any exceptions thrown by base class methods or BeforeInstall / AfterInstall event handlers.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft