title: A complete WiX 3.6 bundle example bootstrapping a .NET 4 Client Profile
body: <p>I tried to construct a working example of a WiX 3.6 installation script. We currently use WiX 3.5 and now we would like to begin installing the <a href="http://msdn.microsoft.com/en-us/library/cc656912.aspx" rel="noreferrer">.NET 4 Client Profile framework</a> as a pre-requisite for our <a href="http://en.wikipedia.org/wiki/Windows_Installer" rel="noreferrer">MSI</a> file that our <code>product.wxs</code> script creates. WiX 3.6 seems like the best way forward.</p>
  
  <p>Is there a functional example of how to do this with WiX 3.6?</p>
  
  <p>Here is our 3.5 script we use today:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
       xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"&gt;
  
      &lt;!-- Version change handling --&gt;
      &lt;?define UpgradeCode="###############################"?&gt;
      &lt;?ifdef env.BUILD_NUMBER ?&gt;
      &lt;?define ProductVersion="2.6.$(env.BUILD_NUMBER).0"?&gt;
      &lt;?else ?&gt;
      &lt;?define ProductVersion="2.6.0.0"?&gt;
      &lt;?endif ?&gt;
  
      &lt;Product Id="*" Name="###############################" Language="1033" Version="$(var.ProductVersion)" Manufacturer="###############################" UpgradeCode="$(var.UpgradeCode)"&gt;
          &lt;Package InstallerVersion="200" Compressed="yes" /&gt;
  
          &lt;!-- Custom actions for this installer --&gt;
          &lt;Binary Id="###############################.dll" SourceFile="..\..\Libraries\###############################.CA.dll" /&gt;
  
          &lt;!-- Kill ##### before installation begins --&gt;
          &lt;CustomAction Id="Kill#####ActionId" BinaryKey="###############################.dll" DllEntry="Kill#####Action" Execute="immediate" Impersonate="yes" Return="check" /&gt;
          &lt;InstallExecuteSequence&gt;
              &lt;Custom Action="Kill#####ActionId" Before="InstallInitialize" /&gt;
          &lt;/InstallExecuteSequence&gt;
  
          &lt;!-- ADD/REMOVE Programs icon --&gt;
          &lt;Icon Id="##############.ico" SourceFile="D:\##############\Input_WIX\NonHeat\##############.exe" /&gt;
          &lt;Property Id="ARPPRODUCTICON" Value="##############.ico" /&gt;
          &lt;Property Id="ARPHELPLINK" Value="http://##############" /&gt;
  
          &lt;!-- EULA agreement --&gt;
          &lt;WixVariable Id="WixUILicenseRtf" Value="D:\##############\Input_WIX\Heat\License.rtf" /&gt;
  
          &lt;!-- Installer images --&gt;
          &lt;WixVariable Id="WixUIBannerBmp" Value="InstallerTopImage.rle" /&gt;
          &lt;WixVariable Id="WixUIDialogBmp" Value="InstallerSideImage.rle" /&gt;
          &lt;UIRef Id="WixUI_Minimal" /&gt;
          &lt;Upgrade Id="$(var.UpgradeCode)"&gt;
              &lt;UpgradeVersion Minimum="1.0.0.0" Maximum="99.0.0.0" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" /&gt;
          &lt;/Upgrade&gt;
  
          &lt;!-- Require ##### to be installed --&gt;
          &lt;Property Id="#####4.INSTALLPATH"&gt;
              &lt;RegistrySearch Id="RegistryFoundInstallPath" Key="SOFTWARE\McNeel\#####ceros\4.0" Root="HKLM" Name="InstallPath" Type="directory" /&gt;
          &lt;/Property&gt;
          &lt;Property Id="#####4.RECENT"&gt;
              &lt;RegistrySearch Id="RegistryFoundMostRecent" Key="SOFTWARE\McNeel\#####ceros\4.0" Root="HKLM" Name="MostRecent" Type="raw" /&gt;
          &lt;/Property&gt;
          &lt;Property Id="VRAYCOMMONDIR"&gt;
              &lt;RegistrySearch Id="ReigstryVRayCommon" Key="Software\ASGvis" Root="HKLM" Name="Common_dir" Type="raw" /&gt;
          &lt;/Property&gt;
          &lt;Condition Message="##### 4 required before install"&gt;
              #####4.RECENT
          &lt;/Condition&gt;
  
          &lt;!-- Require administrator priveleges --&gt;
          &lt;Condition Message="You need to be an administrator to install this product."&gt;
              Privileged&lt;/Condition&gt;
  
          &lt;!-- Require .NET 3.5 SP1 to install --&gt;
          &lt;PropertyRef Id="NETFRAMEWORK35_SP_LEVEL" /&gt;
          &lt;Condition Message='This setup requires the .NET Framework 3.5 with Service Pack 1 be installed.'&gt;
              &lt;![CDATA[Installed OR (NETFRAMEWORK35_SP_LEVEL AND NETFRAMEWORK35_SP_LEVEL = "#1")]]&gt;
          &lt;/Condition&gt;
  
          &lt;Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /&gt;
  
          &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
              &lt;Directory Id="#####4.INSTALLPATH"&gt;
                  &lt;Directory Id="#####4.SYSTEM" Name="System"&gt;&lt;/Directory&gt;
              &lt;/Directory&gt;
  
              &lt;Directory Id="ProgramFilesFolder"&gt;
                  &lt;Directory Id="INSTALLLOCATION" Name="##############"&gt;&lt;/Directory&gt;
                  &lt;Directory Id="DesktopFolder" Name="Desktop" /&gt;
                  &lt;Directory Id="ProgramMenuFolder"&gt;
                      &lt;Directory Id="ProgramMenuDir" Name="##############" /&gt;
                  &lt;/Directory&gt;
              &lt;/Directory&gt;
  
              &lt;!-- Set FULL permissions to our shared folders --&gt;
              &lt;Directory Id="CommonAppDataFolder"&gt;
                  &lt;Directory Id="CommonApp##############" Name="##############"&gt;
                      &lt;Directory Id="MODELLIBPATH" Name="##############"&gt;
                          &lt;Component Id="##############UserPermissions" Guid="##############"&gt;
                              &lt;CreateFolder&gt;
                                  &lt;util:PermissionEx GenericRead="yes" GenericWrite="yes" GenericExecute="yes" Delete="yes" DeleteChild="yes" User="Users" Domain="[MachineName]" /&gt;
                              &lt;/CreateFolder&gt;
                          &lt;/Component&gt;
                      &lt;/Directory&gt;
                      &lt;Directory Id="APPDATAPATH" Name="#####"&gt;
                          &lt;Component Id="##############UserPermissions" Guid="FC4BF85F-E7A4-45DE-B25C-8F9419E75307"&gt;
                              &lt;CreateFolder&gt;
                                  &lt;util:PermissionEx GenericRead="yes" GenericWrite="yes" GenericExecute="yes" Delete="yes" DeleteChild="yes" User="Users" Domain="[MachineName]" /&gt;
                              &lt;/CreateFolder&gt;
                          &lt;/Component&gt;
                      &lt;/Directory&gt;
                  &lt;/Directory&gt;
              &lt;/Directory&gt;
  
              &lt;Directory Id="FontsFolder"&gt;&lt;/Directory&gt;
              &lt;Component Id="##############RegistryKeys" Guid="17A55BEA-605D-425a-AAEE-F35EC8C1061E" DiskId="1" KeyPath="yes"&gt;
                  &lt;RegistryValue Id="##############RegInstallDir" Root="HKLM" Key="Software\##############\##############" Name="InstallPath" Action="write" Type="string" Value="[INSTALLLOCATION]" /&gt;
                  &lt;RegistryValue Id="##############RegLibraryPath" Root="HKLM" Key="Software\##############\##############" Name="LibraryPath" Action="write" Type="string" Value="[INSTALLLOCATION]Library" /&gt;
                  &lt;RegistryValue Id="##############RegModelLibraryPath" Root="HKLM" Key="Software\##############\##############" Name="ModelLibraryPath" Action="write" Type="string" Value="[MODELLIBPATH]" /&gt;
                  &lt;RegistryKey Id="##############Reg#####PluginKey" Root="HKLM" Key="Software\McNeel\#####ceros\4.0\[#####4.RECENT]\Plug-ins\FCAF502A-1572-42a9-A2C3-F25D7953B1A5\PlugIn" Action="create" /&gt;
                  &lt;RegistryValue Id="##############RegName#####4" Root="HKLM" Key="Software\McNeel\#####ceros\4.0\[#####4.RECENT]\Plug-ins\FCAF502A-1572-42a9-A2C3-F25D7953B1A5" Name="Name" Action="write" Type="string" Value="##############Server" /&gt;
                  &lt;RegistryValue Id="##############Reg#####4" Root="HKLM" Key="Software\McNeel\#####ceros\4.0\[#####4.RECENT]\Plug-ins\FCAF502A-1572-42a9-A2C3-F25D7953B1A5" Name="FileName" Action="write" Type="string" Value="[INSTALLLOCATION]##############\##############Server.rhp" /&gt;
                  &lt;RemoveRegistryKey Id="##############Skin" Root="HKLM" Key="Software\McNeel\#####ceros\4.0\Scheme: ##############" Action="removeOnInstall" /&gt;
              &lt;/Component&gt;
              &lt;Component Id="VRayKeys" Guid="{96E9EBAC-48B4-4517-9409-F921BE92B3AA}" DiskId="1" KeyPath="yes" NeverOverwrite="yes"&gt;
                  &lt;RegistryValue Id="VRayKey" Root="HKLM" Key="Software\##############\Data" Name="Data" Action="write" Type="string" Value="FFFAAA" /&gt;
              &lt;/Component&gt;
              &lt;Component Id="VRayRegistryKeys" Guid="{4D8815FA-85E2-421f-8BF9-F7F5A4133E96}" DiskId="1" KeyPath="yes" NeverOverwrite="yes" Permanent="yes"&gt;
                  &lt;Condition&gt;
                      NOT VRAYCOMMONDIR
                  &lt;/Condition&gt;
                  &lt;RegistryValue Root="HKLM" Key="Software\ASGvis" Name="common_dir" Action="write" Type="string" Value="[INSTALLLOCATION]VRay\ASGVIS" /&gt;
              &lt;/Component&gt;
          &lt;/Directory&gt;
          &lt;Feature Id="##############Features" Title="#####" Level="1"&gt;
              &lt;ComponentGroupRef Id="##############" /&gt;
              &lt;ComponentRef Id="##############LibraryUserPermissions" /&gt;
              &lt;ComponentRef Id="##############SharedUserPermissions" /&gt;
              &lt;ComponentRef Id="##############RegistryKeys" /&gt;
              &lt;ComponentRef Id="VRayRegistryKeys" /&gt;
              &lt;ComponentRef Id="VRayKeys" /&gt;
              &lt;ComponentRef Id="ProgramMenuShortcuts" /&gt;
              &lt;ComponentRef Id="#####App" /&gt;
              &lt;ComponentRef Id="WixShortCut" /&gt;
              &lt;ComponentRef Id="##############ShortCut" /&gt;
              &lt;ComponentRef Id="TroubleShortCut" /&gt;
              &lt;ComponentRef Id="DesktopShortcut" /&gt;
              &lt;ComponentRef Id="VRayAuth" /&gt;
              &lt;ComponentRef Id="Fonts" /&gt;
          &lt;/Feature&gt;
          &lt;InstallExecuteSequence&gt;
              &lt;RemoveExistingProducts Before="InstallInitialize" /&gt;
          &lt;/InstallExecuteSequence&gt;
          &lt;UI /&gt;
      &lt;/Product&gt;
  
      &lt;Fragment&gt;
          &lt;Icon Id="ShortCutIcon" SourceFile="D:\##############Stage\Input_WIX\NonHeat\##############.exe" /&gt;
          &lt;Icon Id="TroubleShooterIcon" SourceFile="D:\##############Stage\Input_WIX\Heat\TroubleShooter\TroubleShooter.exe" /&gt;
          &lt;Icon Id="TeamViewerIcon" SourceFile="D:\##############Stage\Input_WIX\Heat\support.exe" /&gt;
          &lt;DirectoryRef Id="ProgramFilesFolder"&gt;
              &lt;Component Id="ProgramMenuShortcuts" Guid="881BD571-4FAF-4aa4-AB6E-15BB1629BE06"&gt;
                  &lt;CreateFolder Directory="ProgramMenuDir" /&gt;
                  &lt;RemoveFolder Id="RemoveMenuShortcuts" Directory="ProgramMenuDir" On="uninstall" /&gt;
                  &lt;RegistryValue Root="HKCU" Key="Software\##############\##############ShortCut" Name="InstalledStartMenuShortcuts" Type="integer" Value="1" /&gt;
              &lt;/Component&gt;
          &lt;/DirectoryRef&gt;
          &lt;!-- This file is not Heat'ed, so we need this to install the executable --&gt;
          &lt;DirectoryRef Id="INSTALLLOCATION" FileSource="Files"&gt;
              &lt;Component Id="##############App" Guid="FA41A015-7D80-4e50-A909-94BBA4D7546A"&gt;
                  &lt;File Id="#####_Executable" Vital="yes" Source="D:\##############Stage\Input_WIX\NonHeat\##############.exe" /&gt;
              &lt;/Component&gt;
          &lt;/DirectoryRef&gt;
          &lt;DirectoryRef Id="INSTALLLOCATION" FileSource="Files"&gt;
              &lt;Component Id="WixShortCut" Guid="{8F2596B8-B7EC-4f40-AD64-DFC182A9353A}"&gt;
                  &lt;RegistryKey Root="HKCU" Key="Software\##############\##############ShortCut" Action="create"&gt;
                      &lt;RegistryValue Name="ShortCut" Value="1" Type="integer" KeyPath="yes" /&gt;
                  &lt;/RegistryKey&gt;
                  &lt;Shortcut Id="ProgramMenuApplicationShortcut" Name="##############" Target="[###############_Executable]" Directory="ProgramMenuDir" Show="normal" Icon="ShortCutIcon" /&gt;
              &lt;/Component&gt;
          &lt;/DirectoryRef&gt;
          &lt;DirectoryRef Id="INSTALLLOCATION"&gt;
              &lt;Component Id="TroubleShortCut" Guid="{9E960528-8798-41DD-8DEE-9C3336CD3C88}"&gt;
                  &lt;RegistryKey Root="HKCU" Key="Software\#####\#####ShortCut" Action="create"&gt;
                      &lt;RegistryValue Name="ShortCut2" Value="1" Type="integer" KeyPath="yes" /&gt;
                  &lt;/RegistryKey&gt;
                  &lt;Shortcut Id="TroubleshooterStartmenuShortcut" Name="Troubleshooter" Target="[INSTALLLOCATION]TroubleShooter\TroubleShooter.exe" Directory="ProgramMenuDir" Icon="TroubleShooterIcon" Show="normal"&gt;&lt;/Shortcut&gt;
              &lt;/Component&gt;
          &lt;/DirectoryRef&gt;
          &lt;DirectoryRef Id="INSTALLLOCATION"&gt;
              &lt;Component Id="TeamViewerShortCut" Guid="{AD99CAC6-E485-444B-B075-2FD8BE4C87A8}"&gt;
                  &lt;RegistryKey Root="HKCU" Key="Software\#####\#####ShortCut" Action="create"&gt;
                      &lt;RegistryValue Name="ShortCut3" Value="1" Type="integer" KeyPath="yes" /&gt;
                  &lt;/RegistryKey&gt;
                  &lt;Shortcut Id="TeamviewerStartmenuShortcut" Name="Remote Assistance" Target="[INSTALLLOCATION]support.exe" Directory="ProgramMenuDir" Icon="TeamViewerIcon" /&gt;
              &lt;/Component&gt;
          &lt;/DirectoryRef&gt;
          &lt;DirectoryRef Id="INSTALLLOCATION" FileSource="Files"&gt;
              &lt;Component Id="DesktopShortcut" Guid="{EA9632D1-08ED-4257-A78F-B2373A65A5CF}"&gt;
                  &lt;RegistryKey Root="HKCU" Key="Software\#####\##############ShortCut" Action="createAndRemoveOnUninstall"&gt;
                      &lt;RegistryValue Name="desktopShortcut" Value="1" Type="integer" KeyPath="yes" /&gt;
                  &lt;/RegistryKey&gt;
                  &lt;Shortcut Id="DesktopShortcut" Directory="DesktopFolder" Name="#####" Icon="ShortCutIcon" Target="[######_Executable]" /&gt;
              &lt;/Component&gt;
          &lt;/DirectoryRef&gt;
          &lt;DirectoryRef Id="FontsFolder"&gt;
              &lt;Component Id="Fonts" Guid="{8C8EE16C-92B6-4926-A41C-55B79429071C}" NeverOverwrite="yes"&gt;
                  &lt;File Id="bradley" Source="Fonts\bradhitc.ttf" TrueType="yes" /&gt;
              &lt;/Component&gt;
          &lt;/DirectoryRef&gt;
      &lt;/Fragment&gt;
      &lt;Fragment&gt;
          &lt;DirectoryRef Id="#####4.SYSTEM"&gt;
              &lt;Component Id="VRayAuth" Guid="{ABED80D1-6EBA-48db-83E0-7CF48B0A55E8}"&gt;
                  &lt;File Id="VRayAuthFile" KeyPath="yes" Source="..\..\Libraries\VRayAuth.dll" /&gt;
              &lt;/Component&gt;
          &lt;/DirectoryRef&gt;
      &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>