This documentation is archived and is not being maintained.

MessageQueueInstaller.Install Method

Performs the installation and writes message queue information to the registry. This method is meant to be used by installation tools, which automatically call the appropriate methods.

[Visual Basic]
Overrides Public Sub Install( _
   ByVal stateSaver As IDictionary _
)
[C#]
public override void Install(
 IDictionary stateSaver
);
[C++]
public: void Install(
 IDictionary* stateSaver
);
[JScript]
public override function Install(
   stateSaver : IDictionary
);

Parameters

stateSaver
An IDictionary used to save information needed to perform a commit, rollback, or uninstall operation.

Remarks

The Install method writes message queue information to the registry, and associates the MessageQueue instance with a queue that is located at the path specified by the Path property. If the queue does not already exist, Install creates a transactional queue. Install sets the new or existing queue properties to those that you have specified in the MessageQueueInstaller. If the queue already exists, its properties are reset to those of the MessageQueueInstaller. If the existing queue is not transactional, it is deleted and then recreated as a transactional queue.

CAUTION   If it is necessary to recreate the queue, messages in the queue will be lost.

Typically, you do not call the methods of the MessageQueueInstaller from within your code; they are generally called only by the installutil.exe installation utility. The utility automatically calls the Install method during the installation process to write registry information that is associated with the MessageQueue being installed. Installation is transactional, so if there is a failure of any installation project component during the installation, all the previously-installed components are rolled back to their pre-installation states. This is accomplished by calling each component's Rollback method.

After a successful installation of all the components that are associated with the installation project has occurred, the installation utility commits the installations. Commit completes the installation of the MessageQueue by setting the queue to the appropriate initial state. If the queue specified by the Path property already exists and contains messages, Commit clears the messages. Commit, rather than Install, clears the messages because the act of purging the messages cannot be rolled back.

An application's install routine uses the project installer's Installer.Context to automatically maintain information about the components that have already been installed. This state information, which is passed to Install as the stateSaver parameter, is continuously updated as the utility installs each MessageQueueInstaller instance. Usually, it is not necessary for your code to explicitly modify this state information.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

MessageQueueInstaller Class | MessageQueueInstaller Members | System.Messaging Namespace | Commit | Rollback | Uninstall | IDictionary

Show: