VERSININFO resource

This is a discussion on VERSININFO resource within the Windows Programming forums, part of the Platform Specific Boards category; [splt from http://cboard.cprogramming.com/showthread.php?t=87067 - please don't hijack other threads; Ken Fitlike] On the topic of resources, can anyone post an ...

  1. #1
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    [splt from Resources - please don't hijack other threads; Ken Fitlike]

    On the topic of resources, can anyone post an example of how to properly use a VERSIONINFO resource?
    Here's the closest I've come so far, but I think its still wrong somewhere:
    Code:
    versionID VERSIONINFO
    FILEVERSION 1,0,0,0
    PRODUCTVERSION 1,0,0,0
    FILEOS VOS_NT_WINDOWS32
    FILETYPE VFT_APP
    BEGIN
        BLOCK "StringFileInfo"
        {
            /*english-ASCII */
            BLOCK "0x0409-0"
            {
                VALUE "Comments", "comment"
                VALUE "CompanyName", "My Company Name"
                VALUE "FileVersion", "1.0"
                VALUE "InternalName", "app.exe"
                VALUE "OriginalFilename", "app.exe"
                VALUE "ProductName", "My Application"
                VALUE "ProductVersion", "1.0"
            }
        }
    END
    It compiles okay, but when I open up the properties sheet for my .exe in windows, the version information sheet is still filled with blank fields....

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Here's a working .rc file which fills out some of the version info. I can't explain it though, sorry.

    Code:
    #include "afxres.h"
    
    1 VERSIONINFO
    FILEVERSION 1700,0,0,0
    BEGIN
            BLOCK "StringFileInfo"
            BEGIN
                    BLOCK "040904b0"
                    BEGIN
                            VALUE "FileVersion", "1700"
                            VALUE "CompanyName", "MyCompanyName"
                            VALUE "Comments", "Automated RC file generated"
                    END
            END
    
            BLOCK "VarFileInfo"
            BEGIN
                    VALUE "Translation", 0x409, 1200
            END
    END
    Callou collei we'll code the way
    Of prime numbers and pings!

  3. #3
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    Thanks a lot, no worries on the content, I know what all the values are, i just was utterly confused on what order/syntax was to fill it with.
    I still can't seem to get the following tab to display on my exe, maybe I'm just going about it entirely wrong.... any suggestions?
    Attached Images Attached Images  
    Last edited by @nthony; 01-16-2007 at 12:57 AM.

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    The documentation can be confusing.
    Code:
    versionID VERSIONINFO
    This must be:
    Code:
    1 VERSIONINFO
    as shown by QuestionC.

    If it's still not working, can you post your current attempt?

  5. #5
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    Yea, I have to admit I chuckled at myself for actually typing out versionID :P
    Here is what I have currently (pretty muched copied of QuestionC's response):
    -EDIT-
    Actually, I did not realize how verbose that example had to be, I thought versionID might be a programmer-defined identifier value much like with other resources (so i gave it some value... 5), but after strictly giving it value 1, it then worked fine.
    Thanks for all your help guys, much appreciated!
    Last edited by @nthony; 01-16-2007 at 06:34 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting out a resource manager
    By psychopath in forum Game Programming
    Replies: 1
    Last Post: 11-10-2008, 07:12 PM
  2. unmanaged resource
    By George2 in forum C++ Programming
    Replies: 2
    Last Post: 01-03-2008, 04:23 AM
  3. CreateProcess with Resource of executable, not the Filename
    By Ktulu in forum Windows Programming
    Replies: 4
    Last Post: 11-04-2006, 01:07 AM
  4. resource problem/question
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 01-29-2003, 02:08 PM
  5. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 10:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21