News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

How to add version number to DLL file

Started by seeing, October 19, 2010, 06:33:17 PM

Previous topic - Next topic

seeing

I had created a DLL project, how to add version number to DLL file.    thanks


seeing

I have created version.rc, but it alway has      version.rc:1: syntax error

the file is


LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

VS_VERSION_INFO    VERSIONINFO
  FILEVERSION      1,0,0,1
  PRODUCTVERSION   1,0,0,1
  FILEFLAGSMASK    0x3fL // VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
  FILEFLAGS        0x1L  // VS_FF_DEBUG|VS_FF_PRIVATEBUILD|VS_FF_PRERELEASE
#else
  FILEFLAGS        0x0L  // final version
#endif
  FILEOS           VOS_NT_WINDOWS32
  FILETYPE         VFT_APP
  FILESUBTYPE      VFT2_UNKNOWN // not used
{
  BLOCK "StringFileInfo"
  {
    BLOCK "040904E4" // Lang=US English, CharSet=Windows Multilingual
    {
      VALUE "Build",            "August 2007\0"
      VALUE "Comments",         "Free for personal use only.\0"
      VALUE "CompanyName",      "Fake Company\0"
      VALUE "Developer",        "The Developer\0"
      VALUE "FileDescription",  "Application implementing something\0"
      VALUE "FileVersion",      "1.0.000\0"
      VALUE "InternalName",     "AppInternalName\0"
      VALUE "LegalCopyright",   "Copyright (C) 2007 Fake Company\0"
      VALUE "LegalTrademarks",  "All rights reserved.\0"
      VALUE "OriginalFilename", "TheEXE.exe\0"
      VALUE "PrivateBuild",     "\0"
      VALUE "ProductName",      "The EXE\0"
      VALUE "ProductVersion",   "1.0.000\0"
      VALUE "SpecialBuild",     "\0"
      VALUE "Support",          "TheEXE at fake-domain.com\0"
      VALUE "Users",            "Unlimited.\0"
    } // BLOCK "040904E4"
  } // BLOCK "StringFileInfo"
  BLOCK "VarFileInfo"
  {
    VALUE "Translation", 0x409, 1252 // 1252 = 0x04E4
  } // BLOCK "VarFileInfo"
}

stahta01

#3
I have tested the CB Sample changed to below; I have no real experience writing RC files; have edited a few to work under MinGW GCC.

Changed "{" to "BEGIN" and "}" to "END"; added "#include <windows.h>".

Tim S.


#include <windows.h>
//#include <winnt.h>


LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

VS_VERSION_INFO    VERSIONINFO
 FILEVERSION      1,0,0,1
 PRODUCTVERSION   1,0,0,1
 FILEFLAGSMASK    0x3fL // VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
 FILEFLAGS        0x1L  // VS_FF_DEBUG|VS_FF_PRIVATEBUILD|VS_FF_PRERELEASE
#else
 FILEFLAGS        0x0L  // final version
#endif
 FILEOS           VOS_NT_WINDOWS32
 FILETYPE         VFT_APP
 FILESUBTYPE      VFT2_UNKNOWN // not used
BEGIN
 BLOCK "StringFileInfo"
 BEGIN
   BLOCK "040904E4" // Lang=US English, CharSet=Windows Multilingual
   BEGIN
     VALUE "Build",            "August 2007\0"
     VALUE "Comments",         "Free for personal use only.\0"
     VALUE "CompanyName",      "Fake Company\0"
     VALUE "Developer",        "The Developer\0"
     VALUE "FileDescription",  "Application implementing something\0"
     VALUE "FileVersion",      "1.0.000\0"
     VALUE "InternalName",     "AppInternalName\0"
     VALUE "LegalCopyright",   "Copyright (C) 2007 Fake Company\0"
     VALUE "LegalTrademarks",  "All rights reserved.\0"
     VALUE "OriginalFilename", "TheEXE.exe\0"
     VALUE "PrivateBuild",     "\0"
     VALUE "ProductName",      "The EXE\0"
     VALUE "ProductVersion",   "1.0.000\0"
     VALUE "SpecialBuild",     "\0"
     VALUE "Support",          "TheEXE at fake-domain.com\0"
     VALUE "Users",            "Unlimited.\0"
   END // BLOCK "040904E4"
 END // BLOCK "StringFileInfo"
 BLOCK "VarFileInfo"
 BEGIN
   VALUE "Translation", 0x409, 1252 // 1252 = 0x04E4
 END // BLOCK "VarFileInfo"
END
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

seeing

thanks Folco and stahta01,

I have tryed out, it must be add #include <winver.h>