3

I've been looking to make my bootstrapper work with installing .NET 4.0 and my own application. I reviewed several blogs and tutorials, but I can't get it to work.

I read in Stack Overflow question Initiate / call bootstrapper in WiX that you need to invoke both in the bootstrapper. My bootstrapper only invokes the .NET 4.0 installer. This is the part that should invoke both parts:

<Chain>
    <PackageGroupRef Id="NetFx40Redist" />
    <MsiPackage SourceFile="C:\my app.msi" Cache="yes" Visible="no" After="NetFx40Redist"></MsiPackage>
</Chain>

It only invokes the packagegroupref. While installing the .NET 4.0 package, it gives an error. It's probably something easy and small, but I can't find it.

Community
  • 1
  • 1
linmic
  • 139
  • 2
  • 10

1 Answers1

5

The following works for me:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle Name="Bootstrapper1" Version="1.0.0.0" Manufacturer="Test" UpgradeCode="5e5f0f1e-58e0-42e5-8306-37533d677535">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
    <Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]Test\App"/>

    <Chain>
      <PackageGroupRef Id="NetFx40Web" />
      <MsiPackage
        Id="Setup"
        Compressed="yes"
        SourceFile="$(var.SetupProject1.TargetPath)"
        Vital="yes">
        <MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" />
      </MsiPackage>
    </Chain>
  </Bundle>
</Wix>

Make sure you add your project and WixNetFxExtension as references to the bootstrapper project. I found this blog very helpful.

pmdarrow
  • 734
  • 5
  • 14
  • thanks for the tip. i added the wixnetfxexstansion but it say's it can't find the exe file – linmic Nov 07 '12 at 09:03
  • I'm not quite sure what you mean. What is "it" you're referring to? And what exe file are you referring to? The full error message would be helpful. – pmdarrow Nov 22 '12 at 00:40
  • This code in the answer.. where does it go? Is it in the wix project file, a wxi, or the main wxs? – Stealth Rabbi May 03 '13 at 12:54