MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: MSIINSTALLPERUSER[Next]: MsiSystemRebootPending
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Windows Installer FAQ (the basics)->Properties->Specific Properties->MsiNetAssemblySupport

MsiNetAssemblySupport

This property will contain the highest level of the dot net framework available on the system or will not be defined if no .net framework is installed.

Because this property is not perfect (for example you can't tell if a specific framework is installed) and that it can fail you should also see the ".NET Framework Installed?" section.

Please see Microsoft's online documentation for the "MsiNetAssemblySupport" property (or "MSI.CHM") for more information.

My Attempt to test for .NET 3.5

A "custom action" would be better at processing the property but this is my attempt at a pure windows Installer solution:

;--- Some constants ----
#define MSG_MIN_.NET_VER       3.5
#define MSG_HOW_TO_GET_.NET    Please download from Microsoft's site and install it before installing media companion.
#define MSG_NO_.NET            [ProductName] needs at least the <$MSG_MIN_.NET_VER> version of the .NET framwork but you don't have any installed. <$MSG_HOW_TO_GET_.NET>
#define MSG_OLDER_.NET         [ProductName] needs at least the <$MSG_MIN_.NET_VER> version of the .NET framwork but you only have [MsiNetAssemblySupport] installed. <$MSG_HOW_TO_GET_.NET>


;--- Check for non-existance of any and then versions we don't want ----
#define Highest.NetVerShouldntStartWith \       ;;Note that "MsiNetAssemblySupport" contains the HIGHEST framework version
        <$AbortIf Message="<$MSG_OLDER_.NET>" CONDITION=^(<$CONDITION_INSTALL_ONLY>) and MsiNetAssemblySupport and MsiNetAssemblySupport << "{$#1}."^>
<$AbortIf Message="<$MSG_NO_.NET>" CONDITION=^(<$CONDITION_INSTALL_ONLY>) and not MsiNetAssemblySupport^>
<$Highest.NetVerShouldntStartWith "1">
;<$Highest.NetVerShouldntStartWith "2">      ;;Can't do see: http://makemsi-manual.dennisbareis.com/msinetassemblysupport_property_can_contain_the_wrong_value.htm
;<$Highest.NetVerShouldntStartWith "3.0">    ;;Same Issue

As Windows Installer unexpectedly returned a "2.0..." value instead of a "3.5.." one we couldn't abort if the property started with "2." or "3.0." so the example only aborts if the highest framework reported is "1." or no framework is detected.


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: MSIINSTALLPERUSER[Next]: MsiSystemRebootPending


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday August 13 2017 at 2:39pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.