Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / December 2003

Tip: Looking for answers? Try searching our database.

COM Component Creation and Registration Script

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott Vercuski - 11 Dec 2003 21:19 GMT
Hello everyone,

  I have a question regarding COM+ Component Services.  I currently
have a machine that has a number of separate COM+ Packages with 1-2
components in each package.  We're implementing a new backup strategy
and I would like to know if there is a way to script the
creation/registration of packages and components in the event that I
have to rebuild the server.  For instance, under COM+ I have the
following setup

Console Root
 Component Services
   Computers
     My Computer
       COM+ Applications
         Pkg1
           Components
             Component1
         Pkg2
           Components
             Component2

All of the com components are stored in separate folders under
c:\components

c:\components\Component1\Component1.dll
c:\components\Component2\Component2.dll

Is there a way to have a script that will automatically generate Pkg1
and Pkg2 (with the appropriate username/password) and register the
components under their respective packages all in one fell swoop?  I'm
thinking of this in the disaster recovery scenario where I have to get
the machine back up and running as fast as possible and re-registering
and creating over 100 packages will take some time.  If I could just
restore the components from a backup tape to their directories and
then run this script to re-register everything it would be an enormous
timesaver.  Has anyone done anything like this? and if so could you
please let me know if it worked and how you went about it.

Thank you in advance for any help,

Scott Vercuski
svercuski@neo.rr.com
Nick Malik - 13 Dec 2003 09:34 GMT
The easy answer: use Norton Ghost to make a backup of your disk image.
Then, if you need to restore the machine from the image, you will already
have the objects installed, registered, and working.

HTH,
--- Nick

> Hello everyone,
>
[quoted text clipped - 39 lines]
> Scott Vercuski
> svercuski@neo.rr.com
Slava Gurevich - 13 Dec 2003 09:57 GMT
Take a look at the ICOMAdminCatalog::ExportApplication API  ( and
possibly ICOMAdminCatalog::InstallApplication if you want the restore
process automated too).
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cossdk/htm/icom
admincatalog_70ha.asp


Sample script:

'*******************
'*  backup.vbs
'*******************
dim Catalog
set Catalog = CreateObject("COMAdmin.COMAdminCatalog")

' export the application(s)
catalog.ExportApplication(appName_1, msiFile_1, 5)
...
...
catalog.ExportApplication(appName_N, msiFile_N, 5)

set Catalog = nothing

'******************************************************************

Of course you can enhance the script to shut down/pause the COM+
application before the export, handle errors, use other export
options, etc.   To restore, just run the generated MSI files manually,
or write a similar script using the InstallApplication() API.  The
generated MSI is self-comtained in a sense of having  the application
components as a part of the file.

It is possible to write a loop enumerating all COM+ applications, but
that would include the pre-defined system applications, etc, which you
do not want to back up.  I think you would be better off explicitly
listing the COM+ applications to be backed up.

Regards,

Slava Gurevich

>Hello everyone,
>
[quoted text clipped - 39 lines]
>Scott Vercuski
>svercuski@neo.rr.com

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.