Archive: How to determine .NET 3.0 installed?


How to determine .NET 3.0 installed?
Unfortunately, the script for determining .NET version does not determine .NET 3.0 (which is actually, just a few assemblies over 2.0 so that is partially correct). How to determine that a user has .NET 3.0 installed?


have you tried searching your registry, there must be some indication.. i don't have it installed, so i can't help further


One of my Installers had a similar requirement, checking to see what version of .NET MicroFrame work is/was installed, and was version 1.0.0 or higher.

You might be able to borrow some of this code for your uses:
(Obviously changing the key you need to look for)

${For} $0 0 1024
EnumRegKey $1 HKLM "SOFTWARE\Microsoft\.NETMicroFramework\" $0

${If} $1 == ""
${Break}
${EndIf}

${VersionConvert} "$1" "" $R0
${VersionConvert} "v1.0.0" "" $R1
${VersionCompare} "$R0" "$R1" $R2

${If} $R2 <= 1
StrCpy $2 "1"
${Break}
${EndIf}

${Next}


You don't need to use
${VersionConvert} "v1.0.0" "" $R1
Just put "1.0.0" in the place of $R1 for ${VersionCompare}.

Stu


Unfortunately, I cannot find any place in registry saying that 3.0 version of framework is installed. I am using the following code supposing that v3.0 sub-branch is always presenting under .NETFramework branch:


; The function checks if a computer has .NET Framework 3.0 installed
Var WinFxFound ; if .NET Framework 3.0 found
Function CheckFrameworkWinFx
StrCpy $WinFxFound 0
ReadRegStr $0 HKLM "Software/Microsoft/.NETFramework/v3.0" ""

StrCpy $0 0

loop:
EnumRegKey $1 HKLM "Software\Microsoft\.NETFramework" $0
StrCmp $1 "" done
IntOp $0 $0 + 1

${if} $1 == "v3.0"
StrCpy $WinFxFound 1
${else}
goto loop
${endif}

done:
${if} $WinFxFound == 0

${endif}
FunctionEnd