Archive: Problem with FileInfo:GetProductVersion


Problem with FileInfo:GetProductVersion
Hi,

I am stuck and do not seem able to get this bug. I would appreciate any help possible.

I am trying to get the product version for NetMeeting that is installed on my windows XP machine. I use the same function to get another product version, but NetMeeting returns with an empty string. I have right clicked on the CB32.exe file and looked at the properties and they seem to be set with product version 3.01. Any ideas. I checked my inputs and they seem correct.

Here is the key function call code:
;*****************************************************
Function ExeVersionChecker

Pop $versionWanted
Pop $pathAndName
Pop $productName

ClearErrors
IfFileExists "$pathAndName" +4 +1
StrCpy $functResult 'Error: $productName was not found at: "$pathAndName"'
StrCpy $functResult '$functResult$\nConfirm that $productName version "$versionWanted" is present on the system.'
Goto Done
DetailPrint "path and name: $pathAndName"
ClearErrors
FileInfo::GetProductVersion "$pathAndName"
Pop $versionFound
DetailPrint "Version found: $versionFound"
StrCmp "" $versionFound +1 +4
StrCpy $functResult "Error: $productName version number could not be retrieved."
StrCpy $functResult '$functResult$\nConfirm that $productName version "$versionWanted" is present on the system.'

;************************************************

DetailPrint "path and name: $pathAndName" returns the correct path and file name for NetMeeting:
"path and name: C:\Program Files\NetMeeting\CB32.exe"

but this one:
DetailPrint "Version found: $versionFound"

returns:
"Version found: "

Any idea? Microsoft???

Thanks in advance.


Maybe this code will work:
GetDllVersion "$PROGRAMFILES\NetMeeting\CB32.exe" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
MessageBox MB_ICONINFORMATION|MB_OK "Version found: $R2.$R3.$R4.$R5"


DKom -- Thank you !!
DKom,

Thanks for taking the time to help. That did the trick.
Sorry I was slow getting back to letting you know.

John