Re: Programmatically adding/removing windows components

Matthew Brindley <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
Thanks Phil, that's perfect!

I think you're right that an installer would've been a better idea,  
I'm nearly finished now though, I'll remember for next time.

If it's of interest, here's the code I've written to use sysocmgr:

         /// <summary>
         /// Disable and remove Internet Explorer Enhanced Security,  
IIS (Internet Information Services) and other non-essential windows  
components
         /// </summary>
         private void disableNonEssentialWindowsComponents()
         {
             Process sysOcMgr = new Process();
             sysOcMgr.StartInfo = new ProcessStartInfo(
                        "sysocmgr.exe",
                        @"/i:C:\windows\inf\sysoc.inf /u:WinComponents.txt / 
q /r");
             sysOcMgr.Start();
             sysOcMgr.WaitForExit();
             sysOcMgr.Close();
         }

The contents of WinComponents.txt:

[Components]
IEHardenUser=Off
IEHardenAdmin=Off
iis=Off


On 25 Aug 2008, at 05:30, Phil Sayers wrote:

> and there is always this:
> http://support.microsoft.com/kb/222444
>
> -----Original Message-----
> From: Discussion of advanced .NET topics.
> [mailto:[email protected]]On Behalf Of Matthew
> Brindley
> Sent: Monday, August 25, 2008 6:14 PM
> To: [email protected]
> Subject: [ADVANCED-DOTNET] Programmatically adding/removing windows
> components
>
>
> Morning folks,
>
> Is anyone aware of an API or platform function(s) for interacting with
> the "Add/remove windows components" dialog (the one you'll see in XP
> down the LHS of the add/remove programs dialog).
>
> I'm writing a deploy application for new Windows Server 2003/8
> servers, and I'd like a way to programmatically:
>        - Disable Internet Enhanced Security Configuration (IESC)
>        - Uninstall the "Application Server" component (including IIS  
> and
> friends).
>
> Permissions isn't a problem, it'll be running under the admin account
> with elevated permissions.
>
> Uninstalling the app server stuff isn't that important, I can always
> just disable their services, but removing IESC is very important.
>
> I'm using C#, but certainly don't mind using P/Invoke or even a
> different language/framework if needed.
>
> Thanks in advance!
>
> --
> Matt
>
> ===================================
> This list is hosted by DevelopMentor.  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor®  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.