In one of the installation projects, we used dism.exe to enable the necessary Windows features.
For example, the inclusion of ASP.NET in IIS 8 was performed with the following user action:
<Property Id="DISMEXEPATH" Value="dism.exe" /> <SetProperty Id="DISMEXEPATH" Value="[WindowsFolder]Sysnative\dism.exe" After="AppSearch">VersionNT64</SetProperty> <CustomAction Id="SetForEnableAspNetIIS8" Property="EnableAspNetIIS8" Value=""[DISMEXEPATH]" /norestart /quiet /online /enable-feature /featurename:IIS-ApplicationDevelopment /featurename:IIS-ASPNET45 /featurename:IIS-NetFxExtensibility45 /featurename:NetFx4Extended-ASPNET45 /featurename:IIS-ISAPIExtensions /featurename:IIS-ISAPIFilter" /> <CustomAction Id="EnableAspNetIIS8" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check"/>
This doesn't sound like good practice, but it worked for this project.
source share