Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX installs .NET 4.5 on a machine with .NET 3.5, but not on a machine with .NET 4.0

Tags:

.net

wix

I've created a WiX installer which I want to install .NET 4.5 if it is missing.

To do this, I've added <PackageGroupRef Id="NetFx45Web" /> to my chain.

The strange problem I have is, on a machine with .Net 3.5 (Windows Vista), everything works fine and WiX installs .NET 4.5 correctly, but on a machine with .NET 4.0 (Windows 7), nothing happens and the installer just executes my application without installing .NET 4.5 first, which then crashes because it requires .NET 4.5

Is there anything I'm missing or is this a bug?

like image 223
Flagbug Avatar asked Apr 22 '14 14:04

Flagbug


2 Answers

I assume that you're using the NetFx45Web package from the NetFxExtension, which means you're using WiX's built in way of detecting it.

I'm guessing that by application, you mean your managed BA. You have to make sure you setup your BootstrapperCore.config properly. If your MBA needs 4.5 or later, then make sure the supportedRuntime element has 4.5 and not 4, same with the supportedFramework element.

like image 88
Sean Hall Avatar answered Oct 13 '22 07:10

Sean Hall


If you're using a managed Bootstrapper Application then you should make sure that the supportedFramework set in the BA is the same as the supported framework of your actual application. Specifically, if your application requires the Full .Net 4.5 version then make sure you do not have the Client Profile version set as a supported framework otherwise the BA will not download and install the Full version if it finds the Client Profile installed. I personally think this is a bug in the managed BA however it was reported to WiX and closed as "notabug". So, remove this from you BootstrapperCore.config:

<supportedFramework version="v4.5\Client" />
like image 27
kjbartel Avatar answered Oct 13 '22 07:10

kjbartel