How can you programmatically disable or use the "Windows Properties",
Currently, users must go to Control Panel> Programs> Turn Windows Features On or Off, and then check the box for the feature they want to activate. I would like to give them the opportunity to do this from my application.
Any idea on how to automate this process through .NET (preferably in C #)?
I am 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 should create an unattended installation file with instructions for pkgmgr to use for this function.
You need to use
System.Diagnostics.Process.Start(). If you focus only on new platforms (> = Windows Vista), then dis.exe is the latest utility; it replaces pkgmgr.
- http://technet.microsoft.com/en-us/library/dd799309(WS.10).aspx
- http://msdn.microsoft.com/en-us/library/dd371719(v=vs.85).aspx
Call example (for all necessary functions):
dism.exe /online /enable-feature /featurename:IIS-WebServerRole To find a function, use this
dism.exe /online /get-features | find "Tablet" see http://adriank.org/microsoft-ocsetupdism-component-name-list/ for more information.