From 58866a44dfe8164bc73e7d7d1d32a4f8ff218f70 Mon Sep 17 00:00:00 2001 From: kichik Date: Sun, 2 Feb 2003 16:49:34 +0000 Subject: [PATCH] .NET Framework detection function added git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2101 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/usefulfunc.but | 60 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/Docs/src/usefulfunc.but b/Docs/src/usefulfunc.but index bbdf4f1f..9ffa6068 100644 --- a/Docs/src/usefulfunc.but +++ b/Docs/src/usefulfunc.but @@ -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