The code below, which uses GetDLLVersion, returns "2.8.0.0"
The Winamp.exe file it was run on IS the desired version (2.81).
What can I use to get the exact minor version?
I can see the string "2.81" within the .exe file, but how do I retrieve it with NSIS?
;-----------------
Function GetDLLVer
;-----------------
; Returns DLL version of specified .exe file (e.g. Winamp.exe)
; Adapted from:
; http://www.clantpa.co.uk/nsis/wiki/i...mmandExplained
; Inputs: Stack 0 = Full pathname of .exe file
; Output: Stack 0 = string of form "1.2.0.192" (major.minor.release.build)
; Usage:
; Push $0 ; (where $0 contains pathname of .exe file)
; Call GetDLLVer
; Pop $0 ; (now contains version string)
Exch $0 ; $0 now has pathname of .exe file
Push $R0
Push $R1
Push $1
Push $2
Push $3
Push $4
GetDllVersion "$0" $R0 $R1
IntOp $1 $R0 / 0x00010000 ; $1 now = major version
IntOp $2 $R0 & 0x0000FFFF ; $2 now = minor version
IntOp $3 $R1 / 0x00010000 ; $3 now = release
IntOp $4 $R1 & 0x0000FFFF ; $4 now = build
StrCpy $0 "$1.$2.$3.$4" ; $0 now = string of form "1.2.0.192"
Pop $4
Pop $3
Pop $2
Pop $1
Pop $R1
Pop $R0
Exch $0 ; result is now in stack 0
FunctionEnd ; (GetDLLVer) =============