I've a project using IIS, and I want to create an installer for it with Wix. I've created the .msi installer for the app successfully, and I'm creating a Bundle installer for it, which will install the prerequisites and after that my application.
Here's the Bundle's code:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="Bootstrapper" Version="1.0.0.0" Manufacturer="VilmosNagy" UpgradeCode="844c755f-f02b-4dd3-8b9c-af2498f3128c">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<PackageGroupRef Id="NetFx45Web"/>
<PackageGroupRef Id="SQLServerExpress"/>
<!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
</Chain>
</Bundle>
</Wix>
My question is, how can I install (or enable?) the IIS, IF not installed?
Thanks!
@Nagy Vilmos, your solution won't work on 64-bit OS. Burn is 32-bit program. It will launch the 32-bit "dism.exe", even if you want it to run the 64-bit dism by giving full path "C:\Windows\System32\dism.exe" on 64-bit OS. That is caused by "File System Redirector".
The dism's log will tell you it's 32-bit or 64-bit. Open file "C:\Windows\Logs\DISM\dism.log" you will find information like this:
Host machine information: OS Version=6.1.7600, Running architecture=x86
Or,
Host machine information: OS Version=6.1.7600, Running architecture=amd64
When you try to run the 32-bit dism on and 64-bit OS, you will get this error
Error: 11 You cannot service a running 64-bit operating system with a 32-bit version of DI SM. Please use the version of DISM that corresponds to your computer's architecture. The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
My solution is creating another WiX installer project "InstallPrerequisites" and run the 64-bit dism with "QtExec64CmdLine" . Here is an example:
<!--1.You need to use the x64 version of quiet command line
2.[System64Folder] is also needed. If not, QtExec64CmdLine will find a 32-bit dism.exe to run.
-->
<Property Id="QtExec64CmdLine" Value='"[System64Folder]dism.exe" /Online /Apply-Unattend:[ProductTmpFolder]iis_unattend.xml'/>
<CustomAction Id="SilentLaunch" BinaryKey="WixCA" DllEntry="CAQuietExec64" Execute="immediate" Return="check" />
I use answer file to include all the features, so we can enable them all at one time. And then chain the installer
<MsiPackage DisplayName="Install Prerequisites" SourceFile="$(var.InstallPrerequisites.TargetPath)" />
Update: By using "C:\windows\SysNative\dism.exe", I can now avoid a separate project for x64 platform. From the log, you can see the 32 bit process is now running 64-bit DISM.
2015-10-26 16:28:07, Info DISM DISM.EXE: <----- Starting Dism.exe session ----->
2015-10-26 16:28:07, Info DISM DISM.EXE:
2015-10-26 16:28:07, Info DISM DISM.EXE: Host machine information: OS Version=6.1.7601, Running architecture=amd64, Number of processors=4
2015-10-26 16:28:07, Info DISM DISM.EXE: Executing command line: C:\windows\SysNative\dism.exe
2015-10-26 16:28:07, Info DISM DISM Provider Store: PID=2000 Getting the collection of providers from a local provider store type. - CDISMProviderStore::GetProviderCollection
....
2015-10-26 16:28:09, Info DISM DISM.EXE: Image session has been closed. Reboot required=no.
2015-10-26 16:28:09, Info DISM DISM.EXE:
2015-10-26 16:28:09, Info DISM DISM.EXE: <----- Ending Dism.exe session ----->