Archive: How to detect GDI+ runtime installed


How to detect GDI+ runtime installed
Help...


Maybe simply find gdiplus.dll-library on a computer.


I find the dll at D:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.100.0_x-ww_0D1F9F94 .
But I don't same as all computer.


Hola Bluenet

What about this function?

; Usage:
; Call GdiLookingFor
; Pop $R0
; At this moment $R0 is : "" (gdiplus.dll not found) or "Name of the directory" (gdiplus.dll found)

Function GdiLookingFor

!define BASE_DIR $WINDIR\WinSxS
!define FILE_GDI gdiplus.dll

Push $R1
Push $R0
FindFirst $R0 $R1 "${BASE_DIR}\*.*"

StrCmp $R1 "" done
loop:
StrCmp $R1 "" done
StrCmp $R1 "." next
StrCmp $R1 ".." next
IfFileExists "${BASE_DIR}\$R1\${FILE_GDI}" done next

next:
FindNext $R0 $R1

Goto loop

done:
; R1 have the name of the directory
FindClose $R0
Exch
Pop $R0
Exch $R1


FunctionEnd



!define PRODUCT "gdiplus"

Name ${PRODUCT}
OutFile ${PRODUCT}.exe
ShowInstDetails show
XPStyle on

Function .onInit
MSIBanner::Show /NOUNLOAD "Reading GDI+"
System::Call 'kernel32::LoadLibrary(t "gdiplus.dll") i .r1'
MSIBanner::Update /NOUNLOAD "Lookin with system plugin"
Sleep 1000
StrCmp $1 "" NoFoundIt FoundIt

FoundIt:
StrCpy $2 "Found it"
System::Call 'kernel32::FreeLibrary(i $1)'
goto Exit

NoFoundIt:
StrCpy $2 "No Found it"

Exit:
MSIBanner::Update /NOUNLOAD "Finishing..."
Sleep 1000
FunctionEnd

Section
MSIBanner::Destroy
DetailPrint $2
SectionEnd

LoadLibrary.... easier ;)