Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

MTS Pacakge Creation

MTS Pacakge Creation

MTS Pacakge Creation

I want is there any way i can automate the process of
MTS Package Creation plus .dlls install in that Package
i want it very urgent
Pleas Help me

RE: MTS Pacakge Creation

Of course you can do it using MTSAdmin API.Here is some code snippet (delphi):
  TDLLInfo = record
    PkgName : string;
    DLLFile : string;        //The DLL file
    SecurityEnabled : Char;  //Enable security ('N'/'Y')
{Function : Install some package from *.dll files
 In :  SrvrName - Server to which the given DLLs will be installed
       ADLLInfo- an array of package info.
 Out : N/A
 Authors : allen
 Last Updated : 1999-07-28
procedure InstDLLFile(const SrvrName:string; const ADLLInfo:array of TDLLInfo);
var i,j : Integer;
    ACatalog : ICatalog;
    ARoot,APkgs,AComps : ICatalogCollection;
    ANewPkg : ICatalogObject;
    ACompUtil : IComponentUtil;
  ACatalog := CoCatalog.Create; //First, we create the catalog object
//Then we get the packages collection
  ARoot := ACatalog.Connect(SrvrName) as ICatalogCollection;
  APkgs := ARoot.GetCollection('Packages',') as ICatalogCollection;
//Remove all packages that go by the same name as the package we wish to install
  for i:=0 to SizeOf(ADLLInfo) div SizeOf(ADLLInfo[0]) - 1 do
    for j:=APkgs.Count-1 downto 0 do
     if ICatalogObject(APkgs.Item[j]).Value['Name'] = ADLLInfo.PkgName then
  for i:=0 to SizeOf(ADLLInfo) div SizeOf(ADLLInfo[0]) - 1 do begin
    ANewPkg := APkgs.Add as ICatalogObject;
    ANewPkg.Value['Name'] := ADLLInfo.PkgName;
    ANewPkg.Value['SecurityEnabled'] := ADLLInfo.SecurityEnabled;
    APkgs.SaveChanges;   //Commit it
    APkgs.Populate;     //Refresh it
  //Get components collection for new package
    AComps := APkgs.GetCollection('ComponentsInPackage',ANewPkg.Value['ID']) as ICatalogCollection;
  //Install components
    ACompUtil := AComps.GetUtilInterface as IComponentUtil;
  end; //for i
Hope this can help you!

Long live of freedom!

RE: MTS Pacakge Creation

Thanx for you help.i really appreciate it
all of you who help me..
THanx again

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close