title: Installing .NET Framework from Wix
body: <p>I'm using WiX toolset v3.7 and Visual Studio 2013 to create an installer package for an Excel plugin. </p>
  
  <p>The plugin depends on .NET Framework 4.5 and I'd like the installer to automatically detect whether the required framework exists on the target machine and if not, install it.</p>
  
  <p>Googling got me to this page: <a href="http://wix.sourceforge.net/manual-wix3/install_dotnet.htm" rel="nofollow">http://wix.sourceforge.net/manual-wix3/install_dotnet.htm</a>, but the link to instructions on how to create a Bundle is broken on that page. </p>
  
  <p>I've tried adding the  element to my  root element but end up with errors. I've also tried a few examples I've found on the web but none of them seem to work properly with the default WiX manifest that was generated for me during project creation in VS2013.</p>
  
  <p><em>What do I need to add to my manifest to enable automatic installation of .NET Framework 4.5?</em></p>
  
  <p>I'd greatly appreciate any help here! My manifest is shown below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
  
    &lt;Product Id="*" Name="Awesome Excel Add-in 1.0" Language="1033" Version="1.0" Manufacturer="Farhan Ahmed" UpgradeCode="7ffd5a6d-d38e-4d6b-b554-098d95791222"&gt;
  
      &lt;Package Description="Awesome Excel Add-in Installer" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /&gt;
  
      &lt;Condition Message="You need to be an administrator to install this product."&gt;
        Privileged
      &lt;/Condition&gt;
  
      &lt;MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /&gt;
      &lt;MediaTemplate /&gt;
  
      &lt;Feature Id="ProductFeature" Title="AwesomeExcelSetup" Level="1"&gt;
        &lt;ComponentGroupRef Id="ProductComponents" /&gt;
      &lt;/Feature&gt;
  
      &lt;CustomAction Id='LaunchInstallerFile' FileKey='fAddinInstaller' ExeCommand='/I /64' Return='asyncWait' /&gt;
      &lt;CustomAction Id='LaunchRemoverFile' FileKey='fAddinInstaller' ExeCommand='/U' Return='check' /&gt;
  
      &lt;InstallExecuteSequence&gt;
        &lt;Custom Action='LaunchInstallerFile' After='InstallFinalize'&gt;NOT Installed&lt;/Custom&gt;
        &lt;Custom Action='LaunchRemoverFile' Before='RemoveFiles'&gt;Installed AND NOT REINSTALL&lt;/Custom&gt;
      &lt;/InstallExecuteSequence&gt;
  
      &lt;UI&gt;
        &lt;UIRef Id="WixUI_Minimal" /&gt;
      &lt;/UI&gt;
  
      &lt;Icon Id="icon.ico" SourceFile="$(var.AwesomeExcelAddin.TargetDir)\Awesome.ico"/&gt;
      &lt;Property Id="ARPPRODUCTICON" Value="icon.ico" /&gt;
  
    &lt;/Product&gt;
  
    &lt;Fragment&gt;
      &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
        &lt;Directory Id="ProgramFilesFolder" Name="PFiles"&gt;
          &lt;Directory Id="INSTALLPARENT" Name="Awesome" &gt;
            &lt;Directory Id="INSTALLFOLDER" Name="Excel Add-in 1.0" /&gt;
          &lt;/Directory&gt;
        &lt;/Directory&gt;
      &lt;/Directory&gt;
    &lt;/Fragment&gt;
  
    &lt;Fragment&gt;
      &lt;ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"&gt;
        &lt;Component Id="ProductComponent" Guid="DDD3F332-0DF1-47F0-B8D0-5E1E09BF69BE"&gt;
          &lt;File Id="f32bitXLL" Source="$(var.AwesomeExcelAddin.TargetDir)\AwesomeAddinPacked32.xll" /&gt;
          &lt;File Id="f64bitXLL" Source="$(var.AwesomeExcelAddin.TargetDir)\AwesomeAddinPacked64.xll" /&gt;
          &lt;File Id="fAddinDll" Source="$(var.AwesomeExcelAddin.TargetDir)\AwesomeExcelAddin.dll" /&gt;
          &lt;File Id="fAddinInstaller" Source="$(var.AwesomeExcelAddinInstaller.TargetDir)\AwesomeExcelAddinInstaller.exe" /&gt;
        &lt;/Component&gt;
      &lt;/ComponentGroup&gt;
    &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>