2

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!

Community
  • 1
  • 1
Patrick Pirzer
  • 1,649
  • 3
  • 22
  • 49
  • Did you try changing this SourceFile='[SystemFolder]Dism.exe' to SourceFile='[SystemFolder]\Dism.exe'? Add back slash before exe name. – Pankaj Kapare Jan 20 '15 at 15:24

1 Answers1

0

Use [System64Folder]dism.exe instead

--- EDIT ---

https://github.com/wixtoolset/issues/issues/5307

As mentioned above, the directory that WiX points to with property [SystemFolder] has been updated.

Unless [System64Folder] is being used, in 64 bit operating system, [SystemFolder] will point to C:\Windows\SysWow64 not C:\Window\System32 where 64 bit version of dism.exe resides.

This question was asked before the change, but it was confusing to me when I arrived to this page, so thought it would be worth mentioning.

Shintaro Takechi
  • 1,215
  • 1
  • 17
  • 39
  • 1
    Can you expand on why this helps the OP? Short answers tend to be less useful than longer ones that have some explanation of how they're better. – user1118321 Dec 09 '17 at 17:16