Akhil Thomas
5-Jan-2024, 11:39 AM
Hi there,
How do i get the version info for web or flextron applications
In the CApplication.pkg , it uses cVersioninfo.pkg
and when it hits this method in the cversioninfo.pkg, my sFileName has proper path to the EXE but , the line 'Move (GetFileVersionInfoSizeW(AddressOf(sFilename), AddressOf(dwHandle))) to iInfoSize' returns 0 for iInfoSize
Procedure DoCreate WString sFileName
DWord dwHandle
Integer iInfoSize iVerSize iSuccess iVersion iVoid iFlags
WString sData
tWinVs_FixedFileInfo VsFixedFileInfo
WString sSubBlock
Pointer pVsFixedFileInfo
Move 0 to pVsFixedFileInfo
Move 0 to dwHandle
Move 0 to iVerSize
Move (GetFileVersionInfoSizeW(AddressOf(sFilename), AddressOf(dwHandle))) to iInfoSize
Set pbIncluded to (iInfoSize <>0)
If (pbIncluded(Self)) Begin
Move (Repeat(Character(0), iInfoSize)) to sData
Move (GetFileVersionInfoW(AddressOf(sFilename), 0, iInfoSize, AddressOf(sData))) to iSuccess
If (iSuccess <>0) Begin
Move "\" to sSubBlock
If (VerQueryValueW(AddressOf(sData), AddressOf(sSubBlock), AddressOf(pVsFixedFileInfo), AddressOf(iVerSize))) Begin
Move (memcopy(AddressOf(VsFixedFileInfo), pVsFixedFileInfo, iVerSize)) to iVoid // copy the structure
Move VsFixedFileInfo.dwFileVersionMS to iVersion
Set piVersionMajor to (Hi(iVersion))
Set piVersionMinor to (Low(iVersion))
Move VsFixedFileInfo.dwFileVersionLS to iVersion
Set piVersionRelease to (Hi(iVersion))
Set piVersionBuild to (Low(iVersion))
Move VsFixedFileInfo.dwFileFlags to iFlags
Set pbSpecialBuild to (iFlags iand VS_FF_SPECIALBUILD)
Set pbPrivateBuild to (iFlags iand VS_FF_PRIVATEBUILD)
End
End
End
End_Procedure
Best regards,
Akhil THomas
How do i get the version info for web or flextron applications
In the CApplication.pkg , it uses cVersioninfo.pkg
and when it hits this method in the cversioninfo.pkg, my sFileName has proper path to the EXE but , the line 'Move (GetFileVersionInfoSizeW(AddressOf(sFilename), AddressOf(dwHandle))) to iInfoSize' returns 0 for iInfoSize
Procedure DoCreate WString sFileName
DWord dwHandle
Integer iInfoSize iVerSize iSuccess iVersion iVoid iFlags
WString sData
tWinVs_FixedFileInfo VsFixedFileInfo
WString sSubBlock
Pointer pVsFixedFileInfo
Move 0 to pVsFixedFileInfo
Move 0 to dwHandle
Move 0 to iVerSize
Move (GetFileVersionInfoSizeW(AddressOf(sFilename), AddressOf(dwHandle))) to iInfoSize
Set pbIncluded to (iInfoSize <>0)
If (pbIncluded(Self)) Begin
Move (Repeat(Character(0), iInfoSize)) to sData
Move (GetFileVersionInfoW(AddressOf(sFilename), 0, iInfoSize, AddressOf(sData))) to iSuccess
If (iSuccess <>0) Begin
Move "\" to sSubBlock
If (VerQueryValueW(AddressOf(sData), AddressOf(sSubBlock), AddressOf(pVsFixedFileInfo), AddressOf(iVerSize))) Begin
Move (memcopy(AddressOf(VsFixedFileInfo), pVsFixedFileInfo, iVerSize)) to iVoid // copy the structure
Move VsFixedFileInfo.dwFileVersionMS to iVersion
Set piVersionMajor to (Hi(iVersion))
Set piVersionMinor to (Low(iVersion))
Move VsFixedFileInfo.dwFileVersionLS to iVersion
Set piVersionRelease to (Hi(iVersion))
Set piVersionBuild to (Low(iVersion))
Move VsFixedFileInfo.dwFileFlags to iFlags
Set pbSpecialBuild to (iFlags iand VS_FF_SPECIALBUILD)
Set pbPrivateBuild to (iFlags iand VS_FF_PRIVATEBUILD)
End
End
End
End_Procedure
Best regards,
Akhil THomas