This documentation is archived and is not being maintained.

Configuring Installation Components

When an installation component is created for a component in your project, Visual Studio .NET copies property values that are necessary for the installer to recreate the chosen resource. For example, for an EventLog installer, the system copies the values of the Log and Source properties and uses these values during installation to create your log in the correct location.

The property values are copied either from the component or from the resource with which the component interacts on your test server. For example, suppose you have an instance of the MessageQueue component that interacts with a test queue called OrdersReceived on a server called server1. When you create an installer for this component, it copies the Path property's value from the component, and then uses this to locate the resource on the test machine. All of the properties set for that resource on the test machine are also copied to installation code. If there is no physical test resource, the system copies all of its values from the component, and you need to fill in the missing necessary properties manually in the ProjectInstaller class.

The following code shows how the default properties for this MessageQueue installer might look in the ProjectInstaller class:

' Visual Basic
Private WithEvents MessageQueueInstaller1 As System.Messaging.MessageQueueInstaller
Private Sub InitializeComponent()
   Me.MessageQueueInstaller1 = New System.Messaging.MessageQueueInstaller
   MessageQueueInstaller1.MaximumJournalSize = 4294967295&
   MessageQueueInstaller1.BasePriority = 0%
   MessageQueueInstaller1.Path = "server1\OrdersReceived"
End Sub

// C#
private System.Messaging.MessageQueueInstaller messageQueueInstaller1;
private void InitializeComponent()
   this.messageQueueInstaller1 = new System.Messaging.MessageQueueInstaller();
   messageQueueInstaller1.MaximumJournalSize = 42949672951;
   messageQueueInstaller1.BasePriority = 0;
   messageQueueInstaller1.Path = "server1\\OrdersReceived";

You can manually edit the property values if there is a property that you want to set differently on the deployment computer. In addition to changing default property values, you can also override some of the default methods in the installation component if you want to change the processing that occurs during installation. For more information, see Overriding Default Methods on Installation Components.

To change the default values for an installation component

  1. After adding an installation component to your solution, open the ProjectInstaller class.
  2. Locate the installation component you want to modify, and access it in the Code Editor.
  3. Locate the InitializeComponent procedure. The default property values for your component are located within this procedure.
  4. Make any changes you need to make to the property values that will be used to create your component.

See Also

Adding Installation Components to Your Projects | Overriding Default Methods on Installation Components