Currently, users must go into Control Panel > Programs > Turn Windows features on or off, then click on the check the box of the feature that they want to activate. I\'d lik
I do this using NSIS for IIS using :
$Sysdir\pkgmgr.exe /n:$Temp\iis7Unattend.xml
You can call the pkgmgr program from your c# program and usually you would create an unattend file with the instructions for the pkgmgr to use for the feature.
You need to use
System.Diagnostics.Process.Start().
If you are only targeting newer platforms (>= Windows Vista) then dism.exe is the latest utility; it replaces pkgmgr.
Example call (run for all required features):
dism.exe /online /enable-feature /featurename:IIS-WebServerRole
To find a feature, use this
dism.exe /online /get-features | find “Tablet”
see: http://adriank.org/microsoft-ocsetupdism-component-name-list/ for more info.