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!
Here is some WIX code for quick fix
run64.bat: I wonder why it requires both lines to trick the File System Redirector
InstallIIS.wxs: replace run.bat for platform specific batch
Try the following CustomAction Code:-
@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:
Or,
When you try to run the 32-bit dism on and 64-bit OS, you will get this error
My solution is creating another WiX installer project "InstallPrerequisites" and run the 64-bit dism with "QtExec64CmdLine" . Here is an example:
I use answer file to include all the features, so we can enable them all at one time. And then chain the installer
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.
Based on Harbinder Singh's answer, here's my solution:
The
run.bat
file is a simple text file, containing%*
.This solution only works on Windows 7, or higher, 'cause the
dism.exe
is not part of the Windows before version 7.