Archive: retrieve Winamp version in NSIS installer script


retrieve Winamp version in NSIS installer script
I use the great NSIS installer system to pack my plug-in. With the new 2.9x Winamp and some new API calls it cannot be used with older Winamp installations (<2.90). So I need to prevent the installation on older WA versions.

Question: Is there a way to retrieve the currently installed Winamp version with the NSIS installer?

I was searching the winamp.ini and the registry for an entry but without success. Any ideas?

Thanks!


Moved this over to the NSIS forum.


You can use GetDLLVersion to get the version of Winamp.exe and compare that to the minimum version that you need.


Great, thank you!

It's a bit tricky to get a readable output but I found something in the NSIS forums.

Finally I used the following script:

  GetDLLVersion "$INSTDIR\winamp.exe" $R0 $R1
IfErrors error
IntOp $R2 $R0 / 0x00010000 ; $R2 now contains major version
IntOp $R3 $R0 & 0x0000FFFF ; $R3 now contains minor version
IntOp $R4 $R1 / 0x00010000 ; $R4 now contains release
IntOp $R5 $R1 & 0x0000FFFF ; $R5 now contains build
StrCpy $0 "$R2.$R3.$R4.$R5" ; $0 now contains full version number
MessageBox MB_OK "Version: $0"
Abort
error:
MessageBox MB_OK "There was an error"