Announcement

Collapse
No announcement yet.

PB Statement or Function to Get #RESOURCE VERSION$ info?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PB Statement or Function to Get #RESOURCE VERSION$ info?

    Is there any way USING INTRINSIC PB statements and/or functions such as RESOURCE$() to get any of the version info from an execjutable file?

    I see you can get STRING and RCDATA but no way to get the info you can put into your compiled program with the (and they do go in there) in the VERSION block? i.e
    Code:
    #RESOURCE VERSION$ "Comments",         "2.0 For PB/Win v10"
    
    #RESOURCE VERSION$ "CompanyName",      "Michael C. Mattias dba Tal Systems"
    #RESOURCE VERSION$ "FileDescription",  "Read and Convert COBOL-created Data"
    
    #RESOURCE VERSION$ "FileVersion",      "2.00"
    #RESOURCE VERSION$ "InternalName",     "COB2iEEE"
    #RESOURCE VERSION$ "LegalCopyright",   "Public Domain"
    #RESOURCE VERSION$ "LegalTrademarks",  "None"
    #RESOURCE VERSION$ "OriginalFilename", "COB2IEEE"
    'RESOURCE VERSION$ "PrivateBuild",     "Private info"
    #RESOURCE VERSION$ "ProductName",      "None"
    #RESOURCE VERSION$ "ProductVersion",   "2.0"
    #RESOURCE VERSION$ "Author",         "Michael C. Mattias Port Washington WI May 2023"
    #RESOURCE VERSION$ "Compiler"   ,    "PB/Windows v 10.0.4"
        ​
    All these are going into the program resource (per Resource Hacker) but the only way to get them out might be to use the WinAPI calls for version management.

    I can get these data using the WinAPI but I'd prefer to use intrinsic PB statements/functions if available.

    If the answer is "no" just say so and I will take it from there. (Both using and reporting as needed new feature).

    Thanks,
    MCM
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

  • #2
    From Help for #RESOURCE
    This resource is intended to be used with the Version Information API functions, so that Windows Explorer, and other programs, can display the relevant information about your EXE.​
    Looks like API way.

    And, an opportunity to put something in Source Code forum.

    Cheers,
    Dale

    Comment


    • #3
      $MY_VERSION_ID = "1.23"

      #RESOURCE VERSION$ "FileVersion", $MY_VERSION_ID


      ...

      ? $MY_VERSION_ID

      Viola!
      "Not my circus, not my monkeys."

      Comment


      • #4
        And, an opportunity to put something in Source Code forum.

        Well , I may not have to... I found this in the source code forum from Kev Peel (with credit to Egbert Ziljema) from 2000:



        Looks like what I was working out from scratch earlier today.

        I can get the file module and name info from GetModuleHandle() and GetModuleFilename()
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          My solution won't work for you?
          "Not my circus, not my monkeys."

          Comment


          • #6
            Code:
            MACRO c_AppVerMajor     = 1
            MACRO c_AppVerMinor     = 0
            MACRO c_AppVerRevision  = 0		' 0 alpha - 1 beta - 2 release candidate -  3 final release
            MACRO c_AppVerBuild     = 211
            
            
            '----------------------------------------------------------------------------(')
            
            'Version info block
            #RESOURCE VERSIONINFO
            #RESOURCE FILEVERSION     c_AppVerMajor, c_AppVerMinor, c_AppVerRevision, c_AppVerBuild
            #RESOURCE PRODUCTVERSION  c_AppVerMajor, c_AppVerMinor, c_AppVerRevision, c_AppVerBuild
            #RESOURCE FILEFLAGS       0
            #RESOURCE STRINGINFO      "0409", "04B0"
            #RESOURCE VERSION$        "FileDescription", "BTNetMgr"
            #RESOURCE VERSION$        "LegalCopyright", "Copyright © 2023 George W. Bleck"
            #RESOURCE VERSION$        "OriginalFilename", "BTNetMgr"
            #RESOURCE VERSION$        "ProductName", "BTNetMgr"
            <b>George W. Bleck</b>
            <img src='http://www.blecktech.com/myemail.gif'>

            Comment


            • #7
              My solution won't work for you?
              Not directy; I am trying to get the info from a loaded DLL. (Which may have never worked using PB statements anyway).

              But I think I will go with that idea via an indirect method because I'm not so sure IN THIS CASE if creating the "generic" version (works on anything) is worthwhile.

              I am trying to fix up the problem found in this... https://forum.powerbasic.com/forum/u...to-ieee-format

              MCM
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment

              Working...
              X