Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: seeing on October 19, 2010, 06:33:17 pm

Title: How to add version number to DLL file
Post by: seeing on October 19, 2010, 06:33:17 pm
I had created a DLL project, how to add version number to DLL file.    thanks
Title: Re: How to add version number to DLL file
Post by: Folco on October 19, 2010, 06:46:16 pm
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_add_version_information_to_windows_executables_and_dll.27s.3F
Title: Re: How to add version number to DLL file
Post by: seeing on October 21, 2010, 06:14:51 pm
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"
}
Title: Re: How to add version number to DLL file
Post by: stahta01 on October 21, 2010, 07:04:36 pm
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.

Code
#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
Title: Re: How to add version number to DLL file
Post by: seeing on October 23, 2010, 05:48:55 am
thanks Folco and stahta01,

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