I have made a bootstrapper project with WiX 3.9. In this project i install IIS Express and then i activate the IIS features. Until now i added the Dism.exe from my computer as a resource and activated the features like that:
<ExePackage Id='IIS_WebserverRole'
DisplayName='Installing IIS: IIS-WebServerRole'
PerMachine='yes'
SourceFile='.\Resources\Dism.exe'
InstallCondition='SetupType="1" OR SetupType="3"'
InstallCommand='/Online /Enable-Feature /FeatureName:IIS-WebServerRole'>
</ExePackage>
This works fine, but i think it would be better to use the Dism.exe which we can find in C:\Windows\System32\ on the computer to be installed and not a resource file from my own computer. So i tried this:
<ExePackage Id='IIS_WebserverRole'
DisplayName='Installing IIS: IIS-WebServerRole'
PerMachine='yes'
SourceFile='[SystemFolder]Dism.exe'
InstallCondition='SetupType="1" OR SetupType="3"'
InstallCommand='/Online /Enable-Feature /FeatureName:IIS-WebServerRole'>
</ExePackage>
[SystemFolder] is a Burn standard variable which returns per example "C:\Windows\System32\". But this doesn't work. So i tried the following one. You can find it in the first answer of this article:
Install IIS if not installed yet
<ExePackage Id='IIS_WebserverRole'
DisplayName='Installing IIS: IIS-WebServerRole'
PerMachine='yes'
SourceFile='.\Resources\run.bat'
InstallCondition='SetupType="1" OR SetupType="3"'
InstallCommand='Dism.exe /Online /Enable-Feature /FeatureName:IIS-WebServerRole'>
</ExePackage>
But even this doesn't work. I always get an error in the log file, that the executable file cannot be executed ;)
What's going wrong? Can anybody give me a hint, what to do? Thanks in advance!