Skip to content
⌘ NSIS Forum Archive

How to determine the installed version .NET Framework 4 - 4.5 ?

4 posts

stass#

How to determine the installed version .NET Framework 4 - 4.5 ?

How to determine the installed version .NET Framework 4 - 4.5 ?
Information in http://nsis.sourceforge.net/Get_.NET_Version obsolete.

Function GetCORVersion - does not work ...
System::Call "mscoree::GetCORVersion(w .r0, i ${NSIS_MAX_STRLEN}, *i) i .r1 ?u"

Although http://msdn.microsoft.com/en-us/libr...v=vs.110).aspx said:
.NET Framework Versions: 4.5, 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0

How to solve the problem using the System plugin ?
Afrow UK#
!macro _DotNet4Installed _a _b _t _f
!insertmacro _LOGICLIB_TEMP
ReadRegDWORD $_LOGICLIB_TEMP HKLM `Software\Microsoft\NET Framework Setup\NDP\v4\Full` Install
StrCmp $_LOGICLIB_TEMP 1 `${_t}`
ReadRegDWORD $_LOGICLIB_TEMP HKLM `Software\Microsoft\NET Framework Setup\NDP\v4\Client` Install
StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}`
!macroend
!define DotNet4Installed `"" DotNet4Installed ""`
${If} ${DotNet4Installed}

Stu
Afrow UK#
I have not checked, but as the MSDN page says, GetCORVersion is deprecated from .NET 4.0 upwards. Checking the registry is the recommended solution.

Stu