Question

How can I have Burn detect that the required .NET 4.5 framework is installed and if not notify the user prior to launching my custom UI that the install requires .NET 4.5 to run?

Without the prerequisite check my custom UI (BootStrapperApplication) will fail to load.

I do not want to install only prompt that it is missing.

Was it helpful?

Solution 2

In your Bundle.wxs file (or where ever you have the <Bundle> defined), add this:

<bal:Condition Message="Add your message here">NETFRAMEWORK40FULL</bal:Condition>

For example, I use the following message to provide a clickable link the user can use to download the needed installer:

<?define NetFx40WebLink = http://go.microsoft.com/fwlink/?linkid=182805 ?>
<bal:Condition Message="Microsoft .NET 4 Full Framework is required. Please download and install it from &lt;a href=&quot;$(var.NetFx40WebLink)&quot;&gt;$(var.NetFx40WebLink)&lt;/a&gt; then re-run this installer.">NETFRAMEWORK40FULL</bal:Condition>

And the result looks like this:

download required screenshot

OTHER TIPS

The currently accepted answer doesn't actually work, as MSI properties aren't available in a bundle.

This example checks for .NET Framework 4.6.1. Add references to the NetFxExtension and UtilExtension in your Wix tag:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" 
 xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

Define some properties indicating the .NET version you require (I found the release by trawling through this repo):

<?define NetFx461MinRelease = 394254 ?>
<?define NetFx461WebLink = http://go.microsoft.com/fwlink/?LinkId=671728 ?>

Finally, inside your bundle reference the registry check from the NetFx Extension and then perform the check manually.

<util:RegistrySearchRef Id="NETFRAMEWORK45"/>

<bal:Condition Message="This product requires .NET Framework 4.6.1, please install it from &lt;a href=&quot;$(var.NetFx461WebLink)&quot;&gt;$(var.NetFx461WebLink)&lt;/a&gt;.">
  <![CDATA[NETFRAMEWORK45 >= $(var.NetFx461MinRelease)]]>
</bal:Condition>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top