ASP Code
  Home arrow ASP Code arrow Automated Administration of COM+ Part3, Au...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP CODE

Automated Administration of COM+ Part3, Automated Installation of COM+/NT dll:
By: Sreedhar Koganti
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 13
    2001-08-04

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


     

    Author: Sreedhar Koganti 

    In my Previous article we saw how to Create a package ,Delete Package. In this article will see how to Add Dll’s into package. As i said in my previous article you can try these examples in ASP and VB. Personally I will prefer to write in VB. If you want to Create Install/Uninstall package for COM+ dll always writing in VB is preferable. To do this in VB first you have to refer the Com+ admin type library(comadmin.dll). This Comadmin.dll has several classes. Here i am using COMAdmin.COMAdminCatalog. We discussed about comadmincatalogcollecion in my previous article. Inorder to Install Com+ Dll first we need to know into which package we wanto install, which dll we wanto install. Here i am trying to install dll in "SamplePackage" Package. For that i am using "Test.dll" To install this we have to us InstallComponent porperty from COMAdminCatalog In Below example I tried to install Test.dll into "SamplePackage". This example you can get form downloads. It's in VB. (use this code in VB sub or Function or in asp)

     Private Sub DllInstall_Click() On Error GoTo errloop Dim objCOM As COMAdmin.COMAdminCatalog Set objCOM CreateObject("COMAdmin.COMAdminCatalog") 'below Code explains to add the component to App objCOM.InstallComponent "SamplePackage", "Test.dll", "", "" Set objCOM = Nothing MsgBox "your Dll is Successfully installed in" & cmbApp.Text & "Package" Exit Sub errloop: MsgBox "Please Select a package name / enter the Dll Name with Path", vbInformation, "Installer Information" Err.Clear End Sub 

     
    The above code will Install the Test.dll into SamplePackage. InstallComponent method will take four parameters. The first parameter is the application key, and the second one is the file name (DLL), third is external type library (if any), and the last parameter is the name of the proxy-stub DLL name (if any). Uninstall The Dll From The Package: 

     Dim COMObject As COMAdmin.COMAdminCatalog Dim AdminCatCol As COMAdminCatalogCollection Dim AdminCatColOne As COMAdminCatalogCollection Dim AdminCatObj As COMAdminCatalogObject Dim ComCountColl As Integer Dim blnFound As Boolean Dim Comp As String Comp InStr(Text1.Text"."Comp Left(Text1CompRemoveComponent False Set COMObject CreateObject("COMAdmin.COMAdminCatalog"Set AdminCatCol COMObject.GetCollection("Applications"AdminCatCol.Populate Found False 'Iterate through Collection For Each AdminCatObj In AdminCatCol 'Assign Component Collection to AdminCatColOne Set AdminCatColOne AdminCatCol.GetCollection("Components"AdminCatObj.KeyAdminCatColOne.Populate 'Iterate through Collection If AdminCatColOne.Count = 0 Then GoTo Loopone For ComCountColl = AdminCatColOne.Count - 1 To 0 Step -1 'Check the Name in the Collection If InStr(UCase(AdminCatColOne.Item(ComCountColl).Name), UCase(Comp)) > 0 Then 'If the name matches Make RemoveEnable to true If AdminCatColOne.RemoveEnabled = True Then blnFound = True COMObject.ShutdownApplication AdminCatObj.Key AdminCatColOne.Remove ComCountColl AdminCatColOne.SaveChanges Else MsgBox "RemoveEnabled property returned false" End If End If Next Loopone: If blnFound = True Then Exit For Next If blnFound Then MsgBox "Component Removed Successfully" Else MsgBox "Unable to find the Dll ....(Please Dont' enter the Path)" End If If blnFound = True Then RemoveComponent = True Set AdminCatObj = Nothing Set AdminCatCol = Nothing Set COMObject = Nothing 

    ********************************************************** To Uninstall the dll from the COM+ , actuall way is First we have to find the KeyID of the dll then we have to check for the Key id in all the packages.If you find Id then delete it. But here i followed round about method by keeping basic reades in my mind. Reades can understand this approch very easily even though they doesend knwo about KEY. Here in my first step i am accepting the dll name from the text box.Then i am taking only name part from the text box. Ex: fi i have dll name as FileProc.dll, From this i am taking "Fileproc." , and i am checking for "FileProc." To do this I am taking All the Applications names as collection into "AdminCatCol". Again From each Application i am taking Component Collection. From the Component collection i am taking each class of the component and i am comparing with the entered dll name. If it is there then i am removing the class form that collecton and i am saving the collection. Once you see the code You can get clear idea.You can down the code from downloads. You can get more information on this in http://msdn.microsoft.com. By making some changes in the above code and keeping more error trapping you can create Make good Install Package. Note: In this example i am not checking whether the dll is installed Previouslly or not. I am installing the specified dll if it is there or not. You can add that code to make better installer package. Note: This code can also be implemented in ASP with some changes. It will help people who want to deploy COM+ dll with out manual process. Author: Sreedhar Koganti Working in Unisys as a Technical Team Lead Expertixe in ASP,COM+,XML,SOAP,NTService,VB, Drop of .Net Article Writer in asptoday.com,Aspalliance.com,aspfree.com


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More ASP Code Articles
    More By Sreedhar Koganti

     

    IBM® developerWorks developerWorks - FREE Tools!


    NEW! Accelerating Software Innovation on i on Power Systems

    Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, for an overview of Rational’s new software offerings and resources to help modernize and accelerate software innovation on i on Power Systems – while ensuring past application investments are protected and continue to grow. Learn how these solutions are helping customers extend their core i5/OS solutions toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time.
    FREE! Go There Now!


    NEW! Download DB2 9.5 for Linux, Unix, and Windows

    Download a free trial version of IBM DB2 9.5 for Linux, UNIX, and Windows. DB2 9 is the result of a five-year development project that transformed traditional (static) database technology into an interactive data server that merges the high performance and ease of use of DB2 with the self-describing benefits of XML.
    FREE! Go There Now!


    NEW! Download DB2 Express-C 9.5

    Visit IBM developerWorks to download IBM DB2 Express-C 9.5, a no-charge version of DB2 Express 9 database server. DB2 Express-C offers the same core data server base features as other DB2 Express editions and provides a solid base to build and deploy applications developed using C/C++, Java, .NET, PHP, and other programming languages.
    FREE! Go There Now!


    NEW! Download the free Web Application Security eKit

    Discover how IBM Rational AppScan Standard Edition can help you detext vulnerabilities in your web applications in the Web Application Security eKit. IBM Rational AppScan is a leading suite of automated web application security solutions that scan and test for common Web application vulnerabilities. The new Web Application Security eKit provides you with valuable resources, including white papers, demos, and additional information on the benefits of testing your Web applications.
    FREE! Go There Now!


    NEW! Successful Change and Release Management for .NET

    Join this webcast to discover the key requirements for successful change and release management. Learn how to extend your .NET environment to improve productivity and collaboration, and address core problems afflicting team development. In this webcast, we’ll review typical challenges faced by customers and how to resolve them with the IBM Rational Change and Release Management solution, including Rational ClearCase, Rational ClearQuest and Rational Build Forge. Replay is available for 9 months.
    FREE! Go There Now!


    NEW! Test terminal-based applications with Rational Functional Tester

    Regression testing -- in which code is thoroughly tested to ensure that changes have not produced unexpected results -- is an important part of any development process. But many testing environments neglect the terminal-based applications that still form the backbone of many industries. In this tutorial, you'll learn how the Rational Functional Tester Extension for Terminal-Based Applications works with other Rational Functional Tester to help test terminal-based applications quickly and easily.
    FREE! Go There Now!


    NEW! The dirty dozen: preventing common application-level hack attacks

    As organizations have grown increasingly dependent on online software, the risk of malicious attacks has also become far more serious. Fortunately, well-governed organizations can protect their Web applications by injecting vulnerability assessments and ethical hacks into their software development and delivery processes. This paper describes 12 of the most common hacker attacks and provides basic rules that you can follow to help create more hack-resistant Web applications.
    FREE! Go There Now!


    NEW! Webcast: Accelerating Software Innovation with System z

    Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, where he will overview Rational’s new offerings and programs to help customers accelerate software innovation on System z. He will discuss how these solutions help organizations extend their core business processes toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time.
    FREE! Go There Now!


    NEW! Webcast: Application security testing and Web compliance

    Join the IBM Watchfire team for an informative discussion on techniques and best practices to proactively manage Web application security and how to effectively build application security testing into the software development lifecycle (SDLC). In this Software Delivery Platform webcast you will learn: How to better understand potential web application security vulnerabilities, best practices and how to effectively integrate application security testing into the software development lifecycle, the importance of detecting and removing software vulnerabilities during application development.
    FREE! Go There Now!


    NEW! Whitepaper: Achieving consistency between business process models and operational guides

    Explore how Rational and WebSphere software enable enterprise documentation in SOA environments. Specifically, a new integration between IBM WebSphere® Business Modeler and IBM Rational® Method Composer software can help technical writers more easily keep enterprise operations manuals in sync with changes that are made to business processes, resulting in more accurate and timely documentation that benefits the entire enterprise.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    ASP CODE ARTICLES

    - ASP Forms
    - ASP: The Beginning
    - Getting Remote Files With ASP Continued
    - Inbox and Outbox Manipulation in ASP
    - Relational DropDownList Using VB.NET
    - Ad Tracking URL Hits
    - Use ViewState to display one record per page...
    - Send Email using ASP.NET formatted in HTML
    - ASP File Explorer
    - ASP/XML Interview questions by Srivatsan Sri...
    - Various methods of setting Date values to a ...
    - Conditional DataGrid Item and using checkbox...
    - Fill .NET Listbox with SQL DataReader
    - Filling Dropdown box using Code-Behinds in C#
    - FLAMES code sample written in .NET What is F...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek