PDA

View Full Version : Web and Flextron Version Info



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

Dennis Piccioni
5-Jan-2024, 12:50 PM
Hi Akhil,

I used the sample code from the cVersionInfo (https://docs.dataaccess.com/dataflexhelp/mergedProjects/VDFClassRef/cVersionInfo.htm) page for FlexTron and basically the same code with ShowInfoBox instead of showln in a WebApp and it works.

Akhil Thomas
5-Jan-2024, 01:25 PM
Hi Dennis,

Thank you for the response. I tried doing that; at first it did not work , but then in my Studio menu options, Project --> Project Properties --> Version (tab) , the option for "Include version information in build" was not checked , and after i checked it, i am getting the version info with the code you shared (https://docs.dataaccess.com/dataflexhelp/mergedProjects/VDFClassRef/cVersionInfo.htm) .

Best regards,
Akhil Thomas

Michael Mullan
5-Jan-2024, 01:31 PM
I'm guessing that box is not checked by default for Flextron or webapps? That's probably an oversight. At least the doc for cVersionInfo should mention that flag.

Dennis Piccioni
25-Jul-2024, 04:07 PM
After months of exhaustive research :cool:, it turns out that this option isn't checked for ANY project type.

We don't intend to change this, but I will document the setting better, as you suggested.