Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MessageQueueInstaller Class

Allows you to install and configure a queue that your application needs in order to run. This class is called by the installation utility, for example, InstallUtil.exe, when installing a MessageQueue.

Namespace:  System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)
public class MessageQueueInstaller : ComponentInstaller

The MessageQueueInstaller type exposes the following members.

  NameDescription
Public methodMessageQueueInstaller()Initializes a new instance of the MessageQueueInstaller class. Does not set any instance properties.
Public methodMessageQueueInstaller(MessageQueue)Initializes a new instance of the MessageQueueInstaller class, initializing the installation settings to those of an existing MessageQueue instance.
Top
  NameDescription
Public propertyAuthenticateGets or sets a value that indicates whether the queue to be installed accepts only authenticated messages.
Public propertyBasePriorityGets or sets the base priority that is used to route a public queue's messages over the network.
Protected propertyCanRaiseEventsGets a value indicating whether the component can raise an event. (Inherited from Component.)
Public propertyCategoryGets or sets an implementation-specific queue type.
Public propertyContainerGets the IContainer that contains the Component. (Inherited from Component.)
Public propertyContextGets or sets information about the current installation. (Inherited from Installer.)
Protected propertyDesignModeGets a value that indicates whether the Component is currently in design mode. (Inherited from Component.)
Public propertyEncryptionRequiredGets or sets a value that indicates whether the queue accepts only private, or encrypted, messages.
Protected propertyEventsGets the list of event handlers that are attached to this Component. (Inherited from Component.)
Public propertyHelpTextGets the help text for all the installers in the installer collection. (Inherited from Installer.)
Public propertyInstallersGets the collection of installers that this installer contains. (Inherited from Installer.)
Public propertyLabelGets or sets a description of the queue.
Public propertyMaximumJournalSizeGets or sets the maximum size of the journal that is associated with the queue.
Public propertyMaximumQueueSizeGets or sets the maximum size of the queue.
Public propertyMulticastAddressIntroduced in MSMQ 3.0. Gets or sets the multicast address associated with the queue.
Public propertyParentGets or sets the installer containing the collection that this installer belongs to. (Inherited from Installer.)
Public propertyPathGets or sets the location of the queue that is referenced by this object.
Public propertyPermissionsGets or sets permissions associated with the queue.
Public propertySiteGets or sets the ISite of the Component. (Inherited from Component.)
Public propertyTransactionalGets or sets a value that indicates whether the queue accepts only messages sent as part of a transaction.
Public propertyUninstallActionGets or sets a value that indicates what the installer does with the queue at uninstall time: remove it, restore it to its pre-installation state, or leave it in its current installed state.
Public propertyUseJournalQueueGets or sets a value that indicates whether messages that are retrieved from the queue are also copied to the associated journal queue.
Top
  NameDescription
Public methodCommitCompletes the installation process by committing the MessageQueue installation information that the Install method wrote to the registry. This method is meant to be used by installation tools, which automatically call the appropriate methods. (Overrides Installer.Commit(IDictionary).)
Public methodCopyFromComponentCopies the property values of a MessageQueue component that are required at install time for a message queue. (Overrides ComponentInstaller.CopyFromComponent(IComponent).)
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public methodDispose()Releases all resources used by the Component. (Inherited from Component.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the Component and optionally releases the managed resources. (Inherited from Component.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeReleases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected methodGetServiceReturns an object that represents a service provided by the Component or by its Container. (Inherited from Component.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodInstallPerforms 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. (Overrides Installer.Install(IDictionary).)
Public methodIsEquivalentInstallerDetermines whether the specified installer can handle the same kind of installation as this installer. (Overrides ComponentInstaller.IsEquivalentInstaller(ComponentInstaller).)
Protected methodMemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
Protected methodMemberwiseClone(Boolean)Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Protected methodOnAfterInstallRaises the AfterInstall event. (Inherited from Installer.)
Protected methodOnAfterRollbackRaises the AfterRollback event. (Inherited from Installer.)
Protected methodOnAfterUninstallRaises the AfterUninstall event. (Inherited from Installer.)
Protected methodOnBeforeInstallRaises the BeforeInstall event. (Inherited from Installer.)
Protected methodOnBeforeRollbackRaises the BeforeRollback event. (Inherited from Installer.)
Protected methodOnBeforeUninstallRaises the BeforeUninstall event. (Inherited from Installer.)
Protected methodOnCommittedRaises the Committed event. (Inherited from Installer.)
Protected methodOnCommittingRaises the Committing event. (Inherited from Installer.)
Public methodRollbackRestores the computer to the state it was in before the installation, by rolling back the queue information that the installation procedure wrote to the registry. This method is meant to be used by installation tools, which automatically call the appropriate methods. (Overrides Installer.Rollback(IDictionary).)
Public methodToStringReturns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.)
Public methodUninstallRemoves an installation by removing queue information from the registry. This method is meant to be used by uninstallation tools, which automatically call the appropriate methods. (Overrides Installer.Uninstall(IDictionary).)
Top
  NameDescription
Public eventAfterInstallOccurs after the Install methods of all the installers in the Installers property have run. (Inherited from Installer.)
Public eventAfterRollbackOccurs after the installations of all the installers in the Installers property are rolled back. (Inherited from Installer.)
Public eventAfterUninstallOccurs after all the installers in the Installers property perform their uninstallation operations. (Inherited from Installer.)
Public eventBeforeInstallOccurs before the Install method of each installer in the installer collection has run. (Inherited from Installer.)
Public eventBeforeRollbackOccurs before the installers in the Installers property are rolled back. (Inherited from Installer.)
Public eventBeforeUninstallOccurs before the installers in the Installers property perform their uninstall operations. (Inherited from Installer.)
Public eventCommittedOccurs after all the installers in the Installers property have committed their installations. (Inherited from Installer.)
Public eventCommittingOccurs before the installers in the Installers property committ their installations. (Inherited from Installer.)
Public eventDisposedOccurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)
Top

The MessageQueueInstaller is used by the installation utility to write registry values that are associated with the queue. For more information about installation utilities, see Installutil.exe (Installer Tool).

To install a queue, create a project installer class that inherits from the Installer, and set the RunInstallerAttribute for the class to true. Within your project, create a MessageQueueInstaller instance for each queue in the installation and add the instance to your project installer class.

When creating a MessageQueueInstaller instance, you can optionally pass an existing MessageQueue (for example, from a test server) to the MessageQueueInstaller constructor. This approach automatically provides the configuration settings for the new queue by mirroring the settings of the queue passed in. Alternatively, you can manually set the properties in the MessageQueueInstaller instance to the states you want and call the default constructor.

When the install utility is called, it looks for the RunInstallerAttribute. If it is true, the utility installs all the queues in the Installers collection associated with your project installer. If RunInstallerAttribute is false, the utility ignores the project installer.

You modify other properties of a MessageQueueInstaller instance either before or after adding the instance to the Installers collection of your project installer. For example, a queue's Path must be set before the install utility executes.

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 and calls Commit if the installation did not throw an exception. It backs out failures, if necessary, by calling Rollback for the object that generated the exception.

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 is continuously updated as each MessageQueueInstaller instance is installed by the utility. It is not usually necessary for your code to explicitly modify the state information.

.NET Framework

Supported in: 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 Phone 8.1, Windows Phone 8, 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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.