I'm using the following code to install Windows features (like the IIS) within my msi-setup which also installs my wcf services.
<Property Id="INSTALLIISPROP" Value="C:\Windows\System32\dism.exe"></Property>
<CustomAction Id="InstallIISCA" Return="check" Property="INSTALLIISPROP" Execute="deferred" HideTarget="yes" Impersonate="yes"
ExeCommand="/online /enable-feature /featurename:IIS-WebServerRole /featurename:IIS-WebServerManagementTools /featurename:IIS-ManagementConsole" ></CustomAction>
<InstallExecuteSequence>
<Custom Action="InstallIISCA" Before="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>
Working fine, except that I need the IIs to be already installed during the service installation (to get a list of the installed websides, ect. in the UI). I created a secound Setup Project and put the code in there but it only executes my command if I include a dummy file:
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent" Guid="ff876420-51ed-4bfc-bfd0-167a6333bf5e">
<File Id="Product.wxs" Source="Product.wxs" KeyPath="yes" Checksum="yes"/>
</Component>
</ComponentGroup>
</Fragment>
Also I don't want a secound item in my "installed applications" list. Where would be the "normal" position for this? Can I execute my command direct from the Bootstrapper? Or can I execute the Custiom Action before the UI is loaded and any conditions are checked?
<Chain >
<PackageGroupRef Id="NetFx45Web"/>
<MsiPackage SourceFile="ServiceSetup.msi" EnableFeatureSelection="yes" DisplayInternalUI="yes" ForcePerMachine="yes"/>
</Chain>