advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Download the code for this article
Do you write your own installations from scratch, rely on Visual Studio Setup projects, or use a third-party installer, such as those from Wise and InstallShield? Were you aware that you could extend Visual Studio's setup projects via custom classes? Now that you know it's possible, does the knowledge change the way you'll write future installs? What other interesting installation problems or useful techniques have you discovered while installing your .NET applications? What do you want to see in future installation articles? Let us know in the .NET Technical discussion forum.
Partners & Affiliates
advertisement
advertisement
advertisement
Average Rating: 4.1/5 | Rate this item | 23 users have rated this item.
 

Building Custom Installer Classes in .NET

When it comes to installations, automation beats manual intervention hands-down every time. Learn how to build custom installer classes to automate setup tasks that Visual Studio setup projects don't handle automatically. 


advertisement
isual Studio setup projects provide a quick and easy way for end-users to deploy your application, whether it is a Web site, Windows NT service, smart client, or Web service. Even though the .NET framework introduced the idea of "xcopy deployment," for many projects it is useful (or expected) that you automate all the tasks required by your installation procedure, thus ensuring the consistency and repeatability of the installation process. When you do that, system administrators and end users gain the ability to perform the installation process without technical assistance—and you avoid the need to provide detailed end-user documentation on the process.


A standard Visual Studio setup project can copy files and create directories on the target file system, create start menus, and create registry entries. If you need to do more, you may need to implement custom actions.


MSI Custom Installer Actions
Since the release of the Windows Installer component, most third-party (and Microsoft) setup-creation tools make use of it as a common base of functionality. Windows Installer setups allow developers to execute both standard actions and custom actions as part of a setup sequence.

You use custom actions when you need to perform special or application-specific tasks that standard actions cannot accomplish. The .NET framework exposes the custom actions capability via the Installer class, whose methods you override to perform tasks of your choice.

Author's Note: The techniques shown in this article work with the .NET framework 1.0 or 1.1 and Visual Studio. The code samples were written using Visual Studio 2003 and .NET 1.1

Create Your Own Custom Action in .NET
To add a custom action to your setup project, you need to:

  1. Create an installer class.
  2. Override the Install and Uninstall methods.
  3. Test your installer class implementation using the .NET installer utility.
  4. Configure your setup project to use your custom installer.
  Next Page: Create the Installer Class


Page 1: IntroductionPage 3: Using Your Custom Installer
Page 2: Create the Installer ClassPage 4: Providing Output
Please rate this item (5=best)
 1  2  3  4  5
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs