1. John Greiner
  2. PowerBuilder
  3. Monday, 10 June 2019 18:33 PM UTC

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.

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 3 May 2024 14:46 PM UTC
  2. PowerBuilder
  3. # 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

Comment
There are no comments made yet.
jalil Rehman Accepted Answer Pending Moderation
  1. Friday, 3 May 2024 02:54 AM UTC
  2. PowerBuilder
  3. # 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 IF

catch (runtimeerror err1)

ls_versioninfo = "0.0.0.0" // Unknown
end try

 

 

 

Thanks

 

Comment
  1. John Fauss
  2. Friday, 3 May 2024 05:04 AM UTC
There are some changes that are needed for many 32-bit API function calls to work in 64-bit.

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.
  1. Helpful
There are no comments made yet.
jalil Rehman Accepted Answer Pending Moderation
  1. Friday, 3 May 2024 01:36 AM UTC
  2. PowerBuilder
  3. # 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 

 

Comment
  1. Chris Pollach @Appeon
  2. Friday, 3 May 2024 01:49 AM UTC
Hi Jalil;

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
  1. Helpful
There are no comments made yet.
David Pylatuk Accepted Answer Pending Moderation
  1. Wednesday, 21 February 2024 14:08 PM UTC
  2. PowerBuilder
  3. # 4

Will look at this now. Thanks Chris.

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 20 February 2024 17:18 PM UTC
  2. PowerBuilder
  3. # 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

Comment
There are no comments made yet.
David Pylatuk Accepted Answer Pending Moderation
  1. Tuesday, 20 February 2024 16:56 PM UTC
  2. PowerBuilder
  3. # 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.

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 20 February 2024 21:53 PM UTC
Hi David;

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
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 10 June 2019 19:17 PM UTC
  2. PowerBuilder
  3. # 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

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.