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 / November 2006

Tip: Looking for answers? Try searching our database.

Programatically install and set Identity to a COM+ application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lennin@gmail.com - 30 Nov 2006 16:05 GMT
Hi everyone!

 Does anybody know how to programmatically install a COM+ application
and set the identity account (domain\user)?

 I'm using c#  (.net 1.1x)  winxp sp2, win2003 rc2

[assembly: ApplicationActivation(ActivationOption.Server)]
MyComponent: ComponentService
{
....
}

I was looking into the methods from
System.EnterpriseServices.RegistrationHelper:

                   RegistrationHelper helper = new
RegistrationHelper();
            RegistrationConfig config = new RegistrationConfig();
            config.Application = "xxxx";
            config.ApplicationRootDirectory = installDirectory;
            config.AssemblyFile =
typeof(SecurityInfo.UserInfo).Assembly.Location;
            config.InstallationFlags =
InstallationFlags.FindOrCreateTargetApplication;
            helper.InstallAssemblyFromConfig(ref config);

...but there is nowhere I can put the account under which I want to run
this component nor I find any attributes that seem to help.

Have you any ideas?  I wouldn't mind using (not yet wrapped) COM or
win32 functions.

Thanks in advance,

Lennin
lennin@gmail.com - 30 Nov 2006 17:16 GMT
Nevermind.  using COMAdmin (com reference) it works : )

Code used:
-----------------------------------------------------------------------------------------------------------
COMAdminCatalog ca = new COMAdminCatalogClass();

                COMAdminCatalogCollection cacc =
(COMAdminCatalogCollection)ca.GetCollection("Applications");
                cacc.Populate();
                foreach(COMAdminCatalogObject cac in cacc)
                {
                    if(cac.Name.ToString() == config.Application)
                    {
                        cac.set_Value("Identity", user);
                        cac.set_Value("Password", password);
                        cacc.SaveChanges();

                        Logger.Write("Setting identity sucessfully.");
                        break;
                    }
                }

lennin@gmail.com schrieb:

> Hi everyone!
>
[quoted text clipped - 32 lines]
>
> Lennin

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.