Creating and Deploying Installation Components

Creating and Deploying Installation Components

Many of your components will make use of additional resources, such as performance counters, Event Logs, or databases. When you deploy your application, it is important that these additional resources are included in the final installation component. This is accomplished by including an instance of the Installer class in your setup project.

The Installer class derives from the System.Configuration.Install.Installer class and includes the following methods :

  • Commit method This method is executed by the Installer service if the Install method completes successfully. You can use this method to complete any pending transactions.

  • Install method This method is executed by the Installer service at the start of an installation.

  • Rollback method This method is executed by the Installer service if the Install method fails to complete, and it's used to undo any changes enacted by the Install method before its failure.

  • Uninstall method This method is executed by the Installer service when an installed application is selected for uninstallation using the Add/Remove Programs Wizard.

When you choose Add Installer within the properties of a class, a new instance of the ProjectInstaller class will be added to your project. This object maintains a collection of Installer objects required for the instance to install the component within its Installers property. You may also create a custom class that inherits from the base Installer class to implement your own code by overloading the methods of the base class.

To use an Installer component, open the Custom Actions Editor and then right-click the Custom Actions node and select Add Custom Action. Add the primary output from the Installer component. This will add the installation code from that component to the installation code for the project. When you install this component, the necessary setup configuration will be enacted on the installation host, provided you add the following to your class before compilation:

 <RunInstaller(true)> 

You may also use the Installer Tool ( InstallUtil.exe ) command-line utility to install an assembly that includes additional component resources, as shown here:

 InstallUtil.exe MyComponent.dll InstallUtil.exe MyComponent.dll AnotherComponent.dll 

This utility may also be used to uninstall a component, as shown here:

 InstallUtil.exe /u MyComponent.dll 


Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 188

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net