.NET Framework detection function added

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2101 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-02-02 16:49:34 +00:00
parent 1b77b3b4ae
commit 58866a44df

View file

@ -261,6 +261,66 @@
\c Exch $R0
\c FunctionEnd
\H{detect.netframework} Is .NET Framework installed?
\c ; IsDotNETInstalled
\c ;
\c ; Usage:
\c ; Call IsDotNETInstalled
\c ; Pop $0
\c ; StrCmp $0 1 found.NETFramework no.NETFramework
\c
\c Function IsDotNETInstalled
\c Push $0
\c Push $1
\c Push $2
\c Push $3
\c Push $4
\c
\c ReadRegStr $4 HKEY_LOCAL_MACHINE \
\c "Software\Microsoft\.NETFramework" "InstallRoot"
\c # remove trailing back slash
\c Push $4
\c Exch $EXEDIR
\c Exch $EXEDIR
\c Pop $4
\c # if the root directory doesn't exist .NET is not installed
\c IfFileExists $4 0 noDotNET
\c
\c StrCpy $0 0
\c
\c EnumStart:
\c
\c EnumRegKey $2 HKEY_LOCAL_MACHINE \
\c "Software\Microsoft\.NETFramework\Policy" $0
\c IntOp $0 $0 + 1
\c StrCmp $2 "" noDotNET
\c
\c StrCpy $1 0
\c
\c EnumPolicy:
\c
\c EnumRegValue $3 HKEY_LOCAL_MACHINE \
\c "Software\Microsoft\.NETFramework\Policy\$2" $1
\c IntOp $1 $1 + 1
\c StrCmp $3 "" EnumStart
\c IfFileExists "$4\$2.$3" foundDotNET EnumPolicy
\c
\c noDotNET:
\c StrCpy $0 0
\c Goto done
\c
\c foundDotNET:
\c StrCpy $0 1
\c
\c done:
\c Pop $4
\c Pop $3
\c Pop $2
\c Pop $1
\c Exch $0
\c FunctionEnd
\H{isflashinstalled} Is Macromedia Flash Player installed?
\c ; IsFlashInstalled