5
votes

I am trying to use Burn and WIX 3.6 to make an installer for my app. The installer must be capable of installing .NET 3.5 SP1 from Microsoft's web site. I am working from a working WIX project created with WIX 3.5. It works, if .NET 3.5 SP1 has been previously installed on the target machine. The first step appears to be to create a bundle, so I added a element to my Product.wxs file. When I do that I get an error saying that the is not valid in the schema, I must have a instead. Does that mean that I have to transfer all the product definitions into a fragment? It's unclear how I do that. Then the thing gets more complicated, since WixNetfxExtension only provides PackageRef for .NET 4.0 and 4.5. I am not ready to switch my app to that version of the framework. SO how do I get .NET 3.5 SP1 from a web source in my bundle?

Is there a working example of doing this anywhere?

1

1 Answers

11
votes

It's unclear in your question where you are trying to do stuff so I'll just start from the beginning.

Create a new Wix burn bootstrapper project. This is where your dependencies will be installed and then your existing Wix 3.5 installer will be spawned from.

Download the .net 3.5 SP1 full package and take note of the direct url used to download it.

Using heat.exe (in the wix 3.6 bin dir) run the following command which will generate a WXS file with the details of the .net installer.

heat.exe payload [path_to_net_installer] -o [path_to_wxs]

this.will give you following in a wxs:

<RemotePayload CertificatePublicKey="F321408E7C51F8544B98E517D76A8334052E26E8"
               CertificateThumbprint="D57FAC60F1A8D34877AEB350E83F46F6EFC9E5F1" 
               Description=".NET Framework 3.5 Setup"
               Hash="3DCE66BAE0DD71284AC7A971BAED07030A186918" 
               ProductName=".NET Framework 3.5" 
               Size="242743296" 
               Version="3.5.30729.1" />

Add this into in your bootstrapper project as a child of an ExePackage element and update the element with your download url saved earlier. This will automatically download the .net installer or you can place it next to the bootstrapper exe and it will detect it.

Create a chain in the Bundle that contains the .net ExePackage and a MsiPackage for your installer. You will then end up with something like (a lot of the required attributes I'll leave you to fill in!):

 <Bundle Name="$(var.SkuName)"
         Copyright="$(var.Copyright)"
         Manufacturer="$(var.Manufacturer)"
         Version="$(var.ProductVersion)"
         UpgradeCode="$(var.UpgradeCode)">
     <Chain>
         <ExePackage Id="dotNetFX3.5">
             <RemotePayload />
         </ExePackage>
         <MsiPackage Id="MyMsi" />
     </Chain>
  </Bundle>

Build and you should then have a big exe with your msi included or if you choose to not compress it an exe that executes your msi (it will need to be in the same folder).