The version information will display in the Windows property, but how does one access this to display it in a Power Builder window? Using the GetContextService for the ContextInformation returns version information for Power Builder itself and not the application.
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- Access the version information defined in Build Object using PB Script
- John Greiner
- PowerBuilder
- Monday, 10 June 2019 18:33 PM UTC
- Friday, 3 May 2024 14:46 PM UTC
- PowerBuilder
- # 1
Hi Jalil;
I just retested this again this AM in PB 2022 R3 build 3356 and the 64 bit EXE signature meta data was found OK ...
Please make sure that you are not using an older STD framework release but a release specific to this PB build.
FYI1: http://chrispollach.blogspot.com/2024/02/integrated.html (for PB 2022 R3 build 3289).
Note however that this build should auto migrate to build 3356 & run OK.
FYI2: The STD Framework 2024R2 is in release candidate status and specifically designed for build 3356 (with new features that is)
https://sourceforge.net/projects/stdfndclass/files/Applications/PowerBuilder/OrderEntry/Beta
HTH
Regards .. Chris
- Friday, 3 May 2024 02:54 AM UTC
- PowerBuilder
- # 2
Hi Chris,
Thanks for the prompt reply but
I can see the fileversion and other version in the details section of properties of the executable
but not able to get the fileversion information . Always getting 0.0.0.0 for fileversion
The following code works for the 32 bit application but not for the 64 bit Pcode . the runtime environment is 64 bit created from Powerbuilder runtime package 2022 R3
// as_filename represent exe file name built on 64 bit runtime
try
ulong dwHandle, dwLength
string ls_Buff, ls_key, ls_versioninfo
uint lui_length
long ll_pointer
integer li_rc
runtimeerror le_ex
le_ex = create runtimeerror
// Get version info length
dwLength = GetFileVersionInfoSize( as_filename, dwHandle )
IF dwLength <= 0 THEN
Throw le_ex
END IF
// Get version info text
ls_Buff = Space( dwLength )
li_rc = GetFileVersionInfo( as_filename, dwHandle, dwLength, ls_Buff )
IF li_rc = 0 THEN
Throw le_ex
END IF
// the strange numbers below represents the country and language
// of the version resource.
ls_key = "\StringFileInfo\040904e4\FileVersion"
IF NOT VerQueryValue( ls_buff, "\\", ll_pointer, lui_length ) OR lui_length <= 0 THEN
// Failed to find the version
Throw le_ex
ELSE
// Extract verson from the text
ls_versioninfo = Space( lui_length*2 ) // times 2 for unicode characters
CopyMemory( ls_versioninfo, ll_pointer, lui_length*2)
END IFcatch (runtimeerror err1)
ls_versioninfo = "0.0.0.0" // Unknown
end try
Thanks
- John Fauss
- Friday, 3 May 2024 05:04 AM UTC
Please refer to my post below. The OSVersion free code sample app on Roland Smith's TopWizProgramming web site contains code that will work in either 32-bit or 64-bit.
-
Helpful Loading... Helpful 0
- Friday, 3 May 2024 01:36 AM UTC
- PowerBuilder
- # 3
Hi Chris
I am updating the runtime environment from 32 bit to 64 bit . Could you please show how to extract fileversion info from the 64bit P-Code executable
- Chris Pollach @Appeon
- Friday, 3 May 2024 01:49 AM UTC
The current framework versions for PB 2021 & 2022 already handle native C/S, PowerServer & PowerClient App EXE signatures. That includes 64bit P-Code, 32bit P-Code & 32bit M-Code based applications. HTH
Regards ... Chris
-
Helpful Loading... Helpful 0
- Wednesday, 21 February 2024 14:08 PM UTC
- PowerBuilder
- # 4
Will look at this now. Thanks Chris.
- Tuesday, 20 February 2024 17:18 PM UTC
- PowerBuilder
- # 5
Hi, David -
Another alternative is to examine the OSVersion free code example application on Roland Smith's TopWizProgramming web site. It shows you how to extract this information from an exe or dll:
https://www.topwizprogramming.com/freecode_osversion.html
Here's an example of the information it extracted from Excel on my PC:
Best regards, John
- Tuesday, 20 February 2024 16:56 PM UTC
- PowerBuilder
- # 6
Very interested in this thread Chris. Would you be able to point me in the right direction in your framework where I would find the calls to return this string information?
Thank you.
- Chris Pollach @Appeon
- Tuesday, 20 February 2024 21:53 PM UTC
This information is gleaned off the EXE in the framework via ...
Object: nc_app_controller_master
Method: of_check_exe_version
Library: STD_FC_Base.pbl
HTH
Regards .. Chris
-
Helpful Loading... Helpful 0
- Monday, 10 June 2019 19:17 PM UTC
- PowerBuilder
- # 7
Hi John;
You are most welcome to extract the code from my framework. The framework also handles PowerServer Web App signature and PS Mobile App signature. 64bit P-Code, 32 bit P-Code & 32bit M-Code native PB Apps are supported. Following is a 32bit Machine-Code example:
HTH
Regards ... Chris
- Page :
- 1
However, you are not allowed to reply to this question.