Exforsys

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor

Ads


Home arrow Technical Training arrow VB.NET 2005

Microsoft .NET Creating Installation Components

Page 1 of 3
Author : Exforsys Inc.     Published on: 10th Aug 2005    |   Last Updated on: 24th Dec 2007

VB.NET 2005 Tutorials : Creating Installation Components

In this tutorial you will learn how to Create installation components, Work with predefined Installation Components, Deploying an Assembly containing the Installation Components, Working with Installer Classes, URL Remoting, Launching a Remote Application, The Download Cache, Code Access Security Policy and Methods of Deployment

Ads

Creating installation components

Understanding the Installer Class

Installer class is the base class for all custom installers in the .NET Framework. Installers are components that assist in installing applications on a computer. The steps that must be followed to use the installer class are given below:

1. Inherit the System.Configuration.Install.Installer class

2. Override the Install, Commit, Rollback and Uninstall methods

3. Add the System.ComponentModel.RunInstallerAttribute

4. Put your derived class in the assembly with the application to Install

5. Invoke the installers. For this you can use InstallUtil.exe.

Sample code that illustrates the use of System.Configuration.Install.Installer class and creating a class that inherits form it. It also shows the method overrideing.

Click here to view sample code

Working with predefined Installation Components

When deploying an application on a computer which needs the use of a performance counter, the counter must also be installed. Using an installation component, the application can be set up so that it automatically creates and configures the necessary performance counter on a remote computer application is installed. The installation components can be of two types namely, the installer classes added to the projects, and pre-defined installation components that are associated with components.

Predefined installation components are associated on a one-to-one basis with the components that need them. For example, an instance of the MessageQueue component in the project requires that the deployed application has a queue installed and configured—the developer has to create an installation component to handle the task. Then if the developer wants to add an instance of an EventLog component to the project he has to configure the event log in use, and must add a second installation component to perform that processing.

The .NET Framework has five predefined installation components can be used in the projects. They are listed below in the table.

Installer Components and Description

EventLog installerAllows you to install and configure a custom event log that your application needs in order to run (based on the System.Diagnostics.EventLogInstaller class) 

MessageQueue installerAllows you to install and configure a queue that your application needs in order to run. (based on the System.Messaging.MessageQueueInstaller class) 

PerformanceCounter installerAllows you to install and configure a custom performance counter that your application needs in order to run. (based on the System.Diagnostics.PerformanceCounterInstaller class) 

The Service and the ServiceProcess installersThey are used together to allow you to install service applications. (based on the System.ServiceProcess.ServiceInstaller and System.ServiceProcess.ServiceProcessInstaller classes)All of the installation components in a project are stored within classes marked with the RunInstallerAttribute=True. By default, a class named ProjectInstaller that contains this attribute is added to the project when a predefined installation component is added; installer classes added via the Add New Item dialog box also contain this attribute and are named Installer1 by default.

Adding predefined installation components to your project.

1. In the designer, click the component for which an installation component is to be added, and then click the Add Installer link in the Properties window.

2. If necessary, access the ProjectInstaller class in the Code Editor and modify any of the values that were copied to the installation component.

3. Override any methods for which need to perform custom processing.

4. Continue to perform steps 1 through 3 for each installation component the project needs.

Deploying an Assembly containing the Installation Components

Assemblies containing installation components can be deployed by using the setup and deployment projects or by using the Installer tool.

Using the Setup Project to Install Component Resources

1. Add a new setup project to the solution and give it a name.

2. Right click the project in the Solution explorer and select Add, Project Output from the menu

3. In the Add Project Output group dialog box select Primary Output of the Project.

4. Open the Customs actions editor for the project and right click the Cutoms Actions Node. Add Custom Action from the shortcut menu.

5. The select item in the Project dialog box appears.

6. In the Application folder select Primary Output from the application(Active).

7. The primary out put will be added to the four nodes under Custom Actions--Install, Commit, Rollback and Uninstall.

8. Select New Project in Solution Explorer. Activate the properties window.

9. Set the Parameters for the application.

10. Build the application and take the project’s output to a computer that does not already have an event source for the application.

11. Run the installation.

Deploying an Installation component by using the Installer tool

The command line installer tool is used to install assemblies that contain additional component tools. The resources contained in the Assembly1.dll can be installed using installutil.exe. Resources contained in multiple assemblies can also be installed using the installutil.exe. The uninstaller.exe is used to uninstall the assemblies.

Working with Installer Classes

Customized installer classes can be used to perform custom actions during installation. These compiled Installer classes from the project are added to the deployment project as custom actions that are run at the end of the installation. The process is as under:

Ads

1. Inherit a class from the installer class.

2. The RunInstaller attribute is set to true in the derived class.

3. Override the Install(), Commit(), Rollback() and Uninstall() methods to perform any custom actions.

4. In the setup project, use the Custom Actions Editor to invoke this derived class to do the required processing.



 
This tutorial is part of a VB.NET 2005 tutorial series. Read it from the beginning and learn yourself.

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor
 

Comments